Strabon

view scripts/archive/v2/TimePersistence.sparql @ 965:69a0a785ef8f

added new "constants" module with artifactId "spatial-temporal-constants" and moved GeoConstants there
author Babis Nikolaou <charnik@di.uoa.gr>
date Tue Apr 02 13:27:01 2013 +0300 (2013-04-02)
parents 095644d86e05
children
line source
1 PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
2 PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
3 PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
4 PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
6 INSERT {
7 ?newHotspot rdf:type noa:Hotspot ;
8 noa:hasConfidence ?hConfidence ;
9 noa:hasGeometry ?hGeometry1 ;
10 noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ;
11 noa:isDerivedFromSensor "SENSOR"^^xsd:string ;
12 noa:hasConfirmation noa:unknown ;
13 noa:producedFromProcessingChain ?hProcessingChain ;
14 noa:isProducedBy noa:noa .
15 }
16 WHERE {
17 SELECT (BNODE() AS ?newHotspot)
18 (SUM(?hConfidence1)/ACQUISITIONS_IN_HALF_AN_HOUR AS ?hConfidence)
19 ?hGeometry1
20 (CONCAT("PROCESSING_CHAIN"^^xsd:string,"-TimePersistence") AS ?hProcessingChain)
21 WHERE {
22 ?H1 rdf:type noa:Hotspot .
23 ?H1 noa:hasConfidence ?hConfidence1 .
24 ?H1 noa:hasGeometry ?hGeometry1 .
25 ?H1 noa:hasAcquisitionTime ?hAcquisitionTime1 .
26 ?H1 noa:isDerivedFromSensor "SENSOR"^^xsd:string .
27 ?H1 noa:hasConfirmation noa:unknown .
28 ?H1 noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string .
29 OPTIONAL { ?H1 noa:isDiscarded ?z } .
30 FILTER (!BOUND(?z)) .
31 ?H1 noa:isProducedBy noa:noa .
32 FILTER( "MIN_ACQUISITION_TIME"^^xsd:dateTime <= ?hAcquisitionTime1 && ?hAcquisitionTime1 < "TIMESTAMP"^^xsd:dateTime ) .
33 OPTIONAL {
34 ?H2 rdf:type noa:Hotspot .
35 ?H2 noa:hasGeometry ?HGEO2 .
36 ?H2 noa:hasAcquisitionTime ?hAcquisitionTime2 .
37 ?H2 noa:isDerivedFromSensor "SENSOR"^^xsd:string .
38 ?H2 noa:producedFromProcessingChain ?hProcessingChain2 .
39 FILTER(regex("PROCESSING_CHAIN"^^xsd:string, ?hProcessingChain2)).
40 FILTER( strdf:equals(?hGeometry1, ?HGEO2) ) .
41 FILTER(?hAcquisitionTime2 = "TIMESTAMP"^^xsd:dateTime) .
42 }
43 FILTER( !BOUND(?H2) ) .
44 }
45 GROUP BY ?hGeometry1
46 HAVING(SUM(?hConfidence1)>0.0)
47 }