RVAS-UC1-c

lock_open

By prodatamarket_publisher

Last modification over 3 years ago -  2017-03-06 09:31:34 UTC
Description

The total risk value for the state-owned buildings.


Query text


PREFIX prodm-cad: <http://vocabs.datagraft.net/proDataMarket/0.1/Cadastre#>
PREFIX prodm-com: <http://vocabs.datagraft.net/proDataMarket/0.1/Common#>
PREFIX prodm-soe: <http://vocabs.datagraft.net/proDataMarket/0.1/SoE#>
PREFIX schema: <http://schema.org/>
PREFIX gsp: <http://www.opengis.net/ont/geosparql#>
PREFIX sf: <http://www.opengis.net/ont/sf#>
PREFIX cp: <http://www.w3.org/2015/03/inspire/cp#>
PREFIX dul: <http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#>
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX au: <http://www.w3.org/2015/03/inspire/au#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?coords ?risk
WHERE {

?bygg a prodm-cad:Building ;
gsp:hasGeometry [gsp:asWKT ?coords ;];
prodm-cad:isBuiltOn ?cp .
OPTIONAL {?bygg prodm-com:hasIndicator [a prodm-com:Indicator ;
dbo:type "StormRisk" ;
rdf:value ?storm1 ;]; }
OPTIONAL {?bygg prodm-com:hasIndicator [a prodm-com:Indicator ;
dbo:type "FloodRisk" ;
rdf:value ?flood ;]; }
bind(if(bound(?storm1), if (?storm1>0,"1"^^xsd:integer,"0"^^xsd:integer),"0"^^xsd:integer) as ?storm )
bind(if(?storm > 0 && bound(?flood), "2", if(?storm > 0 || bound(?flood), "1", "0")) as ?risk)

}