cypher - Query needed for neo4j -


hey guys needed in framing query in neo4j.

rank artists (music artists) unique number of listening users, display top 5.

thanks

graph this:

(user)-[:listens_to{weight:1212}]->(artists), (user)-[:tags]->(artists), (user)-[:friends_with]->(friend) 

query think might work :

match (m : user) - [l : listnto ] - > : aryist return count (distinct (m ) )as listncount , a.name order lostencount desc limit {5} 

created small graph sample here: http://console.neo4j.org/r/ujhh0x

the query

match (u:user)-[:listens_to]->(a:artist) return a.name,count(distinct u) count order count desc limit 5 

returns artists ordered number of unique listeners.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -