--
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/a4e5631b-551b-470e-862d-343b567504a6%40googlegroups.com.
I'm not sure I understand why you would think it faster to gather vertices first and then edges. In your first traversal you end up traversing the same edges that you intend to collect in your second traversal. Why look to traverse those paths all over again?
On Sun, Aug 11, 2019 at 11:20 PM Stark Arya <sands...@gmail.com> wrote:
some times,we need get startId -> endId's certain hops one path, the path include both edge and vertex details which seems like :--g.V(startId).repeat(outE().inV()).times(4).hasId(endId).limit(1).path().by(__.valueMap(true))As we knows, the hop num is bigger, the cost may increasing Unacceptable,so,we could get vertexId list first, and then add edge between them.1. Get vertexId list first,like:gremlin> g.V("startId").repeat(out().simplePath()).times(4).hasId("endId").limit(1).path()==>[v[startId],v[secondId],v[thirdId],v[endId]]2. Query edge from the startId & endId.g.V("startId").outE().as("E").otherV().hasId("endId").select("E").by(valueMap(true))==>[id:5d3b354af8d6c90653a1c64d, label:drugs_disease_treat, confidence:0.6]So How to make 1 and 2 into one gremlin query ?
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.
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/13942f03-63a8-435b-93c5-15dc24104d58%40googlegroups.com.

> will go from a vertex to adjacent vertex directlyUnless that is a feature/optimization of the underlying graph database you are using, I don't think that's the case. The graph will still need to access/read those edges to determine the adjacent vertex. I don't think there is anything to gain by taking this approach. The only gain would be to ignore the return of edges in the path() which is why you might write the traversal that way. By avoiding the edge in your gremlin that's one less object to track in memory in the path. But, you want the edge in the result, so throwing it away to later traverse all those edges again doesn't really gain you anything.
On Tue, Aug 13, 2019 at 10:06 AM Stark Arya <sands...@gmail.com> wrote:
because one vertex store Adjacent edge and vertex,if use g.V("startId").repeat(out().simplePath()).times(4).hasId("endId").limit(1).path(), will go from a vertex to adjacent vertex directly;but if use g.V(startId).repeat(outE().inV()).times(4).hasId(endId).limit(1).path().by(__.valueMap(true))。 will go from a vertex to adjacent edge and then to the same vertex,make one more storage look up。--
在 2019年8月13日星期二 UTC+8下午8:39:16,Stephen Mallette写道:I'm not sure I understand why you would think it faster to gather vertices first and then edges. In your first traversal you end up traversing the same edges that you intend to collect in your second traversal. Why look to traverse those paths all over again?On Sun, Aug 11, 2019 at 11:20 PM Stark Arya <sands...@gmail.com> wrote:some times,we need get startId -> endId's certain hops one path, the path include both edge and vertex details which seems like :--g.V(startId).repeat(outE().inV()).times(4).hasId(endId).limit(1).path().by(__.valueMap(true))As we knows, the hop num is bigger, the cost may increasing Unacceptable,so,we could get vertexId list first, and then add edge between them.1. Get vertexId list first,like:gremlin> g.V("startId").repeat(out().simplePath()).times(4).hasId("endId").limit(1).path()==>[v[startId],v[secondId],v[thirdId],v[endId]]2. Query edge from the startId & endId.g.V("startId").outE().as("E").otherV().hasId("endId").select("E").by(valueMap(true))==>[id:5d3b354af8d6c90653a1c64d, label:drugs_disease_treat, confidence:0.6]So How to make 1 and 2 into one gremlin query ?
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/a4e5631b-551b-470e-862d-343b567504a6%40googlegroups.com.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/13942f03-63a8-435b-93c5-15dc24104d58%40googlegroups.com.
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/7f6b2010-4664-47ab-89e1-f9e804042587%40googlegroups.com.
interesting....could you show the profile() with the out() only instead of outE().inV()?
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/7f6b2010-4664-47ab-89e1-f9e804042587%40googlegroups.com.