Hi,
I have a graph that contains cyclic structures. In order to simplify the viewing of the structure, (in other software), I used to create a tree out of it and view the tree instead.
In Gremlin, I make use of subgraph() to display a small portion of my larger graph.
I can use tree() to create a tree structure, however, I don't see how I can make a subgraph after I created a tree.
This is my query so far:
g.V().has('name','W').as('source') \
.repeat(__.inE().as('in') \
.where('in',neq('source')).by(outV().id()).by(id()) \
.subgraph('subGraph').outV().as('out')) \
.times(3).cap('subGraph')
as you can see, I prevent nodes coming back to the first level ('source') by my where statement. If I want to generalize this, I'd have to keep track of all the nodes that I passed so far and use a 'within' statement for the lookup.
My question is how to collect the list of growing nodes over the repeat and use them in the within statement.
Thanks!
Olav