Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2466

Improve syntax for Groovy scripts that use withStrategies()

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.4.8
    • Fix Version/s: 3.5.0, 3.4.9
    • Component/s: groovy
    • Labels:
      None

      Description

      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.

      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]
      

        Attachments

          Activity

            People

            • Assignee:
              spmallette Stephen Mallette
              Reporter:
              spmallette Stephen Mallette
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: