Graph OrientDB在顶点和文档之间创建边
我有一个数据库,里面有一大堆气味文件记录。它们有自己的类层次结构,它不扩展V 我正在添加新的集合并支持一些功能,我们希望使用graph db功能 因此,我创建了一个新的顶点perGraph OrientDB在顶点和文档之间创建边,graph,graph-databases,orientdb,Graph,Graph Databases,Orientdb,我有一个数据库,里面有一大堆气味文件记录。它们有自己的类层次结构,它不扩展V 我正在添加新的集合并支持一些功能,我们希望使用graph db功能 因此,我创建了一个新的顶点per Vertex company=graph.addVertex(null) 我找到我现有的ODoc并将其转换为顶点作为 顶点人=空; 对于(顶点v:graph.getVertexs(“Person.name”、“Jay”)){ person=v; } 并尝试创建一条边 Edge sessionInIncident =
Vertex company=graph.addVertex(null)代码>
我找到我现有的ODoc并将其转换为顶点作为
顶点人=空;
对于(顶点v:graph.getVertexs(“Person.name”、“Jay”)){
person=v;
}
并尝试创建一条边
Edge sessionInIncident = graph.addEdge(null, company, person, "employs");
创建边将导致以下结果
Class 'Person' is not an instance of V
java.lang.IllegalArgumentException
at com.tinkerpop.blueprints.impls.orient.OrientElement.checkForClassInSchema(OrientElement.java:635)
at com.tinkerpop.blueprints.impls.orient.OrientVertex.addEdge(OrientVertex.java:905)
at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.addEdge(OrientBaseGraph.java:685)
为了成为顶点,类Person
必须扩展V
类。请尝试以下命令:
alter class Person superclass V
谢谢,这正是我想要的!