我需要你在 neo4j 项目中的帮助。我有两个节点作者和文章。它们之间的关系是
(author:Author)-[:WRITES]->(article:Article)
一篇文章可以由多个作者撰写。所以我想计算哪些是合作最多的前 5 位作者(与不同的作者)。另外,我想返回作者姓名和合作次数。我尝试了以下方法,但没有奏效。
MATCH (article:Article)<-[:WRITES]-(author:Author)
with article, collect(distinct author.name) as authors
RETURN authors,size(authors)-1 as numberofcollaborations
ORDER BY numberofcollaborations DESC
LIMIT 5;
有任何想法吗?