Last active
December 31, 2015 07:09
-
-
Save pwin/7952532 to your computer and use it in GitHub Desktop.
Utility Value by year, month and date ordered. Uses AFN functions
This file contains hidden or 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 xsd: <http://www.w3.org/2001/XMLSchema#> | |
| prefix gol: <http://cofog01.data.scotland.gov.uk/def/golspie/> | |
| prefix qb: <http://purl.org/linked-data/cube#> | |
| prefix buildingCode: <http://cofog01.data.scotland.gov.uk/id/facility/> | |
| prefix fn: <http://www.w3.org/2005/xpath-functions#> | |
| prefix util: <http://cofog01.data.scotland.gov.uk/def/golspie/> | |
| prefix skos: <http://www.w3.org/2004/02/skos/core#> | |
| PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#> | |
| select ?year ?month ?day (sum(?o) as ?val ) | |
| where { | |
| ?slice gol:refBuilding buildingCode:AB0001 ; | |
| gol:reportDateTime ?dt ; | |
| qb:sliceStructure gol:sliceByDay; | |
| qb:observation ?obs . | |
| ?obs gol:utilityConsumption ?o ; | |
| gol:refUtility util:electricity . | |
| filter (xsd:dateTime(?dt) >= '2011-06-11T00:00:00Z'^^xsd:dateTime && | |
| xsd:dateTime(?dt) < afn:now()) | |
| } | |
| group by (year(?dt) as ?year) (month(?dt) as ?month) (day(?dt) as ?day) ?obs | |
| order by ?year ?month ?day ?obs | |
| limit 20000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment