davebshow / gremlinrestclient

http://gremlinrestclient.readthedocs.org/en/latest/
MIT License
18 stars 7 forks source link

gremlin script does not work unless graph is set to TinkerGraph, Titan.... #7

Closed smunx closed 8 years ago

smunx commented 8 years ago

Hi, I tried running the following snippet.

`>>> import gremlinrestclient

client = gremlinrestclient.GremlinRestClient() resp = client.execute( ... "graph.addVertex(label, p1, 'name', p2)", ... bindings={"p1": "person", "p2": "dave"}) resp Response(status_code=200, data=[{u'properties': {u'name': [{u'id': 226, u'value': u'dave'}]}, u'type': u'vertex', u'id': 225, u'label': u'person'}], message={}, metadata=u'')`

But this only works for me if I set graph variable to TinkerGraph.open()

>>> resp = client.execute( ... "graph = TinkerGraph.open(); graph.addVertex(label, p1, 'name', p2)", ... bindings={"p1": "person", "p2": "dave"})

And this is same for remaining functions.

davebshow commented 8 years ago

Well, I'm not really sure. I just tried this using using apache-gremlin-server-3.1.0-incubating with conf/gremlin-server-rest.yaml and it worked without any special configuration.

What version of the Gremlin Server are you using? What configuration?

smunx commented 8 years ago

I tired 3.0.0 and also 3.1.0. Yes I also used the same conf file. I just started working with graph databases and gremlin.

I used the following command to start the gremlin server

tinkerpop-3.1.0-incubating/gremlin-server/target/apache-gremlin-server-3.1.0-incubating-standalone/bin$ ./gremlin-server.sh ../conf/gremlin-server-rest-modern.yaml

smunx commented 8 years ago

I solved the problem. I was starting the gremlin server from the bin folder. Instead it should be started from the root $cd apache-gremlin-server-3.1.0-incubating-standalone

$bin/gremlin-server.sh conf/gremlin-server-rest-modern.yaml

davebshow commented 8 years ago

Great! I'll mark this as closed then.