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

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

xiazcy opened a new pull request, #3762:
URL: https://github.com/apache/tinkerpop/pull/3762

   https://issues.apache.org/jira/browse/TINKERPOP-3274
   
   Adds `T.labels`, the token-level counterpart of the `labels()` step and 
`Element.labels()`. It works with an element's full label set as a 
`Set<String>`.
     
   ### Changes
     
   - `T.labels` is accepted by `by()`, `has()`, the Gremlin grammar and all 
GLVs, and as a map key.
   - On creation, `addV()`, `mergeV()` and `graph.addVertex()` accept 
`T.labels` as a synonym for `T.label`.
   - `addE()` and `mergeE()` also accept `T.labels`, with at most one label, 
because an edge always has exactly one label. An empty set is treated as an 
omitted label, and a set with more than one label raises an error.
   - A label in `mergeE()` `option(onMatch)` now raises an error, because an 
existing edge's label cannot change.
   - Under `with("multilabel")`, `elementMap()` and `valueMap()` key the label 
set under `T.labels` instead of `T.label`.
   - `addV()` given an empty label set now creates a label-less vertex on a 
`ZERO_OR_MORE` graph, matching `graph.addVertex()`.
   - New `HasContainer.isLabelKey()` recognizes both `~label` and `~labels` 
filters. `InlineFilterStrategy` now uses it.
     
   ### Compatibility
     
   - `T.labels` is declared last in the `T` enum, so the Gryo ordinals of the 
existing tokens are unchanged.
   - Older servers and drivers can't deserialize `T.labels`, so traffic that 
uses it needs 4.x on both ends.
   - Gremlin Server now reserves `labels`, `~labels` and `~LABELS` as parameter 
names for `gremlin-groovy` requests.
   - Code that read the label set from `T.label` in `multilabel` output must 
read `T.labels` instead.
   - Providers that detect label filters by key should use `isLabelKey()`. 
Otherwise they skip their label index for `has(T.labels, ...)` and fall back to 
a scan; results are still correct.
   
   ### Known issue (not addressed)
   
   A list passed as a parameter for `T.label` or `T.labels` (e.g. 
`property(T.labels, x)` with `x` bound to a list) fails with a 
`ClassCastException`. This bug predates this PR and also affects `T.label`, so 
it will be tracked separately.




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

Reply via email to