I think you actually want to run a script which uses Gremlin API, afaik it's not possible with Studio.
The Studio does not work as (groovy) script interpreter, it only takes the input and tries to convert that input into a Pipe and than execute that Pipe on a graph.
However the pipes are very powerful - you can execute basically any kind of script logic in the pipe's side effect, so for example you can do this:
g.addVector("class:Test").sideEffect{g.addVector("class:Test")}
It will add two verticies of type Test, however it's not very readable.
You should do some reading about what Gremlin actually is and how it works. The important is a concept of Pipe.
The Gremlin query itself is just a representation of a Pipe written in sripting language (Groovy).
That representation might look totally alien to you, but it's because of some fancy features the Groovy languages offers, like optional parenthesis, closures, metaprogramming and so on.
Dne pondělí 14. září 2015 17:23:23 UTC+2 Valery T napsal(a):