You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Marko A. Rodriguez (JIRA)" <ji...@apache.org> on 2015/06/29 20:14:05 UTC

[jira] [Closed] (TINKERPOP3-753) Should Scoping steps assume Map first and then Path?

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

Marko A. Rodriguez closed TINKERPOP3-753.
-----------------------------------------
       Resolution: Fixed
    Fix Version/s: 3.0.0.GA

This has ben implemented and it allowed us to remove lots of code that was very error prone. Moreover, the {{GraphTraversal}} API got simple, no more "scope" parameter methods required for {{where}},{{select}},{{addE}} (and their variations. Very very good stuff here.

> Should Scoping steps assume Map<String,Object> first and then Path?
> -------------------------------------------------------------------
>
>                 Key: TINKERPOP3-753
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-753
>             Project: TinkerPop 3
>          Issue Type: Bug
>          Components: process
>            Reporter: Marko A. Rodriguez
>            Assignee: Marko A. Rodriguez
>             Fix For: 3.0.0.GA
>
>
> Scoping is more complicated then lots of test cases make out. Here is a case in point:
> {code}
> g.V().out().as("v").
>    match(
>       __.as("v").outE().count().as("outDegree"),
>       __.as("v").inE().count().as("inDegree")).
>    select("v","outDegree","inDegree").by(valueMap()).by().by().
>    local(union(select(local,"v"), select("inDegree", "outDegree")).unfold().fold())
> {code}
> The {{select(local,"v")}} is required because {{union}} is a non-scoping step and thus, {{select()}} without local would compile to {{Scope.global}}, but what you really want is {{Scope.local}} (hence the hard coded {{local}}).
> Would it be best if Scoping worked like this?
>   . Get the Traverser and see if the bindings are in sideEffects.
>   . If not, see if its {{.get()}} is a {{Map}}.
>   . If it is a {{Map}}, assume the bindings are in the {{Map}} (fully).
>   . If it is not a {{Map}}, then get the {{Path}} a try and bind.
> This would allow us to remove the need for specifying {{Scope.local}} in the user API, however, we would still need, under the hood, {{Scoping}} to account for determining if Path calculations are needed at execution time.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)