You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Matt Frantz (JIRA)" <ji...@apache.org> on 2015/07/21 19:53:04 UTC

[jira] [Closed] (TINKERPOP3-675) select(local) applied to Element

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

Matt Frantz closed TINKERPOP3-675.
----------------------------------
    Resolution: Won't Fix

With the {{Scope}} inference logic, it no longer makes sense to apply {{select}} to the properties of an {{Element}}.

> select(local) applied to Element
> --------------------------------
>
>                 Key: TINKERPOP3-675
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-675
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.0-incubating
>            Reporter: Matt Frantz
>
> {{select(local)}} currently works on {{Map}}, but it could be interpreted as a property value selector on {{Element}}.  Sounds like [~okram] considered making {{Element}} a {{Map}} implementation at one point, so it must not be a terrible idea.  This would give it approximately the semantics of {{valueMap}} with a few exceptions because of {{select}}'s "collections only when necessary" philosophy.
> Scenario: Single property name with single cardinality emits single value.
> {noformat}
> gremlin> g = TinkerFactory.createModern().traversal()
> gremlin> g.V().has('name', 'josh').select(local, 'age')
> ==>32
> {noformat}
> Scenario: Single property name with multi cardinality emits value as collection.
> {noformat}
> gremlin> g = TinkerFactory.createTheCrew().traversal()
> gremlin> g.V().has('name', 'marko').select(local, 'location')
> ==>[san diego, santa cruz, brussels, santa fe]
> {noformat}
> Scenario: Multiple property names with single cardinality emits Map of single values.
> {noformat}
> gremlin> g = TinkerFactory.createModern().traversal()
> gremlin> g.V().has('age', gte(30)).select(local, 'name', 'age')
> ==>[name:josh, age:32]
> ==>[name:peter, age:35]
> {noformat}
> Scenario: Multiple property names with mixed cardinality emits Map of mixed single and collection values.
> {noformat}
> gremlin> g = TinkerFactory.createTheCrew().traversal()
> gremlin> g.V().has('location', gte('d')).select(local, 'name', 'location')
> ==>[name:marko, location:[san diego, santa cruz, brussels, santa fe]]
> ==>[name:stephen, location:[centreville, dulles, purcellville]]
> ==>[name:matthias, location:[bremen, baltimore, oakland, seattle]]
> ==>[name:daniel, location:[spremberg, kaiserslautern, aachen]]
> {noformat}
> Scenario: No property names emits a Map with all property values with mixed single and collection values.
> {noformat}
> gremlin> g = TinkerFactory.createTheCrew().traversal()
> gremlin> g.V().has('location', gte('d')).select(local)
> ==>[name:marko, location:[san diego, santa cruz, brussels, santa fe]]
> ==>[name:stephen, location:[centreville, dulles, purcellville]]
> ==>[name:matthias, location:[bremen, baltimore, oakland, seattle]]
> ==>[name:daniel, location:[spremberg, kaiserslautern, aachen]]
> {noformat}



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