Gremlin .match()

Viewed 1047

I have a query in Gremlin, using Datastax studio that looks like this:

g.V().has('vertexLabel', 'vertexProperty1', '12345').match(
    __.as('d').in('edgeLabel1').values('property2').as('NAME1'),
    __.as('d').in('edgeLabel2').values('property3').as('NAME2'),
    __.as('d').in('edgeLabel1').out('edgeLabel3').values('property4').as('NAME3')
    ).select('NAME1', 'NAME2', 'NAME3')

This works just fine if all entities exists, but if one of them is not on the graph, no results are found, even though I know there are. How can I make an .or query that will find the values if they exist. Say, if property4 was not found at the end of edgeLabel3, how can my query still give me the other two results (property2 and property3)? I've tried doing .or queries, but I haven't had any luck.

1 Answers
Related