On Wed, Nov 30, 2011 at 11:32 AM, dnagir <dna...@gmail.com> wrote:

> I would probably like to write something among these lines (it's not valid
> query of course):
>
>
> START s=node(10)
> MATCH p = s<-[:whatever]-t
> RETURN t, LENGTH(p) as len
> HAVING len >= MAX( LENGTH(p) )
>

Well, this query would also return 'b' in the example you shared above. I
think we need something that says "follow this path until you can't follow
it any more". If you're working with a B-tree, you should be able to say
"given this sub-root, give me all leafs". Something like:

START c = node(17)
MATCH x<-[*END]-c
RETURN x

I really don't like this syntax, but I think the information belongs in
there somewhere...

Seems like clause similar to SQL HAVING is missing.
>
> It doesn't "exactly" reflect what I want but just thought from top of my
> head.
>
> So currently I have to use other query language if I want to do this.
> Right?


A traversal would do it pretty simply. Maybe someone else can share a
end-of-graph traversal example?

I'm sure Gremlin can do it as well. Don't know how to do it in Gremlin
though - Peter, Marko?

Andrés
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to