[
https://issues.apache.org/jira/browse/TINKERPOP-3274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18154332#comment-18154332
]
ASF GitHub Bot commented on TINKERPOP-3274:
-------------------------------------------
Cole-Greer commented on code in PR #3762:
URL: https://github.com/apache/tinkerpop/pull/3762#discussion_r4759721321
##########
docs/src/reference/the-traversal.asciidoc:
##########
@@ -1206,8 +1206,9 @@
g.V().group().by(labels().fold()).by(values('name').fold()) <2>
<1> `atlas` carries the "animal", "reptile", "aquatic", and "endangered"
labels, but is grouped under only one of
them, chosen non-deterministically, so this grouping is not reliable for
multi-label vertices.
<2> Grouping by the full set of labels instead keeps each animal under its own
distinct combination of labels.
-Prefer this pattern with the <<labels-step,`labels()`>> step over `by(label)`
for graphs that support multiple
-labels per vertex.
+Prefer this pattern with the <<labels-step,`labels()`>> step, or
<<t-labels-token,`by(T.labels)`>>, over `by(label)`
+for graphs that support multiple labels per vertex. The two differ only in the
type of the group key: `labels().fold()`
+produces a `List` in label iteration order, while `T.labels` produces a `Set`.
Review Comment:
Nit: There should be a corresponding
`g.V().group().by(labels).by(values('name').fold())` traversal in the above
example.
> Add T.labels as an analogue for labels()
> ----------------------------------------
>
> Key: TINKERPOP-3274
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3274
> Project: TinkerPop
> Issue Type: Improvement
> Components: process
> Affects Versions: 4.0.0
> Reporter: Cole Greer
> Priority: Major
>
> Following the introduction of optional multilabel vertices to the TinkerPop
> data model, and the corresponding introduction of a `labels()` step to
> replace the old `label()` step, we should also introduce a new `T.labels`
> token for complete symmetry.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)