Google Doc: https://docs.google.com/document/d/15YcQOQBwhOLEZfFe4r4aGcLs0B2MxRmHVwYz1lVp0uo/edit#
PREFIX schema: <http://schema.org/>
PREFIX geosparql: <http://www.opengis.net/ont/geosparql#>
PREFIX geofunc: http://www.opengis.net/def/function/geosparql/
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns##>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sf: <http://www.opengis.net/ont/sf#>
PREFIX ufokn: <http://schema.ufokn.org/core/v1/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
Given: A real-time WGS84 coordinate ({?lat} {?lon}), and a radius of {?x} kilometers, any forecasted flooding?
Query:
SELECT DISTINCT ?forecast
WHERE {
?forecast a ufokn:RiskPointDepthForecast .
?forecast ufokn:isInundated "true"^^xsd:boolean .
?forecast prov:used [ ufokn:fromForecast ?f ] .
?f ufokn:forecastTime ?forDateTime .
FILTER (?forDateTime > "{now in ISO datetime format}"^^xsd:dateTime)
?forecast ufokn:atRiskPoint ?rp .
?rp geosparql:hasGeometry ?sf .
?sf geofunc:nearby ("Point({?lon} {?lat} )"^^geosparql:wktLiteral {?x} unit:Kilometer) .
}
LIMIT 1
2. Is my home at 9219 Oak Knoll Ln, Houston, TX 77078 in danger of being flooded during the approaching weather system?
_Given: FeatureAtRisk https://id.ufokn.org/feature-at-risk/9219-Oak-Knoll-Ln_Houston_TX-77078
Query:
SELECT DISTINCT ?forecast
WHERE {
?forecast a ufokn:RiskPointDepthForecast .
?forecast ufokn:isInundated "true"^^xsd:boolean .
?forecast prov:used [ ufokn:fromForecast ?f ] .
?f ufokn:forecastTime ?forDateTime .
FILTER (?forDateTime > "{?now in ISO datetime format}"^^xsd:dateTime)
?forecast ufokn:atRiskPoint ?rp .
?feature ufokn:impactedByRiskPoint ?rp .
BIND (<https://id.ufokn.org/feature-at-risk/9219-Oak-Knoll-Ln_Houston_TX-77078> as ?feature)
}
LIMIT 1
Given: Nervous Norman's home (https://id.ufokn.org/feature-at-risk/9219-Oak-Knoll-Ln_Houston_TX-77078) and a current datetime {?now}.
Query:
SELECT DISTINCT ?forDateTime
WHERE {
?forecast a ufokn:RiskPointDepthForecast .
?forecast ufokn:isInundated "true"^^xsd:boolean .
?forecast prov:used [ ufokn:fromForecast ?f ] .
?f ufokn:forecastTime ?forDateTime .
FILTER (?forDateTime > "{?now in ISO datetime format}"^^xsd:dateTime)
?forecast ufokn:atRiskPoint ?rp .
?feature ufokn:impactedByRiskPoint ?rp .
BIND (<https://id.ufokn.org/feature-at-risk/9219-Oak-Knoll-Ln_Houston_TX-77078> as ?feature)
}
ORDER BY DESC(?forDateTime)
LIMIT 1
Given: minimum depth determined as a damage threshold (@see ufokn:FLOODLEVEL_Flooded??) Query:
SELECT DISTINCT ?forecast
WHERE {
?forecast a ufokn:RiskPointDepthForecast .
?forecast ufokn:isInundated "true"^^xsd:boolean .
?forecast ufokn:forecastDepth ?forecastedDepthAtRiskPoint .
FILTER (?forecastedDepthAtRiskPoint > "{?threshold}"^^xsd:float)
?forecast prov:used [ ufokn:fromForecast ?f ] .
?f ufokn:forecastTime ?forDateTime .
FILTER (?forDateTime > "{?now in ISO datetime format}"^^xsd:dateTime)
?forecast ufokn:atRiskPoint ?rp .
?feature ufokn:impactedByRiskPoint ?rp .
BIND (<https://id.ufokn.org/feature-at-risk/9219-Oak-Knoll-Ln_Houston_TX-77078> as ?feature)
}
LIMIT 1
Given: some level of flooding type indicating evacuation needed {?lvl} (@see ufokn:FloodLevelMessage_MajorFlooding)
SELECT DISTINCT ?forecast
WHERE {
?forecast a ufokn:RiskPointDepthForecast .
?forecast ufokn:isInundated "true"^^xsd:boolean .
?forecast ufokn:floodLevelMessage ?msg .
?msg a {?lvl} .
?forecast prov:used [ ufokn:fromForecast ?f ] .
?f ufokn:forecastTime ?forDateTime .
FILTER (?forDateTime > "{?now in ISO datetime format}"^^xsd:dateTime)
?forecast ufokn:atRiskPoint ?rp .
?feature ufokn:impactedByRiskPoint ?rp .
BIND (<https://id.ufokn.org/feature-at-risk/9219-Oak-Knoll-Ln_Houston_TX-77078> as ?feature)
}
LIMIT 1
Given: {?south} {?west} {?north} {?east} coordinates of a bounding box
Query:
SELECT DISTINCT ?forecast
WHERE {
?forecast a ufokn:RiskPointDepthForecast .
?forecast ufokn:isInundated "true"^^xsd:boolean .
?forecast prov:used [ ufokn:fromForecast ?f ] .
?f ufokn:forecastTime ?forDateTime .
FILTER (?forDateTime > "{now in ISO datetime format}"^^xsd:dateTime)
?forecast ufokn:atRiskPoint ?rp .
?rp geosparql:hasGeometry ?sf .
?sf geofunc:within ("POLYGON (({?south} {?west}, {?north} {?west}, {?north} {?east}, {?south} {?east}, {?south} {?west}))"^^geosparql:wktLiteral {?x} unit:Kilometer) .
}
LIMIT 1