Although the focus here is on using Wikidata to visualise / understand aspects of the historical cultural environment in Scotland, this also leads into side-exploration of other data /visualisations based on present-day data. The first of these was the OpenStreetMap + Sophox mapping discussed in a previous post.
The second involves the data published by the Scottish Government. Coming from the relative simplicity of Wikidata, this seems tough. The available descriptions and examples are not easy to adapt for the novice user.
At a basic level though, querying is ok, for example getting a list of Councils from the SPARQL query box:
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
SELECT ?council ?councilName WHERE {
?council http://publishmydata.com/def/ontology/foi/memberOf http://statistics.gov.scot/def/foi/collection/council-areas .
?council rdfs:label ?councilName.
} LIMIT 40 or listing the granular zones at which many statistics are captured:
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
SELECT ?weearea ?weeareaName WHERE {
?weearea http://publishmydata.com/def/ontology/foi/memberOf http://statistics.gov.scot/def/foi/collection/data-zones-2011 .
?weearea rdfs:label ?weeareaName.
}
LIMIT 2000
Trying to obtain substantial data becomes more awkward. Here is one example that does return data:
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
PREFIX stat: http://statistics.data.gov.uk/def/statistical-entity#
PREFIX skos: http://www.w3.org/2004/02/skos/core#
PREFIX qb: http://purl.org/linked-data/cube#
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/
SELECT ?areacode ?areaname ?indicatorlabel ?value
WHERE {
{?indicator qb:dataSet data:alcohol-related-hospital-statistics ;
mp:ratio ?value ;
sdmxd:refPeriod http://reference.data.gov.uk/id/government-year/2012-2013 .
data:alcohol-related-hospital-statistics rdfs:label ?indicatorlabel}.
?indicator sdmxd:refArea ?area ;
sdmxd:refPeriod ?year .
?year rdfs:label ?yearname .
?area stat:code http://statistics.gov.scot/id/statistical-entity/S12 ;
rdfs:label ?areaname ;
skos:notation ?areacode
} ORDER BY ?areaname LIMIT 50
The query returns various broadly-labelled items of granular data, but next steps are not clear.