Graph 特定顶点上的OrientDb限制边

Graph 特定顶点上的OrientDb限制边,graph,orientdb,Graph,Orientdb,有没有办法限制特定顶点上的边?我不是指重量轻的边缘 我有: [Vertex] Person (properties: firstName, lastName, birthDate) [Vertex] House (properties: street, city) [Vertex] Car (properties: brand, make, year) [Edge] livesIn (properties: sinceDate, isOwner) [Edge] owns (pr

有没有办法限制特定顶点上的边?我不是指重量轻的边缘

我有:

[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”限制在Person和House之间,因此如果我在Person对象(#12:0)和House对象(#13:0)之间创建一个“livesIn”边缘对象(创建边缘livesIn从#12:0到#13:0),它会成功,但对于Person和Car对象(#14:0)它会失败


(我正在使用orientdb-community-2.1.2)

哦,找到了。答案如下:

要将其应用于您的案例,请尝试:

create property livesIn.out link Person
create property livesIn.in link House

可能有一些人住在他们的车里P我在寻找同样的解决方案。尽管我使用的是轻质边缘。关注这个问题。谢谢!真傻,我没发现。因此,它通过在内外创建属性来真正起作用。再深入一点,您还可以强制执行只有在内外都提供的情况下才能创建边缘(因此,每个边缘都必须有一个人在“外出”,一栋房子在“入住”,方法是:alter property livesIn.out MANDATORY=TRUE;alter property livesIn.in MANDATORY=TRUE