I'm having problem converting the Strings "[3]" here:
p = {"results":["[3]","[3]"],"success":true,"version":"2.4.0","queryTime":63.102287}
to Lists.
p[0] gives me:
{"results":["[3]"],"success":true,"version":"2.4.0","queryTime":68.24303}
So I was thinking I could use Eval.me(p[0]) but thet gives me an error saying:
{"message":"","error":"javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: static groovy.util.Eval.me() is applicable for argument types: (com.tinkerpop.gremlin.groovy.GremlinGroovyPipeline) values: [[GremlinStartPipe, GraphQueryPipe(has,vertex), IdentityPipe, PropertyPipe(Sannolikhet), RangeFilterPipe(0,0)]]\nPossible solutions: me(java.lang.String), me(java.lang.String, java.lang.Object, java.lang.String), is(java.lang.Object), use([Ljava.lang.Object;), _(groovy.lang.Closure), dump()","api":{"description":"evaluate an ad-hoc Gremlin script for a graph.","parameters":{"rexster.returnKeys":"an array of element property keys to return (default is to return all element properties)","rexster.showTypes":"displays the properties of the elements with their native data type (default is false)","load":"a list of 'stored procedures' to execute prior to the 'script' (if 'script' is not specified then the last script in this argument will return the values","rexster.offset.end":"end index for a paged set of data to be returned","rexster.offset.start":"start index for a paged set of data to be returned","params":"a map of parameters to bind to the script engine","language":"the gremlin language flavor to use (default to groovy)","script":"the Gremlin script to be evaluated"}},"success":false}
Anyone that knows how this can be done without using Eval.me?
EDIT
To Clarify, the first part of my script:
p = g.V('containerName','CvsRisk').outE.inV.hasNot('Sannolikhet',null).'Sannolikhet';
I "extract" all the vertices in a container with the containerName CvsRisk that has a property named "Sannolikhet" that is not null. Running this part of the script gives me the following response from the server:
{"results":["[3]","[3,3]","[3,3]","[3,3]","[3,3]","[3,3]","[3,3]","[3]","[3,3]","[3]","[3,3]","[3,3]"],"success":true,"version":"2.4.0","queryTime":20.429118}
Which is what I want since all my properties named "Sannolikhet" contains an array of values.
It is from here I want to iterate through the result and sum up the values in the Strings, but in order to do so I need to convert the Strings to lists.