Skip to content
Eugene Siow edited this page Sep 8, 2017 · 4 revisions

These queries are adapted from SRBench.

Q1 Get the rainfall observed once in an hour.

PREFIX om-owl: <http://knoesis.wright.edu/ssw/ont/sensor-observation.owl#>
PREFIX weather: <http://knoesis.wright.edu/ssw/ont/weather.owl#>
PREFIX owl-time: <http://www.w3.org/2006/time#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?sensor ?value ?uom
FROM NAMED STREAM <http://www.cwi.nl/SRBench/observations> [RANGE 1h STEP]
WHERE {
  ?observation om-owl:procedure ?sensor ;
               a weather:RainfallObservation ;
               om-owl:result ?result.
  ?result om-owl:floatValue ?value ;
          om-owl:uom ?uom .
}

RSP-QL syntax

PREFIX om-owl: <http://knoesis.wright.edu/ssw/ont/sensor-observation.owl#>
PREFIX weather: <http://knoesis.wright.edu/ssw/ont/weather.owl#>
PREFIX owl-time: <http://www.w3.org/2006/time#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX : <http://www.cwi.nl/SRBench/streams>

SELECT DISTINCT ?sensor ?value ?uom
FROM NAMED WINDOW :win ON <http://www.cwi.nl/SRBench/observations> [RANGE 1h]
WHERE {
	WINDOW :win {
	  ?observation om-owl:procedure ?sensor ;
	               a weather:RainfallObservation ;
	               om-owl:result ?result.
	  ?result om-owl:floatValue ?value ;
	          om-owl:uom ?uom .
	}
}

S2S EPL translation

SELECT
    DISTINCT 'http://knoesis.wright.edu/ssw/System_{STATION_NAME}' AS sensor ,
    _{STATION_NAME}.Precipitation AS value ,
    'http://knoesis.wright.edu/ssw/ont/weather.owl#centimeters' AS uom 
FROM
    _{STATION_NAME}.win:time(1 hour)