I'm adding a new vertex and an edge to an existing vertex in Datastax Graph, and I wanted to see how to do that with Datastax CassandraCSharpDriver.Graph.
The working Gremlin code looks like this:
Vertex link1 = graph.addVertex(label, "link").property("id", "link-2")
Vertex item1 = g.V().has("item", "id", "item-1").next()
item1.addEdge('contains', link1)
But in the C# driver syntax, I was hoping to do something like this but when I execute it, the error is the "adjacency of 'contains' in direction 'OUT' has not been added to 'link'"
GraphTraversalSource g = DseGraph.Traversal(mySession);
var traversal = g.AddV("link").Property("id", "link-1")
.AddE("contains")
.V("item").Has("id", Eq("item-1"));
GraphResultSet result = mySession.ExecuteGraph(traversal);
I had created the edge and edge connections like this:
schema.edgeLabel("contains").multiple().create()
schema.edgeLabel("contains")
.connection("item", "link")
.connection("link", "item")
.add()
Any ideas if the schema edge is setup incorrectly or how to do this the best way in Datastax CassandraCSharpDriver.Graph?