Strabon

view examples/teleios/runNoaRefinement.sh @ 919:6c8b5e31d7fe

addresses bug #31 (empty literals with wktLiteral datatype are regarded as empty geometries, i.e., MULTIPOLYGON EMPTY)
author Babis Nikolaou <charnik@di.uoa.gr>
date Mon Mar 25 00:04:09 2013 +0200 (2013-03-25)
parents
children
line source
1 #! /bin/bash
3 #
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 #
8 # Copyright (C) 2010, 2011, 2012, Pyravlos Team
9 #
10 # http://www.strabon.di.uoa.gr/
11 #
14 dataDir="/var/www/shapefiles2012all"
15 dataUrl="http://challenge.strabon.di.uoa.gr/shapefiles2012all/"
16 name="HMSG2_IR_039_s7"
17 suffix=".n3"
19 logFile="chain.log"
20 countTime="/usr/bin/time -ao ${logFile} -f %e"
21 echo > ${logFile}
23 insertMunicipalities="`cat insertMunicipalities.rq`"
24 deleteSeaHotspots="`cat deleteSeaHotspots.rq`"
25 landUseInvalidForFires="`cat landUseInvalidForFires.rq`"
26 refinePartialSeaHotspots="`cat refinePartialSeaHotspots.rq`"
27 refineTimePersistence="`cat refineTimePersistence.rq`"
29 # Initialize
30 #sudo service postgresql restart
31 #dropdb endpoint
32 #createdb endpoint -T template_postgis
33 #sudo service tomcat6 restart
34 #./endpoint store http://localhost:8080/endpoint N-Triples -u http://pathway.di.uoa.gr/hotspots/grid_4.nt
36 #./scripts/endpoint query http://localhost:8080/endpoint "SELECT (COUNT(*) AS ?C) WHERE {?s ?p ?o}"
37 #echo "Continue?"
38 #read a
41 for Month in `sec 7 8`; do
42 for d in `sec 1 31`; do
43 for h in `seq 0 12`; do
44 for m in `seq 0 15 45`; do
45 time=`printf "%02d%02d\n" $h $m`
46 time2=`printf "%02d:%02d\n" $h $m`
47 date=`printf "%02d-%02d\n" $Month $d`
48 ## file=${dataDir}${name}_${time}$suffix
49 # file=${dataUrl}${name}_${time}$suffix
50 #
51 # # store file
52 # echo -n "storing 2007-08-25T${time2}:00 " >> ${logFile}
53 ## ${countTime} ./strabon -db endpoint store $file
54 # ${countTime} ./endpoint store http://localhost:8080/endpoint N-Triples -u ${file}
55 #
56 ## echo "File ${file} stored!" >> ${logFile}
57 ## echo "Continue?"
58 ## read a
60 # deleteSeaHotspots
61 echo -n "deleteSeaHotspots 2007-${date}T${time2}:00 " >> ${logFile}
62 query=`echo "${deleteSeaHotspots}" | sed "s/TIMESTAMP/2007-${date}T${time2}:00/g" | \
63 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \
64 sed "s/SENSOR/MSG2/g"`
65 # ${countTime} ./strabon -db endpoint update "${query}"
66 ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
68 # echo "File ${file} deleteSeaHotspots done!"
69 # echo "Continue?"
70 # read a
72 # refinePartialSeaHotspots
73 echo -n "refinePartialSeaHotspots 2007-${date}T${time2}:00 " >> ${logFile}
74 query=`echo "${refinePartialSeaHotspots}" | sed "s/TIMESTAMP/2007-${date}T${time2}:00/g" | \
75 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \
76 sed "s/SENSOR/MSG2/g"`
77 # ${countTime} ./strabon -db endpoint update "${query}"
78 ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
80 # echo "File ${file} refinePartialSeaHotspots done!"
81 # echo "Continue?"
82 # read a
84 # refineTimePersistence
85 echo -n "refineTimePersistence 2007-${date}T${time2}:00 " >> ${logFile}
86 min_acquisition_time=`date --date="2007-${date} ${time2}:00 EEST -30 minutes" +%Y-%m-%dT%H:%m:00`
87 query=`echo "${refineTimePersistence}" | sed "s/TIMESTAMP/2007-${date}T${time2}:00/g" | \
88 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \
89 sed "s/SENSOR/MSG2/g" | \
90 sed "s/ACQUISITIONS_IN_HALF_AN_HOUR/3.0/g" | \
91 sed "s/MIN_ACQUISITION_TIME/${min_acquisition_time}/g"`
93 # echo "Query:"
94 # echo "${query}"
95 # echo "Continue?"
96 # read a
97 # ${countTime} ./strabon -db endpoint update "${query}"
98 # ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
99 ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
101 # echo "File ${file} refinePartialSeaHotspots done!"
102 # echo "Continue?"
103 # read a
104 done
105 done
108 #for f in `ls /home/ggarbis/TELEIOS/NOA_Processing_Chain/chain_msg2/data/out_triples/HMSG2_IR_039_s7_070825_*.hotspots.n3`
109 #do
111 # echo "Store $f"
112 # ${countTime} ./scripts/strabon -db endpoint store $f
113 #
114 #
115 #done