Recursively query simpler tree-like structures with Gremlin
Consider the following data: g.addV('RootTopic').property('name', 'A').as('A') .addV('RootTopic').property('name', 'M').as('M') .addV('Topic').property('name', 'A1').as('A1') .addV('Topic').property('name', 'A2').as('A2') .addV('Topic').property('name', 'B1').as('B1') .addV('Topic').property('name', 'B2').as('B2') .addV('Topic').property('name', 'N1').as('N1') .addV('Topic').property('name', 'N2').as('N2') .addV('Topic').property('name', 'O1').as('O1') .addE('refines').from('A').to('A1') .addE('refines').from('A').to('A2') .addE('refines').from('A1').to('B1') .addE('refines').from('A1').to('B2