I want to return one row for each segment in a path. This is the Cypher code I've devised so far. There must be a better way.
match ... --> (i:IMAGE)
match p = (i)-[*]->(f:IMAGE) where NOT (f)-->(:IMAGE)
with nodes(p) as q
with [[q[0],q[1]], [q[1],q[2]], [q[2],q[3]], [q[3],q[4]], [q[4],q[5]], [q[5],q[6]]] as tuples
unwind tuples as seg
return seg[0].name as from, seg[1].name as to
My biggest problem is that it only goes six levels deep. Another inconvenience is that it returns lots of null rows for shallow paths.