graph - get neighborhood of a node Arangodb -
i'm trying neighborhood of node in arangodb.
when in nodes:
v in protein_g_h filter v._to == "p2/9606.ensp00000326759" return v
i result. doing out nodes
for v in protein_g_h filter v._from == "p2/9606.ensp00000326759" return v
i result doing this:
for v in protein_g_h filter v._to == "p2/9606.ensp00000326759" filter v._from == "p1/9606.ensp00000326759" return v
--or--
for v in protein_g_h filter v._to == "p2/9606.ensp00000326759" , v._from == "p1/9606.ensp00000326759" return v
to in , out nodes nothing. problem?
if want retrieve in and out nodes, need test if _from
or _to
property of edge equal node want neighbors for:
for e in protein_g_h filter e._to == "p2/9606.ensp00000326759" or e._from == "p2/9606.ensp00000326759" return e
i recommend use aql graph traversal retrieve neighbor vertices:
for v in 1..1 "p2/9606.ensp00000326759" protein_g_h return v
this return first degree neighbor vertices of vertex 9606.ensp00000326759
in vertex collection p2
, following edges in edge collection protein_g_h
in direction (either _from or _to must equal p2/9606.ensp00000326759
).
Comments
Post a Comment