Skip to content

Instantly share code, notes, and snippets.

@ricroberts
Created September 28, 2011 20:04
Show Gist options
  • Save ricroberts/1249100 to your computer and use it in GitHub Desktop.
Save ricroberts/1249100 to your computer and use it in GitHub Desktop.
SPARQL query for LSOA data
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?lsoa ?notation ?label ?lat ?long ?score
WHERE {
GRAPH <http://opendatacommunities.org/id/graph/geography/lsoa> {
?lsoa a <http://opendatacommunities.org/def/geography#LSOA> .
?lsoa geo:lat ?lat .
?lsoa geo:long ?long .
?lsoa <http://www.w3.org/2004/02/skos/core#notation> ?notation .
?lsoa rdfs:label ?label .
}
GRAPH <http://opendatacommunities.org/id/graph/IMD/2010/IMD-score> {
?obs <http://purl.org/linked-data/sdmx/2009/dimension#refArea> ?lsoa .
?obs <http://opendatacommunities.org/def/IMD#IMD-score> ?score .
}
FILTER ( ?lat >= 53.4 && ?lat < 53.5 &&
?long >= -2.3 && ?long < -2.2 ) .
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment