g.V("some V").repeat(out("child").simplePath().dedup()).times(depth).tree().next()
Nevermind - https://github.com/tinkerpop/gremlin/wiki/Tree-Pattern seems to fit the bill nicely
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/94c72d38-c45f-4024-bfe4-4e4515c3c4a8%40googlegroups.com.--
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.
gremlin> g = TinkerFactory.createModern().traversal()==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]gremlin> g.V().repeat(out()).times(2).emit().tree()==>[v[1]:[v[2]:[:], v[3]:[:], v[4]:[v[3]:[:], v[5]:[:]]], v[4]:[v[3]:[:], v[5]:[:]], v[6]:[v[3]:[:]]]gremlin> g.V().repeat(out()).times(2).emit().tree().next()==>v[1]={v[2]={}, v[3]={}, v[4]={v[3]={}, v[5]={}}}==>v[4]={v[3]={}, v[5]={}}==>v[6]={v[3]={}}gremlin>
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/c899d2d3-622f-4a09-9678-e0f16f261fca%40googlegroups.com.
g.v("some V").as("x").out("child").simplePath().dedup().loop("x") {it.loops <= depth} {true}.tree().cap()
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/c899d2d3-622f-4a09-9678-e0f16f261fca%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/fcbc7adb-e3da-4985-a6c4-32ebbca2ef70%40googlegroups.com.