As I am new to neo4j, I am currently experimenting with the neo4j movie database sample.
I was wondering what the best way was to compare subgraphs and relationships, for example, how to get all movies with identical crew.
Based on other questions here on stackoverflow, I got it to work to return all movies where specific actors acted in together:
WITH ['Tom Hanks', 'Meg Ryan'] as names
MATCH (p:Person)
WHERE p.name in names
WITH collect(p) as persons
WITH head(persons) as head, tail(persons) as persons
MATCH (head)-[:ACTED_IN]->(m:Movie)
WHERE ALL(p in persons WHERE (p)-[:ACTED_IN]->(m))
RETURN m.title
But, how could I retrieve movies with identical actors without specifying the actors names?