Orientdb查询-查找指向顶点的所有连接

Orientdb查询-查找指向顶点的所有连接,orientdb,Orientdb,我在orientdb中有以下用例 (V= Vertex, E=Edge) FacebookAccount(V) -> OwnedBy(E) ->Human(V) TwitterAccount(V) -> OwnedBy(E) ->Human(V) TwitterAccount(V) OR FacebookAccount(V) -> FriendOf(E) -> TwitterAccount(V) OR FacebookAccount(V) 我想看看所有

我在orientdb中有以下用例

(V= Vertex, E=Edge)
FacebookAccount(V) -> OwnedBy(E) ->Human(V) 
TwitterAccount(V) -> OwnedBy(E) ->Human(V) 

TwitterAccount(V) OR FacebookAccount(V) -> FriendOf(E) -> TwitterAccount(V) OR FacebookAccount(V)
我想看看所有的人类是如何与一个特定的人类联系在一起的。 1.我不想看到非人类所有的
facebook账户
twitter账户
,这应该被隐藏:
15:2

2.我不想看到
FacebookAccount
TwitterAccount
是一个
Human
所拥有的
而不是另一个
Human
。这些应该隐藏:
17:0、18:0、17:1

我有以下疑问:

traverse in("FriendOf"),out("FriendOf"), in("OwnedBy"),out("OwnedBy")  from #19:0 while $depth <= 10 

看起来您可能想阻止任何帐户不为任何人所有。OwnedBy作为链接可能比边缘更好,因此您可以强制使用它(并且每个帐户只强制一个所有者)。此外,如果用户和OwnedBy总是相同的,那么您可以将它们合并到一个链接中。看起来您可能希望防止任何帐户不为任何人所有。OwnedBy作为链接可能比边缘更好,因此您可以强制使用它(并且每个帐户只强制一个所有者)。此外,如果user和OwnedBy始终相同,则可以将它们合并到一个链接中。
create class FacebookAccount IF NOT EXISTS extends V;
create class TwitterAccount IF NOT EXISTS extends V;
create class Human IF NOT EXISTS extends V;
create class OwnedBy IF NOT EXISTS extends E;
create class FriendOf IF NOT EXISTS extends E;

/* A */
create VERTEX FacebookAccount set user='A_FB';
create VERTEX TwitterAccount set user='A_TW';
create VERTEX Human set person='A';
CREATE EDGE OwnedBy FROM (Select from FacebookAccount where user='A_FB') TO (Select from Human where person='A');
CREATE EDGE OwnedBy FROM (Select from TwitterAccount where user='A_TW') TO (Select from Human where person='A');

/* B */
create VERTEX FacebookAccount set user='B_FB';
create VERTEX TwitterAccount set user='B_TW';
create VERTEX Human set person='B';
CREATE EDGE OwnedBy FROM (Select from FacebookAccount where user='B_FB') TO (Select from Human where person='B');
CREATE EDGE OwnedBy FROM (Select from TwitterAccount where user='B_TW') TO (Select from Human where person='B');

/* C */
create VERTEX FacebookAccount set user='C_FB';
create VERTEX TwitterAccount set user='C_TW';
create VERTEX Human set person='C';
CREATE EDGE OwnedBy FROM (Select from FacebookAccount where user='C_FB') TO (Select from Human where person='C');
CREATE EDGE OwnedBy FROM (Select from TwitterAccount where user='C_TW') TO (Select from Human where person='C');

/* X */
create VERTEX Human set person='X';
create VERTEX FacebookAccount set user='X_FB';
CREATE EDGE OwnedBy FROM (Select from FacebookAccount where user='X_FB') TO (Select from Human where person='X');

/* Y */
create VERTEX FacebookAccount set user='Y_FB';


CREATE EDGE FriendOf FROM (Select from FacebookAccount where user='Y_FB') TO (Select from FacebookAccount where user='X_FB');
CREATE EDGE FriendOf FROM (Select from FacebookAccount where user='X_FB') TO (Select from FacebookAccount where user='C_FB');
CREATE EDGE FriendOf FROM (Select from FacebookAccount where user='A_FB') TO (Select from FacebookAccount where user='B_FB');
CREATE EDGE FriendOf FROM (Select from FacebookAccount where user='B_FB') TO (Select from FacebookAccount where user='C_FB');