I'm quite new to Gremlin and have now spent hours trying to figure out how to calculate the values for a given property in all my vertices.
This
g.V('containerName','MyContainer').outE.inV.'(0)Probability'
gives me:
{"results":[" 3"," 3"," 3"," 3"," 3"," 3"," 3"," 3"," 3"],"success":true,"version":"2.4.0","queryTime":15.894908}
So what I'm trying to figure out is:
How can I convert the strings in the list to integer? I've tried...
g.V('containerName','CvsRisk').outE.inV.'(0)Probability'.toInteger()
..., but it does not work.
How to summarize all the values in the list, thus 3+3+...+3, not using count.
Simple groovy: