How would write a traversal in use Gremlin TinkerPop 3 to find all vertices that have no incoming edges?
As a follow up I also need to find a vertices that have no outgoing edges as well.
This is simpler than the below version
g.V().not(inE())
g.V().not(outE())
Keeping my original answer for reference
g.V().where(inE().count().is(eq(0)))
For 0 outgoing edges
g.V().where(outE().count().is(eq(0)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With