1

I'm able to find all of my tag vertex points which have an edge labeled tagged using:

gremlin> g.V().hasLabel('tag').inE().hasLabel('tagged')
==>e[eas0-109ds-e8l-y8oo][1691776-tagged->1597560]
==>e[ed5c-109ds-e8l-1181s][1691776-tagged->1736704]

Now, I would like to remove all of the tag vertices which do not have an edge labeled tagged. When I use this command to find these vertices:

gremlin> g.V().hasLabel('tag').inE().hasNot('label', 'tagged')

I get the error message No signature of method: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal.hasNot() is applicable for argument types: (java.lang.String, java.lang.String) values: [label, tagged]

How would I phrase this query?

1 Answers1

3

Use the not() filter step:

g.V().hasLabel('tag').not(inE('tagged')).drop()
stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • Excellent -- do you have any recommendations for guides / learning material? I often check the reference (http://tinkerpop.apache.org/docs/current/reference) before posting here, but it's not the clearest documentation. –  Oct 26 '18 at 00:17
  • 3
    the "Reference Documentation" is largely for that - reference. it's not a book style. if you'd like more of a paced reading experience then you need Practical Gremlin - http://kelvinlawrence.net/book/Gremlin-Graph-Guide.html – stephen mallette Oct 26 '18 at 00:19