Using a subgraph for cypher projection (APOC)


I am trying to perform basic APOC graph algorithms (i.e., betweenness-centrality) on a subgraph resulting from a Cypher query.

I am creating a subgraph using a number of specified nodes by name (i.e., A, B, C) and their first degree neighbors; a sample code is attached below. However, I have not been successful with trying to run APOC procedures via cypher projection. What seems to be an issue here?

Thank you.

"MATCH (d) WHERE IN ['A', 'B', 'C'] RETURN id(d) AS id",
"MATCH (d)-[*1]-(m) RETURN id(d) as source, id(m) as target",
{graph:'cypher', write: true})

YIELD nodeId, centrality
RETURN nodeId,centrality order by centrality desc