Skip to content

Instantly share code, notes, and snippets.

@northernjamie
Last active November 20, 2016 10:48
Show Gist options
  • Save northernjamie/e0f22652541602407697c5a464d8e39f to your computer and use it in GitHub Desktop.
Save northernjamie/e0f22652541602407697c5a464d8e39f to your computer and use it in GitHub Desktop.
SPARQL Scottish Datastore Drug Related Discharge
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sdmx: <http://purl.org/linked-data/sdmx/2009/concept#>
PREFIX data: <http://statistics.gov.scot/data/>
PREFIX sdmxd: <http://purl.org/linked-data/sdmx/2009/dimension#>
PREFIX mp: <http://statistics.gov.scot/def/measure-properties/>
PREFIX stat: <http://statistics.data.gov.uk/def/statistical-entity#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?areacode ?areaname ?nratiodrug ?yearname
WHERE {
?indicator qb:dataSet data:drug-related-discharge ;
sdmxd:refArea ?area ;
sdmxd:refPeriod <http://reference.data.gov.uk/id/government-year/2012-2013> ;
mp:ratio ?nratiodrug .
<http://reference.data.gov.uk/id/government-year/2012-2013> rdfs:label ?yearname .
?area stat:code <http://statistics.gov.scot/id/statistical-entity/S12> ;
rdfs:label ?areaname ;
skos:notation ?areacode .
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment