How can we extract values only
"Latitude",
{
"@type": "g:Double",
"@value": 45.2613104
},
"Longitude",
{
"@type": "g:Double",
"@value": 9.491678060021837
},
In the germlin with AWS neptune am getting like this. but i need to get only values how can we extract only values through query.
{
"@type": "g:Double",
"@value": 45.2613104
},
"Longitude",
{
"@type": "g:Double",
"@value": 9.491678060021837
},
In the germlin with AWS neptune am getting like this. but i need to get only values how can we extract only values through query.
Solution
If I understand this correctly, you are first trying to take the result of a gremlin query that returns Latitude and Longitude (like in the initial post you made), and use those values in the in the math() step that calculates the Haversine formula (your latest post). If that is the case, you have two options.
- You should combine this into one Gremlin query. You can save the results of the Latitude and Longitude to variables or use them in a by() modulator to the math step. Assuming that those values are properties on a vertex called 'lat' and 'lon' it would look something like
g.V().project('Latitude', 'Longitude').by('lat').by('lon').math(...). You would replace the ... in the math() step with the Haversine formula. - If you want to keep these as two separate queries, then you should use one of the Gremlin Languages Variants (GLVs) which are essentially drivers that will automatically deserialize the result into the appropriate type so you don't have to deal with the GraphSON (which is what your initial post shows). Read triggan's answer above for more details about that.