OrientDB从导线测量中排除某些顶点

OrientDB从导线测量中排除某些顶点,orientdb,Orientdb,我希望能够从OrientDB遍历查询中排除某些顶点 比如说, traverse * from (select from Location where ID = '1234') 将在起点处遍历所有顶点类。我需要一种为特定类添加排除的方法 我知道,如果我不使用*运算符,而是指定我想要的所有类,这是可能的。然而,这并不合适,因为会有我的程序甚至不知道的课程。数据不断变化,但要排除的类始终存在 您可以使用差分功能来完成: select expand($c) let $a=traverse * from

我希望能够从OrientDB遍历查询中排除某些顶点

比如说,

traverse * from (select from Location where ID = '1234')
将在起点处遍历所有顶点类。我需要一种为特定类添加排除的方法


我知道,如果我不使用*运算符,而是指定我想要的所有类,这是可能的。然而,这并不合适,因为会有我的程序甚至不知道的课程。数据不断变化,但要排除的类始终存在

您可以使用差分功能来完成:

select expand($c)
let $a=traverse * from (select from Location where ID = '1234')
$b=select from <class to exclude>
$c=difference($a,$b)
不确定Syntax,但它应该可以工作


再见,伊万,我不知道我是否理解正确

我有这个结构

我想从节点A1开始遍历,不包括B类节点和相关分支

我使用这个查询

traverse * from #12:0 while @class<>"B"
select * from (traverse * from #12:0 while @class<>"B") where @class<>"E" or (@class="E" and in.@class<>"B")
希望能有帮助

更新

我使用这个查询

traverse * from #12:0 while @class<>"B"
select * from (traverse * from #12:0 while @class<>"B") where @class<>"E" or (@class="E" and in.@class<>"B")
更新2


这太棒了!但是,它仍然返回悬空的边。我们也能排除这些吗?