tinkerpop/gremlin — Issue #255: Overload Methods to Accept JSON 
Author: espeed
Created: 2011-11-12 21:45:31+00:00
State: open

The friendlier Gremlin methods are great (https://groups.google.com/d/topic/gremlin-users/SIF4APwCvhg/discussion).

When constructing a Gremlin script in another programming language for submission over the wire via the Rexster Gremlin extension, there isn't a clean way to preserve types and convert the args into a native Groovy map format:

```groovy
Vertex v = graph.addVertex([name:'marko',age:31])
```

However, JSON is more universal so a clean way to do this would be to have the Python/Ruby/Whatever client convert the args to JSON and submit that:

```groovy
Vertex v = g.addVertex({"age": 34, "name": "james"})
```

This way types are preserved, and now that Rexster supports JSON types, it would keep things consistent.

Here is a Groovy JSON example: https://gist.github.com/1361147