How to get cardinality of property?

I have a multi property and I want to find out its cardinality. How can I do that? valueMap/elementMap don't help
Solution:
TinkerPop really doesn't know, so it can't tell you the answer. It has no notion of schema. You as the user have to know and adjusting your Gremlin accordingly in your application layer. The best that we have internally (and maybe for embedded use cases) is VertexFeatures.getCardinality(String) which, if implemented by the provider, will tell you a hint at the cardinality. https://github.com/apache/tinkerpop/blob/1e3c881d9f157167b53f431898e6d1ee40429cd0/gremlin-core/src/main/java/org/apache/t...
GitHub
tinkerpop/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/s...
Apache TinkerPop - a graph computing framework. Contribute to apache/tinkerpop development by creating an account on GitHub.
Jump to solution
3 Replies
Solution
spmallette
spmallette14mo ago
TinkerPop really doesn't know, so it can't tell you the answer. It has no notion of schema. You as the user have to know and adjusting your Gremlin accordingly in your application layer. The best that we have internally (and maybe for embedded use cases) is VertexFeatures.getCardinality(String) which, if implemented by the provider, will tell you a hint at the cardinality. https://github.com/apache/tinkerpop/blob/1e3c881d9f157167b53f431898e6d1ee40429cd0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Graph.java#L581-L594
GitHub
tinkerpop/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/s...
Apache TinkerPop - a graph computing framework. Contribute to apache/tinkerpop development by creating an account on GitHub.
Valentyn Kahamlyk
Valentyn KahamlykOP14mo ago
GitHub
tinkerpop/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gr...
Apache TinkerPop - a graph computing framework. Contribute to apache/tinkerpop development by creating an account on GitHub.
spmallette
spmallette14mo ago
yeah, that's what i mean. it's a hint...at best
Want results from more Discord servers?
Add your server