tinkerpop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Frantz (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TINKERPOP3-799) [Proposal] with()-modulator for stream level variable binding.
Date Wed, 05 Aug 2015 03:30:04 GMT

    [ https://issues.apache.org/jira/browse/TINKERPOP3-799?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14654750#comment-14654750

Matt Frantz commented on TINKERPOP3-799:

What is the default interpretation of a "with-able" string parameter?  The {{addE}} steps
are currently defined so that strings mean step labels.  We can decide to break that by making
the default interpretation be "string literal", which means there will always need to be at
least one {{with}} clause per {{addE}} step.  Or we can make the default more complex by making
it context sensitive, i.e. the default for the second vertex parameter is {{select\(x)}},
while the default for a property value is string literal.

> [Proposal] with()-modulator for stream level variable binding.
> --------------------------------------------------------------
>                 Key: TINKERPOP3-799
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-799
>             Project: TinkerPop 3
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.0.0-incubating
>            Reporter: Marko A. Rodriguez
> Arguments for steps are defined by the user and are not changeable for the life of the
traversal. In most situations, this is fine. However, for the graph mutation steps (e.g. {{addV}},
{{addOutE}}, {{property}}), this can be limiting. Many times you want to change an argument
based upon information within the traversal. To do this, I propose the following new modulator
> 1. {{with(string,traversal)}}
> 2. {{with(string,object)}}
> 3. {{with(string,function)}} 
> How does it work?
> {code}
> // create a bi-directional graph
> g.V().as('a').outE().as('b').inV().
>   addOutE('label','a','weight','w').
>     with('label',select('b').label()).
>     with('a',select('a')).
>     with('w',select('b').values('weight'))
> {code}
> In this way, the edge label and properties are dynamically determined by the respective
{{with()}} variable.
> {code}
> // create a bi-directional graph
> g.V().as('a').outE().as('b').inV().
>   addOutE('label','a','properties').
>     with('label',select('b').label()).
>     with('a',select('a')).
>     with('properties',select('b').valueMap())
> {code}
> I think this will also come into play with the math operators of TINKERPOP3-761. For
> {code}
> g.V().outE().as('b').inV().values('energy').
>   mult('x').with('x',select('b').values('weight'))
> {code}
> Are there other steps that would (reasonably) benefit from {{with()}}-modulation? Is
{{with()}} a good word or is it a reserved word in other programming languages?

This message was sent by Atlassian JIRA

View raw message