简体   繁体   中英

neo4j cypher how to find the most frequent pattern of nodes in a chain of word-nodes

I have a GraphDB with Texts as a chain of word-nodes.

a small Test-Query looks like this:

MATCH p=(n1:Token)-[:NEXT_TOKEN]->(n2:Token)-[:NEXT_TOKEN]->(n3:Token)  
WHERE n1.text = 'von'
AND n2.text = 'den'
RETURN n1.text, n2.text, n3.text, 
count(p) AS n3Anzahl ORDER BY n3Anzahl DESC;

What i need is a list of the 3-Word-Chains with the most frequent on top.

Any ideas would be helpfull.

来自Falcon:好的,因此删除WHERE子句,查询应该可以正常工作

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM