Out-dated bytecode example in GLV tutorial?

34 views
Skip to first unread message

Ray Scott

unread,
Sep 20, 2017, 8:10:52 AM9/20/17
to Gremlin-users
Hi, 

The Gremlin Language Variant tutorial shows the follow bytecode exmple:

[ ["V", [1]], ["repeat", [[ ["out", ["knows"]] ["hasLabel", ["person"]]]]] ["times", [2]] ["values", ["name"]] ]

yet, when I getBytecode() on a traversal I see parentheses and not brackets around step parameters. For EG:

[[], [V(), as(person), out(knows), as(friend), select(person, friend)]]


Which is correct? 

Thanks.

Kevin Gallardo

unread,
Sep 20, 2017, 12:49:43 PM9/20/17
to Gremlin-users
Hi, 

The output shown in the docs is output from the gremlinpython GLV. So it is the output when printing a GraphTraversal from a python script:

>>> print(g.V().repeat(out()).has("name", "marko"))
[['V'], ['repeat', [['out']]], ['has', 'name', 'marko']]

I assume the output you showed was the output from a .toString() on a traversal from the Java GLV? It makes sense that those 2 differ.

However maybe the tinkerpop doc could just mention where that output comes from.

Ray Scott

unread,
Sep 21, 2017, 8:57:29 AM9/21/17
to Gremlin-users
OK great, thanks for clearing that up. I'm not a Python person, and didn't want to code a GLV to the wrong spec. 
Reply all
Reply to author
Forward
0 new messages