cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Need Help In query

call apoc.periodic.iterate("MATCH (n:user {USR_ID:'1234567'}) CALL apoc.path.subgraphNodes(n, {bfs:true,relationshipFilter:'HAVE_MOBILE|HAVE_PHONE|HAVE_EMAIL',labelFilter:'', filterStartNode:false, limit:100000, optional:false}) YIELD node"," CREATE(n:user {USR_ID:node.USR_ID})-[:IS_CONNECTED]->(:GROUP) AND SET n.GFLAG=1",{batchSize:1, parallel:false, iterateList:true, retries:3})

actually i want that all the user node in a subgraph should be connected to a group node.

above query is wrong as its giving this error: Neo.ClientError.Procedure.ProcedureCallFailed: Failed to invoke procedure apoc.periodic.iterate: Caused by: org.neo4j.cypher.internal.v3_5.util.SyntaxException: Query cannot conclude with CALL (must be RETURN or an update clause) (line 1, column 66 (offset: 65))

i ran subgraph query alone which was working fine .
MATCH (n:user {USR_ID:'1234567'}) CALL apoc.path.subgraphNodes(n, {bfs:true,relationshipFilter:'HAVE_MOBILE|HAVE_PHONE|HAVE_EMAIL',labelFilter:'', filterStartNode:false, limit:100000, optional:false}) YIELD node

2 REPLIES 2

You can modify the query to something like:

call apoc.periodic.iterate("MATCH (n:user {USR_ID:'1234567'}) with n CALL apoc.path.subgraphNodes(n, {bfs:true,relationshipFilter:'HAVE_MOBILE|HAVE_PHONE|HAVE_EMAIL',labelFilter:'', filterStartNode:false, limit:100000, optional:false}) YIELD node with node return node"," CREATE(n:user {USR_ID:node.USR_ID})-[:IS_CONNECTED]->(:GROUP)",{batchSize:1, parallel:false, iterateList:true, retries:3})

This query is not working can can any one give modified query

simply i want that the subgraph which is obtained with many "user" nodes so there nodes are connected in same way to each other.

so i want all these node pointing to some node "group" ... representing that these are of same group.

if need more clarification i can give diagrammatic representation...