Extracting postcodes, LSOA codes and IMD - SPARQL

余生颓废 提交于 2019-12-13 20:17:13

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!