gremlin> g.V().until(outE().count().is(0)).repeat(out()).values('name')==>lop==>vadas==>ripple==>lop==>vadas==>lop==>ripple==>lop==>ripple==>lopgremlin> g.V().repeat(out()).until(outE().count().is(0)).values('name')==>lop==>vadas==>ripple==>lop==>ripple==>lop==>lopgremlin>
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/010abf1c-e8c4-4819-b3e5-283a5a0008f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
gremlin> subgraph = g.V(4264).repeat(__.inE().subgraph('subGraph').outV()).times(15).cap('subGraph').next()
==>tinkergraph[vertices:6 edges:5]
gremlin> sg = subgraph.traversal(standard())
==>graphtraversalsource[tinkergraph[vertices:6 edges:5], standard]
gremlin> sg.V().sort()
==>v[4184]
==>v[4256]
==>v[4264]
==>v[4280]
==>v[8280]
==>v[8352]
Same query except starting with node id 12376
gremlin> subgraph = g.V(12376).repeat(__.inE().subgraph('subGraph').outV()).times(15).cap('subGraph').next()
==>tinkergraph[vertices:8 edges:7]
gremlin> sg = subgraph.traversal(standard())
==>graphtraversalsource[tinkergraph[vertices:8 edges:7], standard]
gremlin> sg.V().sort()
==>v[4184]
==>v[4256]
==>v[4264]
==>v[4280]
==>v[4288]
==>v[8280]
==>v[8352]
==>v[12376]
g.V(4264).emit().repeat(out()).times(15)
g.V(4264).emit().repeat(out()).times(15).order().by(id)
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/09f8b387-4eba-4d6f-ab3e-510b37580a7c%40googlegroups.com.
<test-graph.png>
gremlin> g.V(4264)
==>v[4264]
gremlin> g.V(4264).emit().repeat(out()).times(15).sort()
==>v[4112]
==>v[4208]
==>v[4208]
==>v[4264]
==>v[4288]
==>v[4336]
==>v[8304]
==>v[8304]
==>v[12376]
==>v[4184]
==>v[4256]
==>v[4264]
==>v[4280]
==>v[8280]
==>v[8352]
Except for the subgraph query, I haven't been able to construct a query to get this output. But I realize I should NOT have to create a subgraph. Should be able to traverse the original graph.
Thanks for your help.
Geary
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/94c29e69-8483-4740-bf50-5ba0106e8948%40googlegroups.com.
gremlin> g.V(4264).emit().repeat(in()).times(15)
groovysh_parse: 2: unexpected token: in @ line 2, column 25.
g.V(4264).emit().repeat(in()).times(15)
^
1 error
Display stack trace? [yN] n
gremlin> g.V(4264).emit().repeat(inE()).times(15)
==>v[4264]
==>e[6q3-6e0-4r9-3ag][8280-OUT->4264]
Expected traverser of Titan vertex but found: e[6q3-6e0-4r9-3ag][8280-OUT->4264]
Display stack trace? [yN] n
gremlin>
But the combo of inE() and outV() seems to work:
gremlin> g.V(4264).emit().repeat(inE().outV()).times(15)
==>v[4264]
==>v[8280]
==>v[8352]
==>v[4256]
==>v[4280]
==>v[4184]
Also. using an until clause to stop when a vertex is reached with no input edges seems to work. I don't know if this is more efficient or preferable to using the times() step. Is this the best way when you don't know how many iterations are needed to reach vertices without input edges?
gremlin> g.V(4264).emit().repeat(inE().outV()).until(inE().count().is(0))
==>v[4264]
==>v[8280]
==>v[8352]
==>v[4256]
==>v[4280]
==>v[4184]
Geary
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/8c0a844e-8755-4e33-b7c7-85e7e83b93cf%40googlegroups.com.