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

Daniel Kuppitz commented on TINKERPOP-968:
------------------------------------------

{code}
gremlin> g = TinkerFactory.createModern().traversal()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard]
gremlin> g.V().coalesce(out("knows"), identity()).coalesce(out("created"), 
identity()).path()
==>[v[1], v[2], v[2]]
==>[v[1], v[4], v[5]]
==>[v[1], v[4], v[3]]
==>[v[2], v[2], v[2]]
==>[v[3], v[3], v[3]]
==>[v[4], v[4], v[5]]
==>[v[4], v[4], v[3]]
==>[v[5], v[5], v[5]]
==>[v[6], v[6], v[3]]
gremlin> g.V().choose(out("knows"), out("knows"), 
identity()).choose(out("created"), out("created"), identity()).path()
==>[v[1], v[2]]
==>[v[1], v[4], v[5]]
==>[v[1], v[4], v[3]]
==>[v[2]]
==>[v[3]]
==>[v[4], v[5]]
==>[v[4], v[3]]
==>[v[5]]
==>[v[6], v[3]]
{code}

> Add first class support for an optional traversal
> -------------------------------------------------
>
>                 Key: TINKERPOP-968
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-968
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.1.0-incubating
>            Reporter: pieter martin
>
> Both SparQL and Cypher use the "Optional" keyword to indicate an optional 
> traversal. SQL uses the "left join".
> Gremlin has no first class support for an optional traversal. It can be 
> achieved with the choose step but it is verbose, unintuitive and not what the 
> choose step is intended for.
> The benefits of optional traversals are many. In particular it makes it 
> trivial to load complete subgraphs/trees with one easy to read intuitive 
> gremlin statement.



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

Reply via email to