From 27dc07a2de77a858854aaacb915b6b6a7766d318 Mon Sep 17 00:00:00 2001 From: Kirill Yankov Date: Fri, 3 May 2024 19:49:53 +0200 Subject: [PATCH] Docs, SPARQL download links of latest version --- docs/usage/quickstart-examples.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/usage/quickstart-examples.md b/docs/usage/quickstart-examples.md index eb885e6..7f4dab4 100644 --- a/docs/usage/quickstart-examples.md +++ b/docs/usage/quickstart-examples.md @@ -211,6 +211,30 @@ SELECT DISTINCT ?distribution, ?file, ?downloadUrl, ?format, ?byteSize WHERE { } ``` +Retrieving download links for the latest version of an artifact: +```sparql +PREFIX dcat: +PREFIX databus: +PREFIX dct: + + +SELECT ?file WHERE +{ + { + SELECT ?v WHERE + { + ?latestVersion databus:artifact . + ?latestVersion dct:hasVersion ?v . + } + ORDER BY DESC(STR(?v)) LIMIT 1 + } + ?dataset dct:hasVersion ?v . + ?dataset dcat:distribution ?distribution . + ?distribution dcat:downloadURL ?file . + +} +``` + #### Group/Artifact Metadata Example In the minimal example metadata for the group is missing and the artifact is initialized with the metadata of the dataset. Both can be explicitly set for better documentation: