Basic vertex querying does not work in Amazon Neptune but it works with local Gremlin Server
When I try to fetch vertex with properties like this , or with elementMap() and valueMap(true), It does not work, it just fetches empty object. I can only query properties of a vertex like this in Amazon neptune
but then I would need two queries for basic fetching which I don't want due to performance reasons. Can anyone give me hand here? Thanks
7 Replies
Neptune does not yet support the "properties on elements" feature that was introduced in TinkerPop 3.7.x that allows graph elements like Vertex and Edge to be returned with properties. If you care to understand the history around this design choice you can read this: https://lists.apache.org/thread/xltcon4zxnwq4fyw2r2126syyrqm8spy In 3.7.x we describe how "properties on elements" works in the upgrade documentation: https://tinkerpop.apache.org/docs/current/upgrade/#_properties_on_elements It is therefore expected that when you return a Vertex with Neptune you don't get any properties, but it is odd that when you use
elementMap()
or valueMap()
that you get empty maps. I'm not sure what to make of that. could you say what Neptune and TinkerPop versions you are using?Neptune version: 1.3.2.1
Gremlin version : 3.7.2
Thank you for your message, yes I have simplifed added removed for value map and element map but it did not work
@Memo Can I ask how you are constructing and configuring your GraphTraversalSource (gremlinService.readClientSource)?
I gave a quick test with the most basic setup (using gremlin 3.7.2 and Neptune 1.3.2.1) and it works as I would expect:
thank you for your message, I am putting my code as a file
thanks for the support again
The gremlin-javascript driver deserializes the elementMap() step into the Map class.
await this.gremlinService.readClientSource.V().elementMap().toList()
will return an Array of Maps.
JSON.stringify()
, which NestJS is likely calling for you, doesn't support Maps so you need to convert them into objects using something like Object.fromEntries()
.Thank you very much. Yes nest.js 's logger was the issue after I switched to console log I saw the data structures that was returned. Thanks again!