--
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/aa2edec7-c746-4e37-964c-26648ffba7bcn%40googlegroups.com.
> It is expected behavior - you must specify a starting label to match(). You can start where() without a step label thoughThanks for clarification.> you simply treat the traverser as the Map produced by the match():Well, my question was about the where() patterns INSIDE match(), not AFTER match(). What kind of traverser goes into where() patterns INSIDE match()?
By the way, your examples terribly surprised me.> gremlin> g.V().match(__.as('a').out().as('b')).where(select('a').values('age').is(29))> ==>[a:v[1]]> ==>[a:v[1]]> ==>[a:v[1]]I have no idea about the reasoning behind this result. The result from match() step is a Map with two keys "a" and "b". However, the following where() step removes the key "b" from the input. Why? I have always thought that filtering steps don't transform the content of traversers. (maybe I should make another thread about it...)
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/557acd85-06f9-47df-a28f-bcc023d88ffcn%40googlegroups.com.
About my second question: Thanks a lot about PathRetractionStrategy and the related topic (https://groups.google.com/g/gremlin-users/c/CD0EQNm7U3c/m/R_y4A2qkAgAJ ). Having read the thread, now my conclusion is: we should NEVER use the value carried by a traverser emitted from match() step, because it's so unpredictable. Instead, we should always refer to the path history of the traverser emitted from match(), for example, using select(), where() and dedup().
Now back to my first question. That is, where() pattern inside match() without starting labels.I read the reference document ( https://tinkerpop.apache.org/docs/current/reference/#match-step ) again, and found out that there is no example that uses where() pattern inside match(). So, I suppose where() pattern inside match() is not officially supported, although the implementation doesn't complain about it.
That leaves the case in which where() step comes after match(). My conclusion above tells me to always use starting label in the where(). Without the starting label, the where() step might use the value of the traverser emitted from match(), which is unpredictable.
I ran the example you presented, but without profile().gremlin> g.V().match(__.as("a").out("knows").as("b")).where(eq("b"))==>[a:v[1],b:v[2]]==>[a:v[1],b:v[4]]Then, I just inserted identity() before where().gremlin> g.V().match(__.as("a").out("knows").as("b")).identity().where(eq("b"))(no result)This weirdness comes from the fact that where(eq("b")) tries to compare the value with label "b" in path history with the value of the current traverser, which is unpredictable due to match() step. So, basically, we should give starting label to where() in this case. That way, the comparison is solely based on path history.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/cdb17d4a-d590-43ce-8def-105bcd1a481bn%40googlegroups.com.