Matching and returning a path should return the nodes and the relationships between them in path order.
According to the Cypher documentation, this should include the relationship types. If you look at the developer docs, and search for any query that ends with return p
, the returned pattern always includes the type of each relationship, such as:
[Node[2]\{name:"Michael Douglas"\},:ACTED_IN[5]\{role:"President Andrew Shepherd"\},Node[6]\{title:"The American President"\}]
However, in the Neo4j 3.0.3 browser (and assuming other versions as well, haven't seen the fix in the 3.0.4 changelog), any output of a relationship (whether as part of a path or otherwise) returns the relationship properties only, or an empty object {} if no properties exist. The type doesn't output at all:
[{name: Black}, {}, {name: Red}, {}, {name: Yellow}, {}, {name: Black}, {}, {name: Blue}]
I can output the relationships separately, in another column by adding this to the return:
EXTRACT(rel in RELS(path) | TYPE(rel)) as relType
But what I really want is the path output (lists of nodes and relationships between each node) but including the relationship type.
Is there some option I can turn on, or some other function or query workaround that outputs this?