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”关系如何,它仍会返回所有连接的用户。 –