2

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?

JTW
  • 3,546
  • 8
  • 35
  • 49

1 Answers1

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