Advertisement
open_data_sheffield

All N02 readings for all sensors over a given time period

Jun 10th, 2015
3,236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SPARQL 0.87 KB | None | 0 0
  1. SELECT ?sensor, MAX(?DAY), MAX(?hour), AVG(?observationValue), MAX(?observationValue), MIN(?observationValue)
  2. WHERE {
  3.   GRAPH ?g {
  4.     ?s <uri://opensheffield.org/properties#sensor> ?sensor .
  5.     ?s a <http://purl.oclc.org/NET/ssnx/ssn#ObservationValue> .
  6.     ?s <http://purl.oclc.org/NET/ssnx/ssn#endTime> ?observationTime.
  7.     ?s <http://purl.oclc.org/NET/ssnx/ssn#hasValue> ?observationValue .
  8.     ?sensor <http://purl.oclc.org/NET/ssnx/ssn#MeasurementProperty> <http://dbpedia.org/resource/NO2>     .
  9.     BIND (bif:subseq( STR( ?observationTime ),0,11) AS ?DAY) .
  10.     BIND (bif:subseq( STR( ?observationTime ),11,13) AS ?hour) .
  11.     BIND (bif:subseq( STR( ?observationTime ),0,13) AS ?dayhour) .
  12.     FILTER ( xsd:date(?observationTime) > xsd:date("2014-10-13") && xsd:date(?observationTime) <= xsd:date("2014-11-13") )
  13.   }
  14. }
  15. GROUP BY ?sensor ?dayhour
  16. ORDER BY ?dayhour ?sensor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement