[英]ArangoDB only return vertices visited more than X
I have a graph with multiple ways of reaching an end-vertice from the start-vertice and what I'm trying to achive is to only return those vertices visited by traversing ALL outbound edges of a user's role. 我有一个具有从起始顶点到最终顶点的多种方式的图,而我试图达到的结果是仅遍历用户角色的所有出站边缘,以返回那些访问过的顶点。
Details: 细节:
The user has N roles where each role is connected to different hierarchical subjects. 用户具有N个角色,其中每个角色都连接到不同的层次结构主题。
Articles are published to the same hiearchical subjects. 文章发布到相同的层次主题。
Search: A user has access to an article if the user has a role where ALL the user's subjects are in the articles published subjects. 搜索:如果用户具有所有用户主题都在文章发布主题中的角色,则该用户有权访问该文章。 Where a subject is a tree structure meaning that articles published higher up in a hierarchy matches users connected lower in the subject hierarchy.
其中主题是树形结构,意味着在层次结构中较高级别发布的文章与在主题层次结构中较低级别连接的用户匹配。
FOR role IN OUTBOUND "users/bob" has
//Here I want to define
//$count = how many outbound edges 'definedAs' from 'role'
FOR type IN OUTBOUND role definedAs
FOR supertype IN 0..100 INBOUND type validFor //Subject hiearchy
FOR article IN INBOUND supertype published
//Only include 'article' that have been visited >= $count
return article
Is this possible in ArangoDB? 在ArangoDB中这可能吗?
Answering my own question: 回答我自己的问题:
The solution is to visit each hieararchy separatly and the do an INTERSECTION between the two results. 解决方案是分别访问每个层次结构,然后在两个结果之间进行相交。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.