繁体   English   中英

OrientDB:查找没有给定类的直接邻居顶点的所有顶点

[英]OrientDB: Find all vertices that have no direct neighbour vertex of a given class

使用OrientDB的查询语言,如何才能找到群集的所有顶点a已经没有外出边缘类的顶点结束b (即类没有直接的邻居顶点b )? 它们是否有其他外围边缘并不重要。

如果您已将A类映射到群集a,则可以执行以下操作:

select from A where not( out.in.@class in ['b'] )

这意味着跨越A记录的“out”属性(作为边),然后是“in”属性(顶点),然后获取类名(@class)。 我使用了IN运算符而不是=(等于),因为“out.in. @ class”返回一个类名集合。

如果你想要没有A类,你必须通过集群A使用集群:语法:

 select from cluster:A where not( out.in.@class in ['b'] )

我已经测试了最新的1.0rc8-SNAPSHOT并且正常工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM