Peter,
there is no concept of END_OF_GRAPH in Neo4j or Gremlin. It is merely
the concept of not including a depth-related component into the stop
condition of a traversal. So, your query could maybe be something like
g.v(%d).out('JOURNEY').loop(1){it.object.getProperty('stop_id') !=
'%d'}.out('HOP').paths
Note the shorter notation of steps that simply filter by direction and
label of the edges. Does this work? Also, you might need to take into
account that the stop_id might not be present on some nodes in your
closure?
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
http://www.neo4j.org - Your high performance graph database.
http://startupbootcamp.org/ - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
On Thu, Aug 18, 2011 at 4:17 PM, picklepete <[email protected]> wrote:
> Hey Peter,
>
> Thanks for the quick reply. I actually started work on my migration using
> Gremlin, my original query looks like this:
>
> g.v(%d).outE{it.label=='JOURNEY'}.inV.loop(3){it.loops < 5 &
> it.object.getProperty('stop_id') != '%d'}.outE{it.label=='HOP'}.inV.paths
>
> I would be querying on one of the black (selected) nodes here:
> http://cl.ly/9O22. Basically going from one node and looping until I reach a
> node with a property called 'stop_id' and its value matching my criteria.
> Unfortunately I couldn't figure out how to make the query loop until it
> matched the node, I had to specify a 'it.loops'.
>
> Is there an equivalent END_OF_GRAPH filter in Gremlin?
>
> Cheers,
> - Peter
>
> --
> View this message in context:
> http://neo4j-community-discussions.438527.n3.nabble.com/Depth-and-traversals-in-journey-planner-migration-tp3261892p3265011.html
> Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user