Aggregating vertices with set-cardinality properties
I am aggregating traversed vertices that have both single and set-cardinality properties. When capturing the vertex using
However, when trying to use
It just gives the last property value in the set.
query using
Query 1 returns only the first-added sample:
Query Using
Query 2 returns only the last-added sample:
What I need is the following result:
I tried playing with
Appreciate your help!
elementMap() it assumes a single-cardinality for all properties and only considers the last element in the set when building the map. However, when trying to use
valueMap(true).by(unfold()) (as described in this SO reply: https://stackoverflow.com/a/75225994/3516889)It just gives the last property value in the set.
query using
valueMap(true).by(unfold()) (1):Query 1 returns only the first-added sample:
Query Using
elementMap() (2):Query 2 returns only the last-added sample:
What I need is the following result:
I tried playing with
local() but I can't seem to get a proper map of the elements with a set-cardinality property.Appreciate your help!
Stack Overflow
In Tinkerpop3 valueMap is returning an array, how can I get a real key value pair (without Array)?
gremlin> Gremlin.version()
==>3.0.1-incubating
:> def trav = g.V().hasLabel('Group'); t...
gremlin> Gremlin.version()
==>3.0.1-incubating
:> def trav = g.V().hasLabel('Group'); t...