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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -