I want to retrieve all the relationships and nodes present between two nodes from the graph I created using neo4j. I am using py2neo
and I want to know how can we write a cypher
query which can retrieve intermediate relationships between two nodes and also the intermediate nodes between those two nodes.
For ex:
(A)-[relation1]->(B)-[relation2]->(C)-[relation3]->(D)
If I give A
as starting node and D
as ending node, I want the output to be as set of relations relation1,relation2,relation3
and set of intermediate nodes as B
and C
.