I had set today aside to work with you on Kasabi, but some urgent work
has landed on my desk which needs attention *right now*. Always the
way, isn't it, so I'm confining my kasabi to my lunch break.
What I had intended to do today was look at the NHS performance data set.
http://kasabi.com/dataset/nhs-performance-data/apis/36z
What I want to achieve are maps of gps, dentists, etc by local authority.
e.g. Dentists in the London Borough of Lambeth.
This works:
PREFIX nhs: <http://data.kasabi.com/dataset/nhs-organization/def/>
PREFIX org: <http://www.w3.org/ns/org#>
PREFIX os: <http://data.ordnancesurvey.co.uk/ontology/postcode/>
SELECT
  ?org
  ?postcode
  ?siteAddress
  WHERE {
    #?org a nhs:GeneralPractice;
    ?org a nhs:DentalPractice;
       org:hasSite ?site. #;
       #org:siteAddress ?siteAddress.
?site os:postcode ?postcode.
   # London Borough of Lambeth
   ?postcode os:district <http://data.ordnancesurvey.co.uk/id/7000000000011144>
}
LIMIT 100
... but it doesn't work any more if I uncomment siteAddress - I can't
seem to get to the vCard information for the dental surgery.
I need this for the name of the surgery.
I hope this makes some sense.
Any tips?
Michael
Sparql Query:
http://kasabi.com/dataset/nhs-performance-data/apis/4bv/config
PREFIX nhs: <http://data.kasabi.com/dataset/nhs-organization/def/>
PREFIX org: <http://www.w3.org/ns/org#>
PREFIX os: <http://data.ordnancesurvey.co.uk/ontology/postcode/>
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
PREFIX rdf-schema: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
SELECT
  ?org
  ?postcode
  ?adr
  ?name
  ?lat
  ?long
  WHERE {
    #?org a nhs:GeneralPractice;
    ?org a nhs:DentalPractice;
       org:hasSite ?site.
   ?site os:postcode ?postcode;
         org:siteAddress ?siteAddress.
?siteAddress vcard:adr ?adr.
?adr rdf-schema:label ?name.
   ?postcode geo:lat ?lat;
             geo:long ?long;
             # London Borough of Lambeth
             os:district <http://data.ordnancesurvey.co.uk/id/7000000000011144>.
}
LIMIT 100