[
https://issues.apache.org/jira/browse/TINKERPOP-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15216612#comment-15216612
]
ASF GitHub Bot commented on TINKERPOP-1237:
-------------------------------------------
Github user okram commented on a diff in the pull request:
https://github.com/apache/incubator-tinkerpop/pull/284#discussion_r57778538
--- Diff: docs/src/reference/the-traversal.asciidoc ---
@@ -1376,6 +1376,24 @@ metrics = t.getSideEffects().get('metrics')
For traversal compilation information, please see
<<explain-step,`explain()`>>-step.
+[[project-step]]
+Project Step
+~~~~~~~~~~~~
+
+The `project()`-step (*map*) projects labeled attributes of the current
object into a `Map<String,Object>`. It is similar
+to <<select-step,`select()`>>-step, save that instead of retrieving and
modulating historic traverser state, it modulates
+the current state of the traverser.
+
+[gremlin-groovy,modern]
+----
+g.V().out('created').
+ project('a",'b').
--- End diff --
I just fixed. I built the docs, then reformatted the text and I caused
that. The docs are rebuilding right now... then I will push the typo fix.
> 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)