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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -