AT

How to get cardinality of property?

VKValentyn Kahamlyk10/10/2023
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...
Jump to solution
Solution
Sspmallette10/10/2023
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.
VKValentyn Kahamlyk10/10/2023
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.
Sspmallette10/10/2023
yeah, that's what i mean. it's a hint...at best

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
inverted regex searchHey, In my vertices I store escaped regexp statements as labels (e.g: 'wh.' which in theory should Debug message spam from tinkerpop server 3.7Right now, when connecting to my local tinkerpop server, I am getting incredible amounts of debug loShould by() Modulator Work For More Types?This works. `gremlin> g.V().out().out().path().by("name") ==>[marko,josh,ripple] ==>[marko,josh,lop]InProcess GraphDB with Gremlin Support? (C# or NodeJS)Hello, is there any in process GraphDB out there in the world? Best would be c# or NodeJS and not JaEasiest Way to Get List Cardinality Properties As a List?What is the easiest way to retrieve the vertex properties that have list cardinality back as a list filter lambda in remote consolehi all, i’m trying to do filter on remote console to neptune server but keep getting MalformedQueryEwithin() and case insensitiveI need to check if a property of a node is in a list of values. How can I do that in a case insensitproject("p").by(__.values("a", "b") Only Outputs Single Property, Bug or Expected?I am curious why this does not behave in the way I expected. Not a problem - solution question. I Use of by()Can somebody explain the usecase of by() function in gremlin in very simple language.@GremlinDSL support in the GremlinLangScriptEngineHi, I recently sent a pull-request into the github ArcadeDB repository to add support binding custoRepeatStep does not appear to respect barriersI was digging into some traversal performance and had something similar to the following: ``` g.V(<Trying to find a Vertex using a variable injected earlier in the traversalI am trying to add a series of vertices and edges to an existing graph. The newly created Vertex wi