Search code examples
gremlinamazon-neptune

getting match on multiple labels in Amazon Neptune with Gremlin


Amazon Neptune's implementation of Gremlin allows for multiple labels on vertices (see https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-differences.html)

But how to query for vertices by multiple labels?

g.V().hasLabel('label1').hasLabel('label2')

was what I expected, but does not seem to do the trick.


Solution

  • As an interim measure you could try doing hasLabel('label1').fold().unfold().hasLabel('label2')