Neo4j Path returned with falsely alternating relationship directions in cypher-shell

Viewed 129

Having troubles understanding the relationship direction in returned paths.

I have a graph like this

(:START)-[:NEXT]->(:NODE)-[:NEXT]->(:NODE)...

Now I am matching all paths starting from the start node in the direction of :NEXT up to a length of 10, say. Query looks like

MATCH t=((:START)-[:NEXT*..10]->(:NODE))
RETURN t;

I am getting output paths with seemingly mixed up :NEXT directions like

(:START)-[:NEXT]->(:NODE)<-[:NEXT]-(:NODE)-[:NEXT]->(:NODE)<-...

and I can't understand where the alternating directions come from.

EDIT: The graph is just a straight line (with one direction). No cycles, no branch-offs. Please replicate the scenario in the shell with the following:

CREATE (s:START);
MATCH (s:START) MERGE (s)-[:NEXT]->(a:NODE)-[:NEXT]->(b:NODE)-[:NEXT]->(c:NODE)-[:NEXT]->(d:NODE);
MATCH t=((:START)-[:NEXT*..10]->()) return t;

+------------------------------------------------------------------------------+
| t                                                                            |
+------------------------------------------------------------------------------+
| (:START)-[:NEXT]->(:NODE)                                                    |
| (:START)-[:NEXT]->(:NODE)<-[:NEXT]-(:NODE)                                   |
| (:START)-[:NEXT]->(:NODE)<-[:NEXT]-(:NODE)-[:NEXT]->(:NODE)                  |
| (:START)-[:NEXT]->(:NODE)<-[:NEXT]-(:NODE)-[:NEXT]->(:NODE)<-[:NEXT]-(:NODE) |
+------------------------------------------------------------------------------+

See how in the returned paths, the arrows alternate in direction? That's what is confusing me.

1 Answers
Related