I'd like to define a Gremlin query which returns all the nodes recursively till there are no more nodes available:
Node: ProductionEvent
Node: Product
What I've tried so far is the following...however, I'm not sure if the output is correct. Also, is it possible to print it out using the tree() function? And can I do the repeat function with the times function to get all nodes?
g.V().hasLabel('ProductionEvent').
repeat(__.outE('consumes').simplePath()).times(3).
emit().dedup()
Im expecting an output like this
Product1: consumed <--- ProductionEvent1 --> produced :Product2: consumed <--- ProductionEvent2 --> produced :Product3