OrientDb 限制特定顶点上的边
OrientDb limit Edge on specific Vertices
有没有办法限制特定顶点的边?我不是说重量轻的边缘。
说,我有:
[Vertex] Person (properties: firstName, lastName, birthDate)
[Vertex] House (properties: street, city)
[Vertex] Car (properties: brand, make, year)
[Edge] livesIn (properties: sinceDate, isOwner)
[Edge] owns (properties: sinceDate)
现在我希望能够限制(从)人和(到)房子之间的边 'livesIn',所以如果我创建一个 'livesIn' 边对象(Create EDGE livesIn FROM #12 :0 TO #13:0) 在 Person 对象 (#12:0) 和 House 对象 (#13:0) 之间成功,但对于 Person 和 Car 对象 (#14:0) 将失败。
(我正在使用orientdb-community-2.1.2)
哦,找到了。在这里回答:Enforce an Edge to connect two distinct vertex classes
要将其应用于您的案例,请尝试:
create property livesIn.out link Person
create property livesIn.in link House
有没有办法限制特定顶点的边?我不是说重量轻的边缘。
说,我有:
[Vertex] Person (properties: firstName, lastName, birthDate)
[Vertex] House (properties: street, city)
[Vertex] Car (properties: brand, make, year)
[Edge] livesIn (properties: sinceDate, isOwner)
[Edge] owns (properties: sinceDate)
现在我希望能够限制(从)人和(到)房子之间的边 'livesIn',所以如果我创建一个 'livesIn' 边对象(Create EDGE livesIn FROM #12 :0 TO #13:0) 在 Person 对象 (#12:0) 和 House 对象 (#13:0) 之间成功,但对于 Person 和 Car 对象 (#14:0) 将失败。
(我正在使用orientdb-community-2.1.2)
哦,找到了。在这里回答:Enforce an Edge to connect two distinct vertex classes
要将其应用于您的案例,请尝试:
create property livesIn.out link Person
create property livesIn.in link House