thinkaurelius / neo4j-gremlin-plugin

Gremlin for Neo4jServer 2.x
http://thinkaurelius.com
Apache License 2.0
30 stars 14 forks source link

Cannot make any examples ran #18

Open dmikov opened 8 years ago

dmikov commented 8 years ago

Maybe I am doing something wrong or the versions are out of synch. I am using the latest binaries you have with Neo4j 2.3.3

The first graph traversal example is failing load with following error:

{
"errormessage": "javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource.loadGraphML() is applicable for argument types: (java.lang.String) values: [https://raw.githubusercontent.com/tinkerpop/gremlin/2.5.0/data/graph-example-2.xml]"
"success": false
}

And consumption of existing data return some results, but trying to return a property gives following error.

{
"errormessage": "javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: F01 for class: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal"
"success": false
}

The script used is g.V().hasLabel('RecordEmployee').has('F01','Philip').F01

dkuppitz commented 8 years ago

Try:

g.V().hasLabel('RecordEmployee').has('F01','Philip').values('F01')

Or simply:

g.V().has('RecordEmployee','F01','Philip').values('F01')
dmikov commented 8 years ago

Thank you very much. That made it kinda work. But where can I find documentation on this? Both readme.md and gremlin site in the links shows dotted notation no values pipe also this one http://neo4j-contrib.github.io/gremlin-plugin/#rest-api-sort-a-result-using-raw-groovy-operations . I need to know the syntax to return map or something useful. Right now it is

{
"success": true
"results": [4]
0:  "Fry"
1:  "Philip"
2:  "Leela"
3:  "Turanga"
}

For two fields from two nodes. g.V().hasLabel('RecordEmployee').values('F01','F02')

dmikov commented 8 years ago

I am reading on Tinkerpop 3, it seems that is what this syntax is?

dkuppitz commented 8 years ago

Yes, the latest docs can always be found under http://www.tinkerpop.com.