问题
I am writing a code to extract the following data with SPARQL: POSTCODE, LSOA, and IMD (Index of Multiple Deprivation).
I managed to get close to this using two different calls but the approach isn't really what I am looking for because it requires additional matching in R.
The first call is described in another stackoverflow question:
SELECT *
WHERE {
?postcodeUnit a <http://data.ordnancesurvey.co.uk/ontology/postcode/PostcodeUnit>;
<http://opendatacommunities.org/def/geography#lsoa> ?lsoa .
} LIMIT 10
The second one is of my own attempt (I am a beginner user). It gets to call LSOA and IMD (although the labels are not human-readable, I guess there's no label)
SELECT *
WHERE {
?obs <http://opendatacommunities.org/def/ontology/communities/societal_wellbeing/imd/indices>
<http://opendatacommunities.org/def/concept/general-concepts/imd/combineddeprivation>.
?obs <http://opendatacommunities.org/def/ontology/geography/refArea> ?areauri .
?obs <http://opendatacommunities.org/def/ontology/time/refPeriod> ?perioduri .
?obs <http://opendatacommunities.org/def/ontology/communities/societal_wellbeing/imd/decObs> ?value .
} LIMIT 10
I could solve this issue to simply load these datasets into R and then match the postcodes, LSOA, and IMD there; however, I was wondering if it is possible to do it in one call.
Thanks for any help or clarification if what I am trying to do is possible.
来源:https://stackoverflow.com/questions/50396898/extracting-postcodes-lsoa-codes-and-imd-sparql