You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Stephen Mallette (Jira)" <ji...@apache.org> on 2020/11/13 19:59:00 UTC

[jira] [Closed] (TINKERPOP-2466) Improve syntax for Groovy scripts that use withStrategies()

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

Stephen Mallette closed TINKERPOP-2466.
---------------------------------------
    Fix Version/s: 3.4.9
                   3.5.0
       Resolution: Done

> Improve syntax for Groovy scripts that use withStrategies()
> -----------------------------------------------------------
>
>                 Key: TINKERPOP-2466
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2466
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: groovy
>    Affects Versions: 3.4.8
>            Reporter: Stephen Mallette
>            Assignee: Stephen Mallette
>            Priority: Major
>             Fix For: 3.5.0, 3.4.9
>
>
> This issue grew out of TINKERPOP-2461 which noted issues with aligning imports to the {{GroovyTranslator}}. A more Groovy syntax for {{withStrategies()}} will help make script submission have a more unified, compact and consistent feel while not affecting the Java syntax which relies more on the type safe and IDE friendly builder pattern. 
> {code}
> gremlin> g = TinkerFactory.createTheCrew().traversal()
> ==>graphtraversalsource[tinkergraph[vertices:6 edges:14], standard]
> gremlin> g = g.withStrategies(ReadOnlyStrategy, new
> SubgraphStrategy(vertexProperties: __.hasNot('endTime')))
> ==>graphtraversalsource[tinkergraph[vertices:6 edges:14], standard]
> gremlin> g.V().as('a').values('location').as('b').
> ......1>   select('a','b').by('name').by()
> ==>[a:marko,b:santa fe]
> ==>[a:stephen,b:purcellville]
> ==>[a:matthias,b:seattle]
> ==>[a:daniel,b:aachen]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)