You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ArangoDB
Hi,
I have 2 types of edges:
mayknow
friend
For certain vertex How can I get all neighbors (1st, 2nd and 3rd level) and exclude all vertices that have direct "friend edge" in 1st level.
So I need to get all people that I may know but still not friends.
Jan
unread,
Nov 14, 2016, 5:46:57 AM11/14/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ArangoDB
Hi,
if the edges are stored in two different collections ("mayknow" and "friends") then one solution would be to run the normal traversal for "mayknow" and exclude friends for each visited vertex:
LET startNode = 'people/a' FOR v IN 1..3 OUTBOUND startNode mayknow FILTER LENGTH(FOR tmp IN friend FILTER tmp._from == startNode && tmp._to == v._id RETURN 1) == 0 RETURN v
Note that the above uses direction "OUTBOUND", which is probably not right. If the edges in your graph are always pointing into another direction, you should use the appropriate directions instead. Best regards Jan