Question

im working right now on a problem with edges.
i created this edge type in a graph without transactions:

this.graph.createEdgeType("edge", null);

So there is now an edge type edge with the parent E.
When i now create an edge of the created edge type (in a graph with transactions):

Edge edge = this.graph.addEdge("class:edge", outVertex, inVertex, "example");

and add a property to it:

edge.setProperty("property", "example");

He is creating a new class example as subclass of E:

WARNING: Committing the active transaction to create the new type 'example' 
as subclass of 'E'. The transaction will be reopen right after that. 
To avoid this behavior create the classes outside the transaction.

Why is he not taking my edge type which i created as superclass of the example edge?
Why is he creating a new type as subclass of E?

I do the same thing with Vertices but the difference is it works:

this.graph.createVertexType("person", null);

Vertex vertex = this.graph.addVertex("class:person", null, "person");
vertex.setProperty("name", "peter");

No problem here.

Was it helpful?

Solution

Use the edge's label as class.:

Edge edge = this.graph.addEdge("class:example", outVertex, inVertex, "example");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top