From 143080e10eabdf003875a5cbfc1b463dff0c20f3 Mon Sep 17 00:00:00 2001 From: Thomas Eidens Date: Thu, 15 Jun 2023 11:14:50 +0200 Subject: [PATCH] Fixed query to only feature latest version of article --- neoflask/queries.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/neoflask/queries.py b/neoflask/queries.py index 90cd4fe6..58c9ef13 100644 --- a/neoflask/queries.py +++ b/neoflask/queries.py @@ -55,11 +55,13 @@ class REFEREED_PREPRINTS(Query): MATCH (revservice)-[:HasPaper]->(vizpaper:VizPaper) WITH vizpaper.doi AS doi MATCH (a:Article {doi: doi}) -WITH a WHERE ( toLower(apoc.convert.toString(a.published_journal_title)) = toLower($published_in) ) OR ($published_in = '') +WITH a +ORDER BY a.version DESC +WITH a.doi AS doi, COLLECT(a)[0] AS a WITH DISTINCT id(a) AS id, a.publication_date AS pub_date,