getIt = { id ->
def p = g.V(id);
p.next();
}
new File('/path/to/file').eachLine {
(fromVertex, toVertex) = it.split(',').collect(getIt);
fromVertex.addEdge('DEFINITION', toVertex);
}
g.addE('DEFINITION34').from(fromVertex).to(toVertex)--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/45be4418-2880-4491-817d-281387c5370a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
That error message occurs when you try to call addEdge() on a "detached" vertex, so I assume that your fromVertex and toVertex are both of the DetachedVertex or ReferenceVertex classes. This approach should have failed in 3.3.x as well, so I'm not sure what else changed. Ultimately you should be making the change (on 3.3.7 or otherwise) to the g.addE() syntax. I would simply prefer (untested, but i think i got it right):new File('/path/to/file').eachLine {
(fromVertex, toVertex) = it.split(',')
g.V(fromVertex).addE('DEFINITION34').to(V(toVertex)).iterate()
}
And, of course note, that it doesn't matter what version of TinkerPop you're using from 0.x to 3.x, you need to iterate() your traversal:
it's curious that you mention neo4j...are you using that as your database? it doesn't allow id assignment, so that may be a problem for you as well.
On Tue, Jun 25, 2019 at 12:08 PM Damien Seguy <damie...@gmail.com> wrote:
I'm moving from Gremlin 3.3.7 to 3.4.2, and I'm running into this weird error message : "Edge additions not supported"--The origin is this script : The problem arise by using addEdge().toVertex and fromVertex are both vertices.getIt = { id ->
def p = g.V(id);
p.next();
}
new File('/path/to/file').eachLine {
(fromVertex, toVertex) = it.split(',').collect(getIt);
fromVertex.addEdge('DEFINITION', toVertex);
}I tried to move to the addE syntax with this :g.addE('DEFINITION34').from(fromVertex).to(toVertex)This has the weirder effect to load only the LAST element from the file. All others are omitted.the file only contains IDs, and are valid with Gremlin 3.3.7.I also use the neo4j plugin, and I'm running on OSX.What am I doing wrong ?Damien Seguy.
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremli...@googlegroups.com.