When attempting to translate a query I wrote and tested in the Gremlin CLI to gremlin-python, I'm encountering unexpected token 'as'
errors on my .as('foo')
expressions. How can one use the Gremlin as
keyword when using gremlin-python?
Asked
Active
Viewed 1,277 times
2

JTW
- 3,546
- 8
- 35
- 49
1 Answers
5
When Gremlin steps conflict with Python reserved words the step gets suffixed with an underscore, so for as()
you would instead do as_()
. A full listing of all the steps can be found here, but currently they are:
Steps - and_()
, as_()
, from_()
, is_()
, in_()
, not_()
, or_()
, with_()
Tokens - Scope.global_

stephen mallette
- 45,298
- 5
- 67
- 135