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

ASF GitHub Bot commented on TINKERPOP-1237:
-------------------------------------------

Github user twilmes commented on the pull request:

    
https://github.com/apache/incubator-tinkerpop/pull/284#issuecomment-203045239
  
    VOTE: +1


> ProjectMap: For the Love of Die Faterland
> -----------------------------------------
>
>                 Key: TINKERPOP-1237
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1237
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.1.1-incubating
>            Reporter: Marko A. Rodriguez
>            Assignee: Daniel Kuppitz
>
> {code}
> gremlin> g.V(1).out("knows").
>            project("a","b").by("name").by(outE().count())
> ==>{a:josh, b:2}
> ==>{a:vadas, b:0}
> {code}
> Its like {{select()}} by inverted -- thus, {{project()}}! Moreover, its a 
> generalization of {{valueMap()}} and {{propertyMap}}.
> {code}
> public class ProjectStep<S,E> extends MapStep<S,Map<String,E>> {
>   TraversalRing<S,E> ...
>   String... keys;  
>    public Map<String,E> map(final Traverser.Admin<S> traverser) {
>       final Map<String,E> result = new HashMap<>(keys.length);
>       for(final String key : keys) {
>         result.put(key, TraversalUtil.apply(traverser, traversalRing.next());
>       }
>       traversalRing.reset();
>       return result;
>     }
> }
> {code}
> cc/ Mein Obergruppenführer [~mbroecheler].



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

Reply via email to