Sample queries
Wind directions on 2012-01-15
PREFIX ssn:<http://purl.oclc.org/NET/ssnx/ssn#>
PREFIX cf-property:<http://purl.oclc.org/NET/ssnx/cf/cf-property#>
PREFIX DUL:<http://www.loa-cnr.it/ontologies/DUL.owl#>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?time ?wind_dir
WHERE {
[] a ssn:Observation ;
ssn:observedProperty cf-property:wind_from_direction ;
ssn:observationResultTime [ time:hasBegin [ time:inXSDDateTime ?time ] ];
ssn:observationResult [ ssn:hasValue [ DUL:hasDataValue ?wind_dir ] ]
FILTER (?time >= xsd:dateTime("2012-01-15T00:00:00+01:00") &&
?time < xsd:dateTime("2012-01-16T00:00:00+01:00"))
} ORDER BY ?time
PREFIX cf-property:<http://purl.oclc.org/NET/ssnx/cf/cf-property#>
PREFIX DUL:<http://www.loa-cnr.it/ontologies/DUL.owl#>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?time ?wind_dir
WHERE {
[] a ssn:Observation ;
ssn:observedProperty cf-property:wind_from_direction ;
ssn:observationResultTime [ time:hasBegin [ time:inXSDDateTime ?time ] ];
ssn:observationResult [ ssn:hasValue [ DUL:hasDataValue ?wind_dir ] ]
FILTER (?time >= xsd:dateTime("2012-01-15T00:00:00+01:00") &&
?time < xsd:dateTime("2012-01-16T00:00:00+01:00"))
} ORDER BY ?time
Average temperature per year
Note : 2010 is an incomplete year as the weather station began its measures in april
PREFIX ssn: <http://purl.oclc.org/NET/ssnx/ssn#>
PREFIX cf-property: <http://purl.oclc.org/NET/ssnx/cf/cf-property#>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX DUL: <http://www.loa-cnr.it/ontologies/DUL.owl#>
SELECT ?yr (AVG(?temp) AS ?average_temperature)
WHERE {
[] a ssn:Observation ;
ssn:observedProperty cf-property:air_temperature ;
ssn:observationResultTime [ time:inDateTime [ time:YEAR ?yr ] ] ;
ssn:observationResult [ ssn:hasValue [ DUL:hasDataValue ?temp ] ]
}
GROUP BY ?yr
ORDER BY ?yr
PREFIX cf-property: <http://purl.oclc.org/NET/ssnx/cf/cf-property#>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX DUL: <http://www.loa-cnr.it/ontologies/DUL.owl#>
SELECT ?yr (AVG(?temp) AS ?average_temperature)
WHERE {
[] a ssn:Observation ;
ssn:observedProperty cf-property:air_temperature ;
ssn:observationResultTime [ time:inDateTime [ time:YEAR ?yr ] ] ;
ssn:observationResult [ ssn:hasValue [ DUL:hasDataValue ?temp ] ]
}
GROUP BY ?yr
ORDER BY ?yr
Solar energy flux per month (kW.h/m²)
PREFIX ssn: <http://purl.oclc.org/NET/ssnx/ssn#>
PREFIX cf-property: <http://purl.oclc.org/NET/ssnx/cf/cf-property#>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX DUL: <http://www.loa-cnr.it/ontologies/DUL.owl#>
SELECT ?yr ?mnth (SUM(?value * ?inter / 60000) AS ?total_flux)
WHERE {
[] a ssn:Observation ;
ssn:observedProperty cf-property:downward_heat_flux_at_ground_level_in_soil ;
ssn:observationResult [ ssn:hasValue [ DUL:hasDataValue ?value ] ] ;
ssn:observationResultTime [
time:hasEnd [
time:inDateTime [
time:YEAR ?yr ;
time:MONTH ?mnth ] ] ;
time:hasDurationDescription [ time:MINUTES ?inter ] ]
} GROUP BY ?yr ?mnth
ORDER BY ?yr ?mnth
PREFIX cf-property: <http://purl.oclc.org/NET/ssnx/cf/cf-property#>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX DUL: <http://www.loa-cnr.it/ontologies/DUL.owl#>
SELECT ?yr ?mnth (SUM(?value * ?inter / 60000) AS ?total_flux)
WHERE {
[] a ssn:Observation ;
ssn:observedProperty cf-property:downward_heat_flux_at_ground_level_in_soil ;
ssn:observationResult [ ssn:hasValue [ DUL:hasDataValue ?value ] ] ;
ssn:observationResultTime [
time:hasEnd [
time:inDateTime [
time:YEAR ?yr ;
time:MONTH ?mnth ] ] ;
time:hasDurationDescription [ time:MINUTES ?inter ] ]
} GROUP BY ?yr ?mnth
ORDER BY ?yr ?mnth