From a67fefcf0f20ce5277f72417d63893a036ddd4eb Mon Sep 17 00:00:00 2001 From: Wolfgang Fahl Date: Sun, 9 Jun 2024 15:06:25 -0600 Subject: [PATCH] adds wikidata sync query --- ceurws/resources/queries/ceurws.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ceurws/resources/queries/ceurws.yaml b/ceurws/resources/queries/ceurws.yaml index aef416e..e3da393 100644 --- a/ceurws/resources/queries/ceurws.yaml +++ b/ceurws/resources/queries/ceurws.yaml @@ -125,3 +125,20 @@ where acronymlen < 20 group by acronymlen order by 2 desc +'WikidataSync': + sql: | + -- Volumes in Proceedings not in Volumes (no title, so we don't include these) + SELECT p.sVolume AS VolumeNumber, NULL AS Title, NULL AS Valid, + strftime('%Y-%m-%d', datetime(p.publication_date / 1000000, 'unixepoch')) AS PublicationDate + FROM Proceedings p + LEFT JOIN volumes v ON p.sVolume = v.number + WHERE v.number IS NULL + + UNION + + -- Volumes in Volumes not in Proceedings (include title, valid flag, and publication date only when title is not NULL) + SELECT v.number AS VolumeNumber, v.title AS Title, v.valid AS Valid, + strftime('%Y-%m-%d', datetime(v.pubDate / 1000000, 'unixepoch')) AS PublicationDate + FROM volumes v + LEFT JOIN Proceedings p ON v.number = p.sVolume + WHERE p.sVolume IS NULL AND v.title IS NOT NULL;