I am doing a project in which I am required to return the path or nodes in a path from a particular start node.I have manually passed the start node to the query.I need to continue down the path till the relation propert 'Action' between two consecutive nodes are "ODC". If the 'Action' property is "ODSN",I have to break from the particular path and return the next node alone separately.I am required to process all the paths from a particular start node in this manner.I had tries using the apoc.subgraphAll procdure but i am not detting the desired result
MATCH (c:Customer {customer_id: 4})
CALL apoc.path.subgraphAll(c, {
relationshipFilter: ">",
minLevel: 1
})
YIELD nodes, relationships
UNWIND relationships as rel
WITH nodes, rel
WHERE rel.Action = 'ODC'
RETURN DISTINCT nodes
Is there another method to approach this or should be using another apoc procedure?
Actually my data model consists of arbitrary relationship labels .The depth of each path is not constant or defined.The relationship between any two nodes changes multiple times in each path.So i cannot define a particular value.Could you please suggest another method other than this,if possible.
Considering i have to obtain all the nodes in the subgraph of n:Customer with customer_id 4....Starting from this node i have to traverse each node in the path originating with 'n' and break or stop traversing down the path when a relationship with 'Action' property is set to "ODC".Each relationship definitely has this property in my model.
After breaking from one path I have to check the other paths originating from this node 'n'.I have to repeat this process till all paths are traversed and return the relevant nodes.
I am required to store these nodes in a data structure in java.
Any guidance on how to approach this would be very helpful.Thanks