It looks like it returns the structure, but the values aren’t there…
g = TinkerGraphFactory.createTinkerGraph()
root = g.v(1)
def tree
def results = []
tree = { vertices ->
vertices.each() {
children = it.out().toList()
if (children)
results << tree(children)
}
results.toList()
}
println tree(root)
Here are the results…
$ ./gremlin.sh -e treeTest.groovy
[[], [[]]]
NOTE: I normally work in Python not Groovy so I am probably missing something obvious.
1 Answer