tinkerpop-dev mailing list archives

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

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

stephen mallette commented on TINKERPOP3-799:
---------------------------------------------

I like the idea of the "stream level variable binding" as it adds a different dimension to
setting properties and might trigger some other interesting stuff, but use of this feature
might not be so good for writing {{TraversalStrategy}} implementations which rely on static
analysis of the {{Traversal}}.  I'm not so sure that this is a blocker issue, but it seems
like as we think about this feature that we should consider how that aspect of the stack will
work with it.

> [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
methods:
> 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
instance:
> {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
(v6.3.4#6332)

Mime
View raw message