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