I can't create an edge in aws neptune using gremlin. I can create vertices. but not edge.
import { driver, process as gremlinProcess, structure } from "gremlin";
async function checkOut() {
const DriverRemoteConnection = driver.DriverRemoteConnection;
const Graph = structure.Graph;
const dc = new DriverRemoteConnection(
ws://localhost:7070/gremlin
, {
sloppy: true,
rejectUnauthorized: false,
});
const traversal = gremlinProcess.AnonymousTraversalSource.traversal();
const _ = gremlinProcess.traversal();
const graph = new Graph();
const g = graph.traversal().withRemote(dc);
const v1 = await g.addV("person").property("name", "main").next();
const v2 = await g.addV("person").property("name", "male").next();
const data = await g.addE("wrote").from(g.V(v1.value.id)).to(g.V(11)).next();
g.V()
.toList()
.then((data) => {
console.log("DATA", data);
dc.close();
})
.catch((error) => {
console.log("ERROR", error);
dc.close();
});
}
checkOut();Solution:Jump to solution
g.V(11)
is not valid query for Neptune, vertex id should be string value https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-differences.html#feature-gremlin-differences-vertex-edge-idsGremlin standards compliance in Amazon Neptune - Amazon Neptune
Overview of differences between the Neptune and TinkerPop implementations of Gremlin.
1 Reply
Solution
g.V(11)
is not valid query for Neptune, vertex id should be string value https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-differences.html#feature-gremlin-differences-vertex-edge-idsGremlin standards compliance in Amazon Neptune - Amazon Neptune
Overview of differences between the Neptune and TinkerPop implementations of Gremlin.