Hello,
I did all kinds of reading the docs on cypher, and I still cannot figure this one out.. Any help would be greatly appreciated.
I originally created this query using graphql, but I am moving away from graphql, and now trying to do it in raw cypher.
The database is actually neo4j version 4.4..
(c:classification) <- [:IN_CLASSIFICATION] - (a:article) - [:IN_TOPIC] -> (t:topic)
the classification classifies the articles by news type (top stories, financial, political etc)
and all articles from multiple sources that are talking about the same story are grouped together by topic
so, for example, let's say top news of the day -- there are 23 articles talking about the same story so all articles would be grouped together with a groupnumber -- say 0 -- but within that group number 23 different articles would be linked by to the same groupnumber
So I want to be able to query the database for "top" news, and it returns all the groups that are classified as "top" news, the total number of articles in each group, and then I want the title of the first article in each group..
e.q:
------------------------------------------------------------------------------------------__
group | articles | title
0 23 "this is the first article title in group 0"
1 14 "this is the first article title in group 1"
2 7 "this is the first article title in group 2"
.
.
.
.
I've been able to get it to give me a list of all groups, and then the count for each group's articles, but whenever I try to get the first article in each group's title is where I'm stuck..
thanks in advance for any advice you can give me,
- Andre