g.V().choose(has('person','name','marco').hasNext(), has('person','name','marco'), addV(T.label, 'person', 'name', 'marco'))
No signature of method: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal.choose() is applicable for argument types: (java.lang.Boolean, org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal, org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal)
g.V().has('person','name','marco').tryNext().orElseGet {g.addV('person').property('name', 'marco').next()}
--
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/e98e3e44-ba49-4ae1-8401-ba4148c55354%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g.V().has('name','peter').tryNext().orElse(g.addV('name','peter'))
Why did you put ".next()" at the end?
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/0792f4a3-d987-45a0-a2a6-270340d30726%40googlegroups.com.
g.V().has('person','name','marco').tryNext().orElseGet {
g.addV(T.label,'person','name', 'marco').next()}
No signature of method: java.util.Optional.orElseGet() is applicable for argument types: (com.thinkaurelius.titan.graphdb.vertices.StandardVertex) values: [v[10035208240]]
Possible solutions: orElseGet(java.util.function.Supplier), orElse(java.lang.Object)
No signature of method: java.util.Optional.orElseGet() is applicable for argument types: (com.thinkaurelius.titan.graphdb.vertices.StandardVertex) values: [v[10035208240]]
g.V().has('person','name','marco').tryNext().orElseGet(g.addV(T.label,'person','name', 'marco').next())
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/07b2f736-4f46-4d68-b8b0-fd50c52f5fd2%40googlegroups.com.
Note that the argument should be a lambda.
g.V().has('person','name','marco').tryNext().orElseGet({g.addV(T.label,'person','name', 'marco').next()})
def t = g.V().has('person', 'name', 'marco')t.hasNext() ? t.next() : g.addV(T.label, 'person','name', 'marco').next()
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/147ec9d6-3fc0-4a66-b92e-ee3f681072d5%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/c5682c96-0e2b-4080-a04b-9d5780748034%40googlegroups.com.
Does using the tryNext().orElse() code still result in two roundtrip RPC calls to the server or does it get executed in one single request server side? I am interested in particular when using withRemote() in Java and connecting to a remote Gremlin server.
g.addV("mylabel").property("name", "me")
g.addV("mylabel", false).property("name", "me", false)
g.addV("mylabel", true).property("name", "me", true)
g.addV("mylabel", true).property("name", "me", true).property("surname", "Me", true)
g.addV("mylabel", true).property("name", "me", true).property("surname", "Me")
g.addV("mylabel", true).property("name", "me", true).property("surname", "Me").as("v1") // will always return a vertex, whether it's new or not
.addV("mylabel", true).property("name", "he", true).property("surname", "Me").as("v2") // will always return a vertex, whether it's new or not
.addE("knows", true).property("since", "born", true).from("v1").to("v2") // The Edge will only be added if there wasn't one with the property ("since", "born") already existing (would mean that the 2 vertices were already existing as well)
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/5e2ed63d-905a-44e4-87b3-39cb693687f2%40googlegroups.com.To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
Robert Dale