[Neo4j] Cypher <3 Trees

Andres Taylor andres.taylor at neotechnology.com
Wed Dec 7 16:55:47 CET 2011


On Wed, Dec 7, 2011 at 4:14 PM, Peter Neubauer <
peter.neubauer at neotechnology.com> wrote:

> Mmh,
> I would like to see that I can specify the "stem" of the tree as a
> path and then get leaf nodes out from that


Yeah, the cook book exposed this weakness clearly...


> , something like
>
> START root = node(0)
> MATCH stem=root->(dir?*), stem-[:LEAF]->leaf
> WHERE all(x in nodes(stem)
> WHERE x.importance > 30)
> RETURN leaf, stem
>

My idea was to do something similar to shortestPath:

START root=node(0)
MATCH leafPath = getAllLeafPaths( root-[:LEAF*]->leafNode )
RETURN leafNode

What do you think about this syntax?

André


More information about the User mailing list