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

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

Cole-Greer commented on code in PR #3483:
URL: https://github.com/apache/tinkerpop/pull/3483#discussion_r3540409476


##########
docs/src/dev/provider/gremlin-semantics.asciidoc:
##########
@@ -587,6 +587,69 @@ See: 
link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-core/src/main/j
 
link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddVertexStartStep.java[source
 (start)],
 
link:https://tinkerpop.apache.org/docs/x.y.z/reference/#addvertex-step[reference]
 
+=== addLabel()
+
+*Description:* Adds one or more labels to an element.
+
+*Syntax:* `addLabel(String label, String... moreLabels)` | 
`addLabel(Traversal<?, String> labelTraversal)`
+
+[width="100%",options="header"]
+|=========================================================
+|Start Step |Mid Step |Modulated |Domain |Range
+|N |Y |N |`Element` |`Element`
+|=========================================================
+
+*Arguments:*
+
+* `label` - The label to add.
+* `moreLabels` - Additional labels to add.
+* `labelTraversal` - A traversal that produces labels to add.
+
+*Considerations:*

Review Comment:
   I've reworded this for clarity, but yes singlelabel does imply immutability, 
because there is no atomic operation to replace labels, and there labels cannot 
be added or removed without violating the cardinality. This also keeps 
`LabelCardinality.ONE` consistent with the legacy TP3 semantics which I think 
is nice.





> Enable multiple label support on vertex with configurable label cardinality
> ---------------------------------------------------------------------------
>
>                 Key: TINKERPOP-3261
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3261
>             Project: TinkerPop
>          Issue Type: Task
>    Affects Versions: 4.0.0
>            Reporter: Yang Xia
>            Priority: Major
>
> Vertices are currently limited to a single immutable label assigned at 
> creation. This prevents modeling common real-world scenarios where entities 
> naturally belong to multiple categories (e.g., a person who is both an 
> employee and a manager).
>   
> Introduce a configurable LabelCardinality that controls how many labels a 
> vertex may have and whether they can be mutated after creation. Three 
> proposed modes: ONE (current behavior, default), ONE_OR_MORE (mutable, 
> minimum one), ZERO_OR_MORE (fully flexible).
>   
> New steps:
>   
> - labels() — flatMap step emitting each label as a traverser
> - addLabel(String, String...) — add labels to a vertex
> - dropLabel(String, String...) — remove specific labels
> - dropLabels() — remove all labels
> Edge labels remain at cardinality ONE. The infrastructure would support 
> future edge multi-label enablement without wire format changes.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to