G.V() Query syntax error

This query from the reference, fails in gdotv 1.28.62: V().has('name',not(within('josh','marko'))).elementMap() With : "Syntax Error (ln 1:21): Missing Gremlin Step Parameters or closing ')' symbol" This succeeds: V().has('name',without('josh','marko')).elementMap() Equally, g.V().has('name',neq('josh')).elementMap() succeeds, while g.V().has('name',not(eq('josh'))).elementMap() gives an error.
7 Replies
gdotv
gdotv13mo ago
Hey, that's odd, let me investigate, perhaps some kind of problem in the ANTLR grammar for Gremlin in gdotv Also thanks for reporting this
wiebe
wiebe13mo ago
g.V().has('name',is(eq('josh'))).elementMap() works, so it seems to be specific to not().
Jim Idle
Jim Idle13mo ago
I can help with ANTLR grammars
gdotv
gdotv13mo ago
Hey, much appreciated! Should be all good on this end, gdotv uses a slightly modified version of tinkerpop's which we maintain ourselves
spmallette
spmallette13mo ago
you often have to declare not() explicitly because it collides with the traversal form. to avoid it getting mixed up you either do P.not(...) or __.not(...). ANTLR might be able to be improved to make the right choice automatically. not sure we can do much with groovy. anyway, i assume being explicit would solve the problem. is that right?
wiebe
wiebe13mo ago
g.V().has('name',__.not(eq('josh'))).elementMap() doesn't help. g.V().has('name',P.not(eq('josh'))).elementMap() does. Guess that closes the issue...
spmallette
spmallette13mo ago
P and __ are two different things. the first produces a Predicate the second produces an anonymous Traversal. for your has() case you need the second. the __.not() step does not take a Predicate as an argument so ,__.not(eq('josh')) is invalid
Want results from more Discord servers?
Add your server
More Posts