--
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.
For more options, visit https://groups.google.com/d/optout.
Nevermind, I just noticed that I actually reproduced the problem. See the difference in the last two lines:gremlin> g.v(1).as("startAt").outE("knows","created").filter({ w = it.getProperty("weight"); w < 0.5f || w > 0.5f }).inV().loop("startAt", {true}, {true}).path()
==>[v[1], e[8][1-knows->4], v[4]]
==>[v[1], e[9][1-created->3], v[3]]
==>[v[1], e[8][1-knows->4], v[4], e[11][4-created->3], v[3]]
==>[v[1], e[8][1-knows->4], v[4], e[10][4-created->5], v[5]]
The reason why it worked for me was because I didn't explicitly set the types for the loop step (like you did it in Java). So it seems that .loop() and .or() don't play well together. You can use .filter() as a workaround.
Cheers,
Daniel
.path(new PipeFunction<Element, String>() {@Overridepublic String compute(Element e) {String result = null;if (e.getProperty(ORG_NAME) != null) {result = e.getProperty(ORG_NAME).toString();} else if (e.getProperty(HPI_ID) != null) {result = e.getProperty(HPI_ID).toString();} else if (e.getProperty(MPI_ID) != null) {result = e.getProperty(MPI_ID).toString();}return result;}})
I loop after the pipe element inV()
gremlin> g.v(1).out().out().path()
==>[v[1], v[4], v[3]]
==>[v[1], v[4], v[5]]
Daniel,
that does not work. The exception is raised in the compute function of loop(), not path(). At the same time, because loop follows the call to inV(), I am forced by the compiler to parametrize the pipe function as <Vertex,Boolean>. But the pipe element receives an Edge nevertheless. This still looks like a bug in Pipes to me.
Ralf
On Saturday, July 5, 2014 12:23:03 AM UTC+2, Daniel Kuppitz wrote: