Skip to content

Instantly share code, notes, and snippets.

@albertmeronyo
Last active August 29, 2015 14:21
Show Gist options
  • Save albertmeronyo/f7c97f776ce9f229f371 to your computer and use it in GitHub Desktop.
Save albertmeronyo/f7c97f776ce9f229f371 to your computer and use it in GitHub Desktop.
# Number of accessed cells, sample query
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX cedar: <http://bit.ly/cedar#>
PREFIX sdmx-dimension: <http://purl.org/linked-data/sdmx/2009/dimension#>
PREFIX sdmx-code: <http://purl.org/linked-data/sdmx/2009/code#>
SELECT (COUNT(?obs) as ?nobs)
FROM <urn:graph:cedar-mini:release>
WHERE { ?obs a qb:Observation .
?obs cedar:population ?pop .
?obs sdmx-dimension:refArea ?municipality .
?obs cedar:houseType ?house .
?slice a qb:Slice.
?slice qb:observation ?obs.
?slice sdmx-dimension:refPeriod ?year .
FILTER (?year IN (1859, 1869, 1879, 1889, 1899, 1909, 1920)) .
FILTER (?house IN (<http://bit.ly/cedar#house-BewoondeHuizen>, <http://bit.ly/cedar#house-BewoondeSchepen>)) .
FILTER (NOT EXISTS {?obs cedar:isTotal ?total }) .
}
# Accessed original sheets, sample query
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX cedar: <http://bit.ly/cedar#>
PREFIX sdmx-dimension: <http://purl.org/linked-data/sdmx/2009/dimension#>
PREFIX sdmx-code: <http://purl.org/linked-data/sdmx/2009/code#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX tablink: <http://bit.ly/cedar-tablink#>
SELECT DISTINCT(?sheet)
FROM <urn:graph:cedar-mini:release>
FROM <urn:graph:cedar-mini:raw-data>
WHERE { ?obs a qb:Observation .
?obs cedar:population ?pop .
?obs sdmx-dimension:refArea ?municipality .
?obs cedar:houseType ?house .
?slice a qb:Slice.
?slice qb:observation ?obs.
?slice sdmx-dimension:refPeriod ?year .
?obs prov:wasDerivedFrom ?src .
?src tablink:sheet ?sheet .
FILTER (?year IN (1859, 1869, 1879, 1889, 1899, 1909, 1920)) .
FILTER (?house IN (<http://bit.ly/cedar#house-BewoondeHuizen>, <http://bit.ly/cedar#house-BewoondeSchepen>)) .
FILTER (NOT EXISTS {?obs cedar:isTotal ?total }) .
}
# Number of accessed sheets, sample query
PREFIX qb: <http://purl.org/linked-data/cube#>
PREFIX cedar: <http://bit.ly/cedar#>
PREFIX sdmx-dimension: <http://purl.org/linked-data/sdmx/2009/dimension#>
PREFIX sdmx-code: <http://purl.org/linked-data/sdmx/2009/code#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX tablink: <http://bit.ly/cedar-tablink#>
SELECT (COUNT(DISTINCT(?sheet) AS ?ntab))
FROM <urn:graph:cedar-mini:release>
FROM <urn:graph:cedar-mini:raw-data>
WHERE { ?obs a qb:Observation .
?obs cedar:population ?pop .
?obs sdmx-dimension:refArea ?municipality .
?obs cedar:houseType ?house .
?slice a qb:Slice.
?slice qb:observation ?obs.
?slice sdmx-dimension:refPeriod ?year .
?obs prov:wasDerivedFrom ?src .
?src tablink:sheet ?sheet .
FILTER (?year IN (1859, 1869, 1879, 1889, 1899, 1909, 1920)) .
FILTER (?house IN (<http://bit.ly/cedar#house-BewoondeHuizen>, <http://bit.ly/cedar#house-BewoondeSchepen>)) .
FILTER (NOT EXISTS {?obs cedar:isTotal ?total }) .
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment