Gremlin console vs REST API

I'm trying to get a path and the properties of the vertices and the edges for that path by running a gremlin script via REST API in Neptune. The query is simple with some filters on the edges, but the result is different from what gremlin console gives me.

For example, the following query returns the path with the type of entities (vertex or edge) but only the label and the ID properties.
g.V('efc912d3-6cec-49e2-9717-85625bab5243').inE().outV().path()

Similarly, by adding a by(valueMap()) modulator I get all the properties of all edges and vertices in the path, but not the types ("@type": "g:Edge" and "@type": "g:Vertex")
The call to Neptune is done as described here https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-rest.html

I guess the question is: is there a way to get the type of entity and all properties with one single query?
Steps for connecting to Neptune using the HTTPS REST Endpoint.
Solution
Generally speaking, the GLVs and the Gremlin Console (if sending queries as bytecode and connecting via websockets) will serialize the results back into types that are common to the runtime that you're using for your application.

Queries sent over HTTP will return the response using GraphSON (GraphSONv3, be default with Neptune) which includes all of the extra type information.
Was this page helpful?