Skip to content

Instantly share code, notes, and snippets.

@albertmeronyo
Created May 12, 2015 12:02
Show Gist options
  • Save albertmeronyo/b3db3bbde38cc259f234 to your computer and use it in GitHub Desktop.
Save albertmeronyo/b3db3bbde38cc259f234 to your computer and use it in GitHub Desktop.
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 oa: <http://www.w3.org/ns/openannotation/core/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX tablink: <http://bit.ly/cedar-tablink#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX cedar-data: <http://lod.cedar-project.nl:8888/cedar/resource/>
PREFIX amco: <http://www.gemeentegeschiedenis.nl/amco/>
SELECT DISTINCT ?dim_a ?label_a
FROM <urn:graph:cedar-mini:raw-data>
FROM <urn:graph:cedar-mini:rules>
WHERE {
?cell tablink:dimension ?dim_a .
?cell tablink:dimension ?dim_b .
?dim_a tablink:value ?label_a .
?dim_b tablink:value ?label_b .
?ann_a a oa:Annotation .
?ann_a oa:hasTarget ?dim_a .
?ann_a oa:hasBody ?body_a .
?body_a sdmx-dimension:refArea ?city_a .
?ann_b a oa:Annotation .
?ann_b oa:hasTarget ?dim_b .
?ann_b oa:hasBody ?body_b .
?body_b sdmx-dimension:refArea ?city_b .
FILTER (?dim_a != ?dim_b)
FILTER ((?city_a = amco:11170 AND ?city_b != amco:11170) OR (?city_a != amco:11170 AND ?city_b = amco:11170))
FILTER ((regex(?label_a, "^huizen", "i")))
} ORDER BY ?dim_a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment