Skip to content

Instantly share code, notes, and snippets.

@michimau
Created June 8, 2022 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michimau/5323ed4cff774bc30c9b89cd3955ca73 to your computer and use it in GitHub Desktop.
Save michimau/5323ed4cff774bc30c9b89cd3955ca73 to your computer and use it in GitHub Desktop.
datahub sparql
PREFIX DataFileLink: <http://www.eea.europa.eu/portal_types/DataFileLink#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX data: <http://www.eea.europa.eu/portal_types/Data#>
SELECT
?data
?id
?remoteUrl
min(xsd:integer(?temporalCoverage)) AS ?minYear
max(xsd:integer(?temporalCoverage)) AS ?maxYear
WHERE {
?DataFileLink a DataFileLink:DataFileLink .
?DataFileLink dcterms:title ?title .
?DataFileLink DataFileLink:remoteUrl ?remoteUrl .
?dataTable dcterms:hasPart ?DataFileLink .
?data dcterms:hasPart ?dataTable .
?data data:id ?id .
?data data:temporalCoverage ?temporalCoverage .
FILTER NOT EXISTS { ?data dcterms:isReplacedBy ?isReplacedBy }
FILTER(strEnds(str(?remoteUrl), "download"))
}
ORDER BY ?id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment