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 2018/06/11 09:30:00 UTC

[jira] [Commented] (TINKERPOP-967) Support nested-repeat() structures

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

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

GitHub user GCHQResearcher1337 opened a pull request:

    https://github.com/apache/tinkerpop/pull/876

    TINKERPOP-967 Support nested-repeat() structures

    https://issues.apache.org/jira/browse/TINKERPOP-967
    
    This allows nested loops to be used in traversals e.g.
    ```gremlin
    g.V().repeat(out("knows")).until(repeat(out("created")).emit(hasId(3)))
    ```
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/GCHQResearcher1337/tinkerpop TINKERPOP-967

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/876.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #876
    
----
commit 320c14365f9a77a6942d8c5a6e997560634cf855
Author: GCHQResearcher1337 <39...@...>
Date:   2018-06-04T09:35:29Z

    TINKERPOP-967 Support nested-repeat() structures
    
    Implementation of a loop counter stack and set of nested loop traversers as described in TINKERPOP-967.
    
    Added NESTED_LOOP (NL) supporting traversers alongside each SINGLE_LOOP supporting traverser and
    included these in the DefaultTraverserGeneratorFactory.
    
    Added new Traversers and dependencies into GryoVersion.
    
    Added extra functionality tests into RepeatTest and DefaultTraverserGeneratorFactoryTest to check that
    the nested loops work as exected and that the Traversers are correctly selected respectively.

----


> Support nested-repeat() structures
> ----------------------------------
>
>                 Key: TINKERPOP-967
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-967
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.1.0-incubating
>            Reporter: Marko A. Rodriguez
>            Assignee: Marko A. Rodriguez
>            Priority: Major
>
> All the internal plumbing is staged for this to happen, we just haven't gone all the way. In short, a {{NESTED_LOOP}} traverser has an internal {{loopStack}} where {{repeat(repeat())}} will have a {{loopStack}} of two. The {{it.loops()}} checks of the internal repeat will always check the top of the stack and when its done repeating will delete its counter off the top of the stack.
> [~dkuppitz]'s work on {{LoopStep}} will be backwards compatible. In {{RepeatStep}} we will support:
> {code}
> repeat('a',out('knows').repeat('b',out('parent')))
> {code}
> and thus, things like {{loops('a')}} as well as {{times('a',2)}}. Note that naming the loop stack will be a super rare case as most people will just assume standard nested looping semantics with a push/pop stack.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)