如何在 gremlin python 中使用 'as' 关键字?

How can one use the 'as' keyword in gremlin python?

尝试将我在 Gremlin CLI 中编写和测试的查询转换为 gremlin-python 时,我在 .as('foo') 表达式中遇到 unexpected token 'as' 错误。如何在使用 gremlin-python 时使用 Gremlin as 关键字?

当 Gremlin 步骤与 Python 保留字冲突时,步骤会带有下划线后缀,因此对于 as(),您应该改为 as_()。可以找到所有步骤的完整列表 here,但目前它们是:

步骤 - and_(), as_(), from_(), is_(), in_(), not_()or_()with_()

代币 - Scope.global_