Well,
in Gremlin, it is basically scripting, so you would probably do a loop
and follow the pattern until you are at the right depth, see
http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-flow-algorithms-with-gremlin
for a flow algo that loops until the target node = sink, without any
hard limitation.

Cheers,

/peter neubauer

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

brew install neo4j && neo4j start
heroku addons:add neo4j



On Wed, Nov 30, 2011 at 11:46 AM, Andres Taylor
<andres.tay...@neotechnology.com> wrote:
> 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
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to