You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Daniel Kuppitz (JIRA)" <ji...@apache.org> on 2015/06/29 17:24:04 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=14605751#comment-14605751 ] 

Daniel Kuppitz commented on TINKERPOP3-753:
-------------------------------------------

My first thought was: nah, too much unnecessary overhead, it's easy enough to manually deal with scopes. But after thinking about it a bit longer, I think it wouldn't be too much overhead - it's actually just one additional check. Hence, yea, that might be a good user friendly feature.

> 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
>
> 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)