'Gremlin collect all first level Vertices if the second level vertex has a specific property

My graph looks something like

enter image description here

From A, I need to collect all the B i.e. B1, B2,..BN which are connected to C and C has a specific property value.



Solution 1:[1]

Without having actual data this may not be quite right but I think you are looking for something like this:

g.V().hasLabel('A').
  out().hasLabel('B').
  where(out().hasLabel('C').has('someprop','somevalue'))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kelvin Lawrence