1
votes

How to typecast an vertex property value in AWS Neptune. Taking into account the initial type of the vertex is string, I want to convert that to Integer.

I tried some of the available resources in Stackoverflow for the typecasting as below.

g.V().values('code').map{(''+it).toInteger()}

But this is throwing error mentioning

error message : token recognition error at: 'it)'"}

It seems it is unable to parse the "it" after "+".

Is there a direct way that this could be achieved in Neptune using Gremlin.

1

1 Answers

1
votes

Amazon Neptune does not allow closures/lambdas to be included as part of a Gremlin query. You will find some notes on that here [1]. You will probably need to handle any such type casting in your application or alternatively adjust the data model to use integers for the properties that really are integers. If you can provide a sample graph it may be possible to suggest additional things that you can try.

[1] https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-differences.html