对于 (A)-[LinkedTo]->(B) 类型的模型<-[Knows]-(C) I'm looking how to get back all B's linked to A's, but not knowing C's. Can't use the 'where not exists' construction as this would require C's know B's. Also optional match does not seem to work. Any suggestions?
您可以使用几个路径模式表达式来测试是否存在/不存在至少一个与特定模式匹配的关系:
MATCH (b:B)
WHERE (:A)-[:LinkedTo]->(b) AND NOT (b)<-[:Knows]-(:C)
RETURN b