Gremlin-go cannot bring out props when querying Vertex with Neptune
when i execute this code, it gots result as picture shows.
In fact, when i use https execute same query, its returns props.
response is
Solution:Jump to solution
The short answer is that you can get properties on your returned elements after 3.7.0 - https://tinkerpop.apache.org/docs/current/upgrade/#_properties_on_elements (note that the graph database that you are using must also support 3.7.x). If you care about the long answer then you should read this: https://lists.apache.org/thread.html/e959e85d4f8b3d46d281f2742a6e574c7d27c54bfc52f802f7c04af3%40%3Cdev.tinkerpop.apache.org%3E
13 Replies
Why does this happen
Solution
The short answer is that you can get properties on your returned elements after 3.7.0 - https://tinkerpop.apache.org/docs/current/upgrade/#_properties_on_elements (note that the graph database that you are using must also support 3.7.x). If you care about the long answer then you should read this: https://lists.apache.org/thread.html/e959e85d4f8b3d46d281f2742a6e574c7d27c54bfc52f802f7c04af3%40%3Cdev.tinkerpop.apache.org%3E
Thank you very much!
Neptune is working on bringing 3.7.x support. There is no projected date for its release yet.
yes, Neptune currently supports up to 3.6.2.
What I am confused about is when I use other gremlin go client such as github.com/northwesternmutual/grammes. g.V() can obtain all information including prop. Is this because of the MIME type?
i'm not really sure. i don't know the internals of grammes, but they could be just doing some magic to make it happen. i'd guess they are making two requests (or more) to get the properties (i.e.
g.V()
gets the reference vertices with just id/label and then when you access properties it sends a second query to retrieve those...but again, just a guess). not sure if there is a serializer combination that can deliver properties over bytecode based requests but if there is it wouldn't matter for TinkerPop's gremlin-go because the vertex/edge objects don't have properties members to deserialize those into even if they were there.Thank you again, your reply is very helpful to me:) <:gremlin_smile:1091719089807958067>
I know what's going on, grammes add on the mimetype"application/vnd.gremlin-v2.0+json" to the header of the websocket request, so the gremlin server return the json response including properties, and gremlin-go serilazer only support MimeType
Are there any plans to implement a json serializer/deserializer? If so, I would like to participate and make some contributions.
oh, right you're using Neptune. I forgot Neptune has some slightly diffrent behavior there compared to Gremlin Server. Gremlin Server will automatically detach graph elements and convert them to references. Neptune never followed that pattern.
Oh, so that’s it
Are there any plans to implement a json serializer/deserializer?no, i don't think so. it wouldn't help too much especially since 3.7.0 puts properties on elements. GraphBinary will be a more efficient format so adding GraphSON too wouldn't bring much new to the table. that said, we'd love to have you contribute in other ways if you'd like to for futher clarity, Neptune and GraphBinary would never return properties because GraphBinary didn't serialize them prior to 3.7.0. Neptune does return properties for GraphSON because it doesn't follow the auto-detachment model that Gremlin Server did prior to 3.7.0.
Tricky problem, we are currently investigating to replace the original go client and use the official gremlin go client
ok, i got you, I will wait for Neptune support 3.7.0
i think waiting would be the best course of action. hopefully it won't be too long a wait
thank you so much ❤️