You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Marko A. Rodriguez (JIRA)" <ji...@apache.org> on 2015/08/27 22:04:47 UTC

[jira] [Closed] (TINKERPOP3-780) Use of fold() in repeat()

     [ https://issues.apache.org/jira/browse/TINKERPOP3-780?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marko A. Rodriguez closed TINKERPOP3-780.
-----------------------------------------
    Resolution: Fixed

This has been fixed by saying, you can't have a reducing barrier step be in a traversal whose parent is repeat. Hence, [~dkuppitz] solution is legal, but not [~spmallette].

{code}
gremlin> g.V().repeat(out().fold().unfold()).times(2)
The direct parent of a ReducingBarrierStep can not be a RepeatStep: FoldStep
Display stack trace? [yN]
{code}

{code}
gremlin> g.V().repeat(map(out().fold()).unfold()).times(2)
==>v[5]
==>v[3]
{code}

> Use of fold() in repeat()
> -------------------------
>
>                 Key: TINKERPOP3-780
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-780
>             Project: TinkerPop 3
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.0.0-incubating
>            Reporter: stephen mallette
>            Assignee: Marko A. Rodriguez
>             Fix For: 3.0.1-incubating, 3.1.0-incubating
>
>
> I would expect these two traversals to be equivalent:
> {code}
> gremlin> g = TinkerFactory.createModern().traversal()
> ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
> gremlin> g.V(1).repeat(out().fold().unfold()).times(2)
> gremlin> g.V(1).repeat(out()).times(2)
> ==>v[5]
> ==>v[3]
> {code}
> Also note something [~dkuppitz] pointed out:
> {code}
> gremlin> g.V(1).repeat(out().fold()).times(1)
> ==>[]
> gremlin> g.V(1).out().fold()
> ==>[v[3], v[2], v[4]]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)