OrientVertexType vertexType = graph.createVertexType("person", null);
vertexType.createProperty("name", OType.STRING);
Vertex outVertex = graph.addVertex("class:person", null);
outVertex.setProperty("name", "Roberta");
Vertex inVertex = graph.addVertex("class:person", null);
inVertex.setProperty("name", "Peter");
OrientEdgeType edgeType = graph.createEdgeType("relationship", null);
edgeType.createProperty("since", OType.DATETIME);
Edge edge = graph.addEdge("class:relationship", outVertex, inVertex, "married");
edge.setProperty("since", aDate);
WARNING: Committing the active transaction to create the new type 'married' as subclass of 'E'.
The transaction will be reopen right after that. To avoid this behavior create the classes outside the transaction.
Orient Technologies
the Company behind OrientDB--
---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Edge edge = graph.addEdge("class:relationship", outVertex, inVertex, "married");
edge.setProperty("since", aDate);
alter database custom useClassForEdgeLabel=false
Iterable<Edge> edges = graph.getEdges();
for(Edge edge : edges){
if(edge.getLabel().equals("married"){
// do some stuff
} else if(edge.getLabel().equals("engaged"){
// do some stuff
}
//....
}