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/05/05 19:17:59 UTC
[jira] [Closed] (TINKERPOP3-463) Now we can do as('a').out.as('b')
in Gremlin-Groovy with SugarPlugin.
[ https://issues.apache.org/jira/browse/TINKERPOP3-463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marko A. Rodriguez closed TINKERPOP3-463.
-----------------------------------------
Resolution: Won't Fix
We now support {{as('a').out().as('b')}}. This is sufficient and any Groovy magic starts to muddy the situation (especially now that steps can be multi-labeled). I'm adverse to using Groovy {{propertyMissing}} and {{methodMissing}} meta-programming as it interferes with user Groovy meta-work as well as other meta-programming work within Gremlin-Groovy. The less tickery, the better.
> Now we can do as('a').out.as('b') in Gremlin-Groovy with SugarPlugin.
> ---------------------------------------------------------------------
>
> Key: TINKERPOP3-463
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-463
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: process
> Reporter: Marko A. Rodriguez
> Assignee: Marko A. Rodriguez
>
> [~mbroecheler] @joshsh [~dkuppitz]
> Now that we have {{AnonymousGraphTraversal.Tokens.__}}, {{match()}} looks like this in Gremlin-Groovy (with Sugar).
> {code:groovy}
> g.V.match('a',
> __.as('a').out('created').as('b'),
> __.as('b').has('name', 'lop'),
> __.as('b').in('created').as('c'),
> __.as('c').has('age', 29)).
> select('a', 'c').by('name')
> {code}
> The only difference between this and non-sugar is {{g.V}} vs. {{g.V()}}. However, if we add to SugarPlugin that a missing method named {{as()}} is actually a call to {{AnonymousGraphTraversal.Tokens.__}} (which is 3 lines of code :)), then it will look like this:
> {code:groovy}
> g.V.match('a',
> as('a').out('created').as('b'),
> as('b').has('name', 'lop'),
> as('b').in('created').as('c'),
> as('c').has('age', 29)).
> select('a', 'c').by('name')
> {code}
> This is cool, but realize it only works for Gremlin-Groovy (with Sugar). Be nice to come up with a simplification that would also work for non-sugar and Gremlin-Java.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)