1
刪除子我有以下圖表 graph layout暗號 - 從結果
正如你可以看到,圖中的下列關係:
(u::4)-[ADDED_RESOURCE]->(:resource)<-[ADDED_RESOURCE]-(u::3) \\ u::4, u::3 are the ids of the nodes
。(u::4)-[UNLINK]->(u::3)
我使用APOC遍歷像這樣的圖形:
MATCH (u:user {id:"u::1"}
CALL apoc.path.expandConfig(u,{minLevel:1,maxLevel:6,bfs:true,uniqueness:"NODE_PATH",labelFilter:">resource"}) YIELD path
with u, path, filter(n in nodes(path) where n:resource) as resources
unwind resources as resource
MATCH (rus:user)-[]->(resource)
RETURN distinct rus.id
這將返回所有通過它的相關資源,以節點u::1
相關u::X
節點。
因爲u::4
和u::3
是取消鏈接,我想遍歷忽略該連接,並不會返回與u::3
有關的子圖。因此,而不是返回u::4, u::3, u::2, u::5
,它應該只返回u::4
。
有沒有辦法告訴APOC在遍歷時忽略它們之間有一定關係的節點?
謝謝,但如果我想同時維護'UNLINK'和'ADDED_RESOURCE'鏈接,我會遇到問題。無論「UNLINK」關係如何,它仍會返回所有連接的用戶。 –