i have a neo4j graph that pictures a transportation system.
My nodes are:
- Stop (like a bus stop)
- Connection (connection node between 2 stops)
Relationships:
(Stop)-[:HAS]->(Connection)-[:TO]->(Stop)
My problem is that this pattern might repeat multiple times like this:
(Stop)-[:HAS]->(Connection)-[:TO]->(Stop)-[:HAS]->(Connection)-[:TO]->(Stop)-[:HAS]->(Connection)-[:TO]->(Stop)
I would like to have a cypher query with that i can find a connection between 2 stops even if there are multiple -[:HAS]->(Connection)-[:TO]->
steps between them.
I tried
MATCH (:Stop)-[:HAS]->(:Connection)-[:TO]->(:Stop)
but with this i only get results with only 1 hop. I hope my question is understandable. Kind regards