"com.michaelpollmeier" %% "gremlin-scala" % "3.2.5.0",
"org.janusgraph" % "janusgraph-core" % "0.1.1",
"org.janusgraph" % "janusgraph-cassandra" % "0.1.1",
"org.apache.tinkerpop" % "gremlin-driver" % "3.2.5",
val scalaGraph: ScalaGraph = EmptyGraph.instance().asScala().configure(_.withRemote(DriverRemoteConnection.using(cluster, "g"))
val g: GraphTraversalSource = EmptyGraph.instance().traversal().withRemote(DriverRemoteConnection.using(cluster, "g"))
val janusGraphMapper = GryoMapper.build.addRegistry(JanusGraphIoRegistry.getInstance())
val cluster: Cluster = Cluster.build
.addContactPoint("[MyRemoteGraph Host]")
.port(80)
.serializer(new GryoMessageSerializerV1d0(janusGraphMapper))
.create
--
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-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/10ae6064-ee5c-4d61-993a-6e8c6019543c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
val t = g.V(v1).outE().valueMap(ture, "LastModified").toList()
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/031a8f19-a19e-4496-89b9-70048a2cb15b%40googlegroups.com.
Thanks Stephen,Sorry, that was a typo. I guess there is a bit of tuning when writing code between Gremlin Console and Application (Java/Scala) so I was not able to get the value from the valueMap() in Application, and select() works perfectly fine here, thanks for the trick.Also, I am struggling to write a query to have a conditional traversal in Gremlin, say I need to return the path of "vertexA" only when outgoing Edge property "prop" matches same property value of its outgoing vertex.For example, Graph:
gremlin> graph = TinkerGraph.open()gremlin> g = graph.traversal(standard())==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]gremlin> g
.addV("person").property("prop", 500).property("uuid", "aaa").as("A")
.addV("person").property("prop", 300).property("uuid", "bbb").as("B")
.addV("person").property("prop", 450).property("uuid", "ccc").as("C")
.addV("person").property("prop", 0).property("uuid", "ddd").as("D")
.addV("person").property("prop", 0).property("uuid", "eee").as("E")
.addV("person").property("prop", 0).property("uuid", "fff").as("F")
.addV("person").property("prop", 400).property("uuid", "ggg").as("G")
.addE("ref").from("A").to("B").property("prop", 500)
.addE("ref").from("B").to("D").property("prop", 200)
.addE("ref").from("A").to("C").property("prop", 500)
.addE("ref").from("C").to("E").property("prop", 400)
.addE("ref").from("C").to("F").property("prop", 450)
.addE("ref").from("G").to("E").property("prop", 400)
.addE("ref").from("G").to("F").property("prop", 400)
.iterate()gremlin> va = g.V().has("uuid", "aaa").next()for query on va, I want to have path [A, B], [A, C], [A, C, F], while [A, C, E] is not returned as "prop" of edge between C and E is 450, which doesn't mach the value of its outV C's "prop" (450).I came up with match() and repeat(), but cannot make it work:
val t = g.V(vA).`match`(
__.as("v1").values("prop").as("vertexValue"),
__.as("v1").outE().as("e1").values("prop").as("edgeValue"),
__.as("e1").inV().as("v2"),
__.as("v1").repeat(__.out()).until(_.outE.count.is(JLong.valueOf(0))))
.select("v1", "v2").toListand also tried:Having this code in scala so a bit different syntax from Gremlin Console, wondering am I in the wrong direction as not very familiar with all other gremlin steps I can use to fit in this scenario.but it has error as well: java.lang.Integer incompatible with org.apache.tinkerpop.gremlin.structure.Element
g.V(vA)
.repeat(__.out())
.until(__.values("prop").as("p1").outE().values("prop").as("p2")
.where("p1", P.neq("p2")).count().is(0))
.path()
.toListThanks for your help in advance again.Cheers,Alex
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/031a8f19-a19e-4496-89b9-70048a2cb15b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/2e03a02f-b349-4e03-b5b7-a5c069d9652e%40googlegroups.com.
val others = g.V().has("uuid", "aaa").outE().inV()
.repeat(__.as("person")
.flatMap(__.outE().as("ref")
.where("ref", P.eq("person"))
.by("LastReferenceUpdate")
.inV()))
.emit()
.path()
.toList()
Robert Dale
Wow, thanks a lot Robert. that works like a charm :DSo a few questions to help me better understand this:1. how does the terminate condition inject into the flatMap step? I was using until but couldn't get it right.
2. Is the inV() at the end of the flatMap pass back to the repeat step every time it repeats? or the emit() is the value that pass back to the repeat step?
3. if I want to keep track of the edges in the path as well, is that just:
gremlin> g.V().hasLabel("software").valueMap(true)==>[label:software,name:[lop],lang:[java],id:3]==>[label:software,name:[ripple],lang:[java],id:5]gremlin> g.V().hasLabel("software").valueMap(true).map(unfold().group().by(keys).by(select(values).unfold()))==>[label:software,name:lop,lang:java,id:3]==>[label:software,name:ripple,lang:java,id:5]
gremlin> g.V().hasLabel("software").valueMap(true).by(unfold())==>[label:software,name:lop,lang:java,id:3]==>[label:software,name:ripple,lang:java,id:5]
// or:
gremlin> g.V().hasLabel("software").valueMap(true).by(limit(local, 1))==>[label:software,name:lop,lang:java,id:3]==>[label:software,name:ripple,lang:java,id:5]
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/9932b7de-797a-48af-9ab2-90eec3aaba23%40googlegroups.com.
The information contained in this e-mail may be confidential. It has been sent for the sole use of the intended recipient(s). If the reader of this message is not an intended recipient, you are hereby notified that any unauthorized review, use, disclosure, dissemination, distribution or copying of this communication, or any of its contents, is strictly prohibited. If you have received it by mistake please let us know by e-mail immediately and delete it from your system. Many thanks.
La información contenida en este mensaje puede ser confidencial. Ha sido enviada para el uso exclusivo del destinatario(s) previsto. Si el lector de este mensaje no fuera el destinatario previsto, por el presente queda Ud. notificado que cualquier lectura, uso, publicación, diseminación, distribución o copiado de esta comunicación o su contenido está estrictamente prohibido. En caso de que Ud. hubiera recibido este mensaje por error le agradeceremos notificarnos por e-mail inmediatamente y eliminarlo de su sistema. Muchas gracias.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/130f4753-e308-4b8b-9327-2f5657b7eba6n%40googlegroups.com.