[ https://issues.apache.org/jira/browse/TINKERPOP-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15125408#comment-15125408 ]
Marko A. Rodriguez commented on TINKERPOP-968: ---------------------------------------------- We had {{optional()}} in TinkerPop2. Its actually quite easy to implement. I'm wondering why we don't have it in TinkerPop3 and I believe .... ?? ... that [~dkuppitz] has an argument against it. ? Note that if we do implement it for TinkerPop3, we might want to compile it as: {code} g.V().hasLabel('a').optional(out('ab')) ==> g.V().hasLabel('a').union(identity(), out('ab')) {code} Is that the expected semantics -- sorta like {{emit().repeat()}}? The reason for this is because we would want it to use global traversal in OLAP and well, such {{branch/}} semantics are already implemented for us. Thoughts? > 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)