I have built a a class graph of legacy code base with Neo4j. I'm trying to query for all the methods of parent class that are overridden in a child class.
My nodes and relationships look something like this:
Classes are defined as such:
(c:Class {name: "ClassName"})-[:IS_CHILD_OF]->(p:Class {name: "ParentClassName")
Methods are defined as such:
(c:Class)-[:HAS]->(m:Method {name: "methodName"})
I don't have much experience with Neo4j, but this is the best I came up with so far for the query:
MATCH (child:Class)-[:HAS]->(m) MATCH (parent:Class)-[:HAS]->(mp) WHERE m.name = mp.name AND child-[:IS_CHILD_OF]->parent RETURN child, parent;
It seems to be doing something, but this query has been running for some time now, and i'm not even sure if that will be the result I'm looking for. Any pointers?