-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to specify config for gremlin-client? #59
Comments
There is an inconsistency in Titan v1.0.0 between the On the gremlin-javascript side, you only have to configure host and port to point to your Gremlin server instance (typically, |
Hi and thanks for the reply. After setting gremlin-server.yaml to reference conf/titan-cassandra-es-properties and cycling the server using titan.sh stop / start, gremlin console finds the previously loaded data and uses the geo index in queries. gremlin> g.V() For my mocha test of the same two queries gremlin-client returns the following error on the g.V() statement:
|
Is there a script defined in your |
Aside from changing the graphs section to point to conf/titan-cassandra-es.properties my gremlin-server.yaml is stock, and there is a scripts section pointing to scripts/empty-sample.groovy, which sets g. // conf/gremlin-server/gremlin-server.yaml
// scripts/empty-sample.groovy To rule out the possibility that my environment is not as I expect I downloaded the 1.0.0-hadoop1 release into a new folder, verified that there were no titan processes running, ran titan with the stock config using ./bin/titan.sh start and was able to run a simple query g.V().drop() via gremlin client. However if I change gremlin-server.yaml in that folder as described above and cycle the server I encounter the same error with gremlin client when running g.V().drop() - Error: No such property: g for class: Script2 (Error 597) I recall that when opening conf/titan-cassandra-es.properties in gremlin console it took quite awhile (like 20s); could there be some sort of race condition when gremlin-server is initializing from it? Grasping at straws. |
I don't have a stock titan here right now but can you post the content of |
Copied below. Also out of curiosity I tried the same test using a local build of titan with tinkerpop-3.2.0 incubating (thinkaurelius/titan#1312). This build has gremlin-server.yaml set to use cassandra-es.properties by default, and I am able to run queries against it using gremlin-client; unfortunately it doesn't appear to support list properties with gremlin-client so I can't proceed with it. // titan-1.0.0-hadoop1/conf/titan-cassandra-es.properties
|
Yeah try adding this at the top of the file :
For some reason it was missing from the 1.0.0 dist. |
Ah yes that's got it thanks Dylan; I see that at the top of the 3.2.0 build version of the same file as well. Out of curiosity do you see anything wrong with the gremlin below? For some reason I can't build my geo index with this config; starting from an empty db running ./bin/titan.sh start and then ./bin/gremlin.sh
|
Yes Glad you got things working :) |
Oh right of course. Thanks for all your help with this stuff. Unfortunately I'm still kinda stuck; I need gremlin 3.2 features and have been getting by with titan-1.0.0-hadoop1 and a standalone gremlin-server-3.2, but this combination appears to work only by accident. I'd like to use the titan-1.1.0-hadoop2 local build but it doesnt support list properties; Any chance you can also help get me past that issue? Thanks again From: Dylan Millikin notifications@github.com Yes addVertex() is a method of graph and not the traversal object g. So try graph.addVertex(...) instead. You are receiving this because you authored the thread. |
Another question rather than an issue; I'm not sure if it pertains to Gremlin in general or to gremlin-client so apologies if I'm posting in the wrong place.
I'd like to define a Geo index and use it from gremlin client; my setup is the stock 1.0.0-hadoop1 release. Starting the server with an empty db I execute the following in gremlin console:
// define a _geo property and index
graph = TitanFactory.open('conf/titan-cassandra-es.properties')
mgmt = graph.openManagement()
mgmt.makePropertyKey('_geo').dataType(Geoshape.class).cardinality(Cardinality.SINGLE).make()
l = mgmt.getPropertyKey('_geo')
mgmt.buildIndex('byGeo', Vertex.class).addKey(l).buildMixedIndex("search")
mgmt.commit()
// test
g = graph.traversal()
g.addVertex(label, 'AP', '_geo', Geoshape.point(45, 50))
g.addVertex(label, 'AP', '_geo', Geoshape.point(45, 55))
g.addVertex(label, 'AP', '_geo', Geoshape.point(45, 60))
g.V().has('_geo', geoWithin(Geoshape.circle(45, 50, 50)))
The geo query succeeds with no warnings so I assume the index was found.
With the server processes still running I wrap the test portion above into a mocha script and issue the same queries via gremlin-client, but I receive
Error: No signature of method: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource.addVertex() is applicable for argument types: (org.apache.tinkerpop.gremlin.structure.T$1, java.lang.String, java.lang.String, com.thinkaurelius.titan.core.attribute.Geoshape) values: [label, AP, _geo, point[45.0,50.0]](Error 597)
I assume the problem is that my gremlin-server is not using the same graph as the gremlin console, so I update my gremlin-server.yaml to open the graph described by conf/titan-cassandra-es.properties and restart, but after doing this much my test doesn't log anything and doesn't return.
I guess I'm still not clear about the relationship between the moving parts :)
Help appreciated.
The text was updated successfully, but these errors were encountered: