Strabon

view examples/teleios/deleteReflections.rq @ 1532:210bd063f842

[maven-release-plugin] copy for tag v3.2.11-temporals
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Thu Sep 22 16:53:04 2016 +0300 (2016-09-22)
parents 35ee9c800a47
children
line source
1 # Θεωρούμε ότι εαν ένα πολύγωνο παραμένει ενεργό για μεγάλο χρονικό
2 # διάστημα, χωρίς παράλληλα να ενεργοποιείται κάποιο γειτονικό του, τότε
3 # αυτό το πολύγωνο είναι θόρυβος.
4 # Συγκεκριμένα, για όλο το χρονικό διάστημα ενδιαφέροντος και για κάθε grid:
5 # - Υπολογίζω την χρονική διαφορά της τελευταίας από την πρώτη καταγραφή.
6 # - Εαν αυτή είναι μεγαλύτερη της μίας ώρας &
7 # - Για όλο αυτό το διάστημα δεν υπάρχουν γειτονικα πολύγωνα ενεργά
8 # (adjacent polygons)
9 # - Τότε οι συγκεκριμένες καταγραφές διαγράφονται
11 PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
12 PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
13 PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
14 PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
16 INSERT {?h1 noa:isDiscarded "1"^^xsd:int ;
17 noa:refinedBy noa:reflections .
18 }
19 WHERE {
20 SELECT ?h1 (count(?h2) as ?h2Count)
21 WHERE {
22 # Retrieve a hotspot of the current acquisition
23 ?h1 noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; #"2007-08-23T13:00:00"^^xsd:dateTime ;
24 noa:hasGeometry ?geo ;
25 noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ; #"StaticThresholds"^^xsd:string ;
26 noa:isDerivedFromSensor "SENSOR"^^xsd:string . # "MSG2"^^xsd:string .
28 # Retrieve all hotspots with the same geometry detected at most an hour ago
29 ?h2 noa:hasAcquisitionTime ?h2Time ;
30 noa:hasGeometry ?geo ;
31 noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ; #"StaticThresholds"^^xsd:string ;
32 noa:isDerivedFromSensor "SENSOR"^^xsd:string . # "MSG2"^^xsd:string .
33 FILTER("MIN_ACQUISITION_TIME"^^xsd:dateTime <= ?h2Time && ?h2Time <= "TIMESTAMP"^^xsd:dateTime ) .
34 # FILTER("2007-08-23T12:00:00"^^xsd:dateTime <= ?h2Time && ?h2Time <= "2007-08-23T13:00:00"^^xsd:dateTime) .
36 # Filter the results so that the above hotspots have no neighbours
37 OPTIONAL {
38 ?h3 noa:hasAcquisitionTime ?h3Time ;
39 noa:hasGeometry ?h3Geo ;
40 noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ; #"StaticThresholds"^^xsd:string ;
41 noa:isDerivedFromSensor "SENSOR"^^xsd:string . # "MSG2"^^xsd:string .
42 FILTER("MIN_ACQUISITION_TIME"^^xsd:dateTime <= ?h3Time && ?h3Time <= "TIMESTAMP"^^xsd:dateTime ) .
43 # FILTER("2007-08-23T12:00:00"^^xsd:dateTime <= ?h3Time && ?h3Time <= "2007-08-23T13:00:00"^^xsd:dateTime) .
44 FILTER(strdf:touch(?geo, ?h3Geo)).
45 }
46 FILTER(!bound(?h3)) .
47 }
48 # Select every hotspot of the current acquisition which has no neighbours since an hour ago until now
49 # and is "on" during all this time (MSG2 can have 333 detections during an hour)
50 GROUP BY ?h1
51 HAVING (?h2Count >= ACQUISITIONS_IN_AN_HOUR)
52 }