Cypher 查询样本

统计与特定人物相关的文章

MATCH (n)-[]->(l) 
where l.name='Donald Trump'
RETURN n.date,count(*) order by n.date

搜索与特朗普相同的新闻文章连接的其他人/位置,至少有 5 个关系节点。

MATCH (n:NewsArticle)-[]->(l)
where l.name='Donald Trump'
MATCH (n:NewsArticle)-[]->(m)
with m,count(n) as num where num>5
return labels(m)[0],(m.name), num order by num desc limit 10