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/05 13:16:00 UTC
[jira] [Created] (TINKERPOP-2466) Improve syntax for Groovy scripts
that use withStrategies()
Stephen Mallette created TINKERPOP-2466:
-------------------------------------------
Summary: 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
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)