Created
April 8, 2011 19:32
-
-
Save JeniT/910558 to your computer and use it in GitHub Desktop.
These SPARQL queries can be run on http://services.data.gov.uk/reference/sparql. The first gets a list of public bodies in the triplestore (which includes all departments but not all public bodies). The second gets a list of units and the public body that
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX gov: <http://reference.data.gov.uk/def/central-government/> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
SELECT DISTINCT ?body ?label | |
WHERE { | |
{ ?body a gov:PublicBody . } | |
UNION | |
{ ?body a gov:Department . } | |
?body rdfs:label ?label . | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX gov: <http://reference.data.gov.uk/def/central-government/> | |
PREFIX org: <http://www.w3.org/ns/org#> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
SELECT DISTINCT ?unit ?label ?body | |
WHERE { | |
?unit org:unitOf ?body . | |
?unit rdfs:label ?label . | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Figured it out, I needed to add a foaf PREFIX to top of query: