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

Marko A. Rodriguez closed TINKERPOP3-715.
-----------------------------------------
       Resolution: Won't Fix
         Assignee: Marko A. Rodriguez
    Fix Version/s: 3.0.0-incubating

As [~dkuppitz] noted. We have {{coalesce(...)}} and we have 
{{sideEffect(traversal)}}. That is sufficient for what I think {{optional()}} 
should be used for. In fact:

{code}
optional(traversal) <=> sideEffect(traversal)
{code}



> [Proposal] Do we need a optional(traversal) like in TinkerPop2?
> ---------------------------------------------------------------
>
>                 Key: TINKERPOP3-715
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-715
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.0-incubating
>            Reporter: Marko A. Rodriguez
>            Assignee: Marko A. Rodriguez
>             Fix For: 3.0.0-incubating
>
>
> In TinkerPop2 we had {{optional()}}. It allowed the traverser to go down the 
> {{optional}}-branch and its results were only used for their sideEffects. For 
> instance:
> {code}
> g.V(x).optional(out('rated').aggregate('userLibrary'))
>   .outE('rated').has('stars',gte(4)).inV()
>   .inE('rated').has('stars',gte(4)).inV()
>   .outE('rated').has('stars',gte(4)).inV().where(not(within('userLibrary')))
>     .groupCount()
> {code}
> To do this in TinkerPop3, we would do:
> {code}
> g.V(x).sideEffect(v -> 
> g.V(v.get()).out('rated').aggregate('userLibrary').iterate())
>   .outE('rated').has('stars',gte(4)).inV()
>   .inE('rated').has('stars',gte(4)).inV()
>   .outE('rated').has('stars',gte(4)).inV().where(not(within('userLibrary')))
>     .groupCount()
> {code}
> ... :/ ... should we add {{optional}} back in the mix? It would be like 
> {{.as('a').local(...).select('a')}} but it would not care if the nested 
> traversal returned a result or not.



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

Reply via email to