Help with getting a graph that i've created

You have specified a very specific pattern to match. It looks like two paths matched and where returned. You could try a more generalized pattern to obtain all the paths, such as:

MATCH p=(n:SubGraphInstance)-[*]-()
WHERE n.name= "batman"
RETURN p

I see from the data, that there looks to be four paths originating from the Batman node and terminating on a ā€˜Variable’ node that has only an incoming FUNCTIONS_VARS relationship type. We can use that to get more targeted and get just those paths. The following looks for paths starting from Batman and terminating on a ā€˜Variable’ node, I.e, no outgoing relationships.

MATCH p=(n:SubGraphInstance)-[*]-(va:Variable)
WHERE n.name= "batman
AND not exists ( (va)-[]->() )
RETURN p

There are also APOC methods to retrieve subgraphs originating from a node. Maybe one of the APOC experts will provide such a solution.

1 Like