Marko A. Rodriguez created TINKERPOP3-1013:
----------------------------------------------
Summary: Traverser tags as a safer way of using path labels
Key: TINKERPOP3-1013
URL: https://issues.apache.org/jira/browse/TINKERPOP3-1013
Project: TinkerPop 3
Issue Type: Improvement
Components: process
Affects Versions: 3.1.0-incubating
Reporter: Marko A. Rodriguez
Fix For: 3.1.1-incubating
We should add the following methods to {{Traverser}}.
{code}
void Traverser.addTag(final String tag)
boolean Traverser.hasTag(final String tag)
void Traverser.dropTag(final String tag)
void Traverser.dropTags()
{code}
What is the point of a "tag" ? There are two use cases:
1. Currently {{MatchStep}} "tags" a traverser with
{{traverser.getPath().addLabel(step.getId())}}. This means that the path data
of the traverser is used to store which branches of the {{match()}} the
traverser has already gone down. This is a hack as now the {{travesrer.path()}}
has a weird step ID label. Also, its inefficient as the path needs to be
searched for the respective "tag." A {{Set<String>}} is much more efficient.
2. Intersect/symmetric difference will require some sort of "tagging" as
explained in Section 4 of http://arxiv.org/abs/1511.06278. We could, of course,
use the {{MatchStep}} way of doing things, but again, thats a hack.
3. When we support TINKERPOP3-736, using the "{{path()}}-hack" will not work as
two branches will have different stepIds but the same tag.
In short, anytime we need to know if a particular branch of a traversal was
taken, {{Traverser.getTag()}} is our friend.
IMPORTANT: This will go into {{Traverser.Admin}} as no user should use these
tags. These are simply for internal markup of traverser.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)