Closed NitinJamadagni closed 9 years ago
Why do you think that this problem is related to the plugin?
Hey, I think the issue it's with the plugin because on a gremlin repl shell using the TinkerGraph() it works just fine.But when run by making a curl request to the neo4j server with the plugin the results don't get logged(I checked the neo4j console logs as well)
Thanks Nitin On Apr 6, 2015 10:14 PM, "Daniel Kuppitz" notifications@github.com wrote:
Why do you think that this problem is related to the plugin?
— Reply to this email directly or view it on GitHub https://github.com/thinkaurelius/neo4j-gremlin-plugin/issues/7#issuecomment-90144612 .
I don't think that this problem is caused by the plugin. Note that the REPL iterates your Gremlin pipeline automatically - in any other scenario you'll need to take care of it. Your pipeline is simply not iterated. Add .iterate()
to your last statement or simply use this:
new File("apps.txt").eachLine { def line ->
g.V().has("appname", line).sideEffect { def app ->
def pipe = app.in("uses").has("identity", identity)
if (pipe.hasNext()) {
app.setProperty("weight", app.getProperty("weight") + 1)
} else {
g.v(userno).addEdge("uses", app, ["weight": 1])
}
}.iterate()
}
Thanks Daniel, It worked after a .iterate() at the end. Should have read clearly about ->* REPL iterating the pipeline automatically and we having to take care of it in any other case*.
Thanks Nitin Jamadagni
On Tue, Apr 7, 2015 at 4:24 PM, Daniel Kuppitz notifications@github.com wrote:
Closed #7 https://github.com/thinkaurelius/neo4j-gremlin-plugin/issues/7 .
— Reply to this email directly or view it on GitHub https://github.com/thinkaurelius/neo4j-gremlin-plugin/issues/7#event-275107213 .
I am trying to add an edge if it does not exist , else update it's weight
Apparently only the last app read by line closure,it's edge is getting updated