I have a linked list B -> C -> G
It's created in the TinkerPop Console with
graph = TinkerGraph.open()
g = traversal().withEmbedded(graph)
g.addV('TreeNodeEntity').property(single, 'Name', 'B').as('l1')
g.addV('TreeNodeEntity').property(single, 'Name', 'C').as('l1').addE('PreviousSiblingEntity').to(__.V().has('Name', 'B'))
g.addV('TreeNodeEntity').property(single, 'Name', 'G').as('l1').addE('PreviousSiblingEntity').to(__.V().has('Name', 'C'))
I try to get all siblings of B.
The following gremlin script returns C and G like I expected
g.V().
has('Name', 'B').
as('l1').
repeat(__.
bothE('PreviousSiblingEntity').
otherV().
simplePath()
).
emit().
valueMap()
But the following script doesn't give me any value.
g.V().
has('Name', 'B').
as('l1').
select('l1').
repeat(__.
bothE('PreviousSiblingEntity').
otherV().
simplePath()
).
emit().
valueMap()
Background: I want to do a .inE('ParentEntity').otherV().as('l2') between as('l1') and select('l1').
Can you give me a hint why the second script doesn't give me a result?