[TINKERPOP-3261] Enable multiple labels on vertex with configurable label cardinality#3483
Draft
xiazcy wants to merge 6 commits into
Draft
[TINKERPOP-3261] Enable multiple labels on vertex with configurable label cardinality#3483xiazcy wants to merge 6 commits into
xiazcy wants to merge 6 commits into
Conversation
- Add labels() flatMap step emitting each label as a separate traverser - Add addLabel()/dropLabel()/dropLabels() sideEffect mutation steps - Add Element.labels() API returning Set<String> - Update grammar for label mutation and multi-label addV() - Add GraphBinary and GraphSON V4 serialization for multi-label - Add MergeVertex multi-label support - Implement in TinkerGraph with thread-safe ConcurrentHashMap.newKeySet() - Add unit tests for label mutation, properties, and GremlinLang
- Add label mutation API on edges (validates and throws for ONE cardinality) - Add edge binary and GraphSON serialization for label set - Fix multi-label handling in TinkerTransactionGraph - Add Gherkin feature tests for labels(), addLabel(), dropLabel() - Add event/mutation support for label changes on edges - Thread-safe edge label storage with ConcurrentHashMap.newKeySet() - Wire up GLV test infrastructure for multi-label scenarios
- .NET: GraphTraversal, GraphTraversalSource, Edge/Vertex structures, binary serializers - Go: graphTraversal, graph structures, binary serializer/deserializer - JavaScript: graph-traversal.ts, graph.ts, binary serializers - Python: graph_traversal.py, graph.py, graphbinaryV4.py - Update GLV test translations and Gherkin step bindings - Add MergeEdge and AddEdge feature test scenarios
…'multilabel')
- Introduce LabelCardinality enum as pure data descriptor (min/max/mutable)
- Add LabelCardinalityValidator for separated constraint enforcement
- Add Graph.Features for label cardinality declaration
- Update MergeVertex/MergeEdge with append-only label semantics on onMatch
- Simplify with('multilabel') to source-level only via OptionsStrategy
- Remove redundant step-level with(WithOptions.multilabel) path
- Add serialization support for GraphML, GraphSON v1/v2/v3, Gryo
- Add label replace pattern validation tests
…ocs and tests - Default TinkerGraph to LabelCardinality.ONE (backward-compatible) - Add tinkergraph-multilabel.properties for multi-label graph config - Add LabelsDropVerificationStrategy to prevent accidental labels().drop() - Add multi-label TinkerGraph to Gremlin Server integration test config - Update GLV Gherkin infrastructure for multi-label test graph - Add LabelCardinalityTest for verifying cardinality modes - Add feature tests: drop non-existent label, mergeV onCreate/onMatch - Add unit tests: null/empty args, hasLabel OR/AND semantics, index cycle - Add reference docs for addLabel, dropLabel, labels steps - Add TinkerGraph multi-label configuration docs - Add provider semantics docs for new steps - Add upgrade docs for users and providers - Add CHANGELOG entries - Remove unrelated addE() no-arg grammar/API addition - Fix vertexLabelCounts to handle multi-label vertices
93b3b0c to
9f66466
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces configurable label cardinality for graph elements. Vertex cardinality is user-configurable; edge cardinality defaults to ONE and is not yet exposed as a configuration option but uses the same underlying infrastructure.
Vertices can now have zero, one, or many labels controlled by LabelCardinality (defaults to ONE for full backward compatibility). New traversal steps labels(), addLabel(), dropLabel(), and dropLabels() enable label retrieval and mutation. Edge labels remain fixed at cardinality ONE.
Notes on design:
Commits:
Configuration
To Enable multi-label in TinkerGraph:
gremlin.tinkergraph.vertexLabelCardinality=ZERO_OR_MORE
Testing
VOTE +1