diff --git a/cross-year-totals.rq b/cross-year-totals.rq new file mode 100644 index 0000000..f397d14 --- /dev/null +++ b/cross-year-totals.rq @@ -0,0 +1,24 @@ +# Totals per municipality, cross year + +PREFIX qb: +PREFIX cedar: +PREFIX sdmx-dimension: +PREFIX sdmx-code: + +SELECT ?municipality ?year (SUM(?pop) AS ?tot) +FROM +WHERE { ?obs a qb:Observation . + ?obs cedar:population ?pop . + ?obs sdmx-dimension:sex sdmx-code:sex-M . + ?obs sdmx-dimension:refArea ?municipality . + ?obs cedar:residenceStatus . + ?slice a qb:Slice. + ?slice qb:observation ?obs. + ?slice sdmx-dimension:refPeriod ?year . + FILTER (NOT EXISTS {?obs cedar:houseType ?house }) . + FILTER (NOT EXISTS {?obs cedar:isTotal ?total }) . + FILTER (?year IN (1879, 1889)) . + FILTER (regex(?obs, "VT_1879_01_H1-S0|VT_1889_03_H1-S0", "i")) . +} GROUP BY ?municipality ?year + +