You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/12/02 23:41:11 UTC

[jira] [Commented] (TINKERPOP-1013) Traverser tags as a safer way of using path labels

    [ https://issues.apache.org/jira/browse/TINKERPOP-1013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15036800#comment-15036800 ] 

ASF GitHub Bot commented on TINKERPOP-1013:
-------------------------------------------

Github user twilmes commented on the pull request:

    https://github.com/apache/incubator-tinkerpop/pull/165#issuecomment-161456944
  
    Tests passed and code looks good.
    
    VOTE +1


> Traverser tags as a safer way of using path labels
> --------------------------------------------------
>
>                 Key: TINKERPOP-1013
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1013
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.1.0-incubating
>            Reporter: Marko A. Rodriguez
>            Assignee: 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)