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

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

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


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializersV4.java:
##########
@@ -432,8 +438,14 @@ public Edge deserialize(final JsonParser jsonParser, final 
DeserializationContex
                     e.setId(deserializationContext.readValue(jsonParser, 
Object.class));
                 } else if 
(jsonParser.getCurrentName().equals(GraphSONTokens.LABEL)) {
                     jsonParser.nextToken();
+                    final java.util.Set<String> labels = new 
java.util.LinkedHashSet<>();

Review Comment:
   Following the [existing IO 
docs](https://github.com/apache/tinkerpop/blob/eab8d7fecb3b5d6dc78abafaacf9487384fcccd9/docs/src/dev/io/graphson.asciidoc?plain=1#L451-L453)
 in master, the edge label is already encoded as a list in the wire format. I'd 
like the serializers to operate on edge labels as lists and leave the 
EdgeCardinality=1 enforcement to the structure API. I think that gives us the 
most flexibility for future changes, even though there are currently no plans 
to have multilabelled edges.





> 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