只有 Cypher return 个节点,其中连接的节点不包含 属性 上的子字符串

Cypher only return nodes where connected nodes don't contain a substring on a property

我不太明白 Cypher 中某些内容的语法。我只想 return 论文 none 作者在某个地方工作。

像这样

MATCH (p:Paper)<-[:AUTHOR_OF]-(authors)
WHERE NOT (p)<-[:AUTHOR_OF]-(authors).institute CONTAINS "SomeInstituteName"
RETURN p, authors

不幸的是,这会引发错误。

我也试过这个:

MATCH (p:Paper)<-[:AUTHOR_OF]-(authors)
WHERE NOT authors.institute CONTAINS "SomeInstituteName"
RETURN p, authors

这也不起作用,因为它只是 return 所有论文并过滤掉在某个研究所工作的作者。我只想要 return 篇连一位作者都没有在 'SomeInstituteName'

工作的论文

试试这个

MATCH (p:Paper)<-[:AUTHOR_OF]-(a:Author)
WITH p, collect(a) AS authors
WHERE NONE(x IN authors WHERE x.institute CONTAINS "SomeInstituteName")
RETURN p, authors