Skip to content

Instantly share code, notes, and snippets.

@northernjamie
Created December 12, 2017 11:06
Show Gist options
  • Save northernjamie/f874261b2e8ea7d9b8dc2d723cdbf758 to your computer and use it in GitHub Desktop.
Save northernjamie/f874261b2e8ea7d9b8dc2d723cdbf758 to your computer and use it in GitHub Desktop.
SPARQL query that powers the Google Chart demo with two series of data from OpenDataCommunities - rough sleepers in Brighton and Manchester
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?periodlabel ?countb ?countm
WHERE {
?obsm <http://purl.org/linked-data/cube#dataSet> <http://opendatacommunities.org/data/homelessness/rough-sleeping/count> ;
<http://opendatacommunities.org/def/ontology/geography/refArea> <http://opendatacommunities.org/id/geography/administration/md/E08000003> ;
<http://opendatacommunities.org/def/ontology/time/refPeriod> ?perioduri ;
<http://opendatacommunities.org/def/ontology/homelessness/roughSleepingObs> ?countm .
<http://opendatacommunities.org/id/geography/administration/md/E08000003> rdfs:label ?aream .
?obsb <http://purl.org/linked-data/cube#dataSet> <http://opendatacommunities.org/data/homelessness/rough-sleeping/count> ;
<http://opendatacommunities.org/def/ontology/geography/refArea> <http://opendatacommunities.org/id/geography/administration/ua/E06000043> ;
<http://opendatacommunities.org/def/ontology/time/refPeriod> ?perioduri ;
<http://opendatacommunities.org/def/ontology/homelessness/roughSleepingObs> ?countb .
<http://opendatacommunities.org/id/geography/administration/ua/E06000043> rdfs:label ?areab .
?perioduri rdfs:label ?periodlabel .
}
ORDER BY ?periodlabel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment