SPARQL Help - Can't get the county for a school

Hi,I am attempting to query for all schools and their county. I cant see any easy way to get the county for a school with sparql because the address property of school doesnt have a county. I am therefore attempting to go via the administrative district to get the county.This query works ok:

 

prefix sch-ont:  <http://education.data.gov.uk/def/school/>

prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?school ?name ?districtAdministrative WHERE {

      ?school a sch-ont:School;

         sch-ont:establishmentName ?name;

         sch-ont:districtAdministrative ?districtAdministrative.

}

ORDER BY ?name

LIMIT 10

 

 

But the addition of the county gives me no results:

 

prefix sch-ont:  <http://education.data.gov.uk/def/school/>

prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?school ?name ?districtAdministrative ?county WHERE {

  ?school a sch-ont:School;

     sch-ont:establishmentName ?name;

     sch-ont:districtAdministrative ?districtAdministrative.

  ?districtAdministrative <http://statistics.data.gov.uk/def/administrative-geography/county> ?county.

}

ORDER BY ?name

LIMIT 10

 

If anyone could give me some pointers to why the second query doesnt return anything it would be much appreciated.

Hi,

It looks as though the data for the county information is behind a different SPARQL endpoint, http://services.data.gov.uk/statistics/sparql, so you'd have to join the data some other way.

I don't think the endpoints currently support the upcoming SERVICE method for basic federated queries (see http://www.w3.org/TR/sparql-features/#Basic_federated_query and http://www.snee.com/bobdc.blog/2010/01/federated-sparql-queries.html) and the www.sparql.org server seems to be down, so you may have to do the join manually, i.e. by getting back your list of ?districtAdministrative resources and iterating over them to create queries to the statistics SPARQL endpoint.

Cheers,Alex.