sap13n
ATApache TinkerPop
•Created by sap13n on 6/12/2023 in #questions
Aggregating vertices with set-cardinality properties
I am aggregating traversed vertices that have both single and set-cardinality properties. When capturing the vertex using
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!15 replies