Strabon

changeset 701:ef738d9a466a

add runNoaRefinement.sh in examples fore iswc2012demo
author ggarbis
date Thu Nov 08 23:52:31 2012 +0200 (2012-11-08)
parents 00a9bf5d8b50
children 20d6240229f7
files endpoint/WebContent/WEB-INF/connection.properties examples/teleios/runNoaRefinement.sh
line diff
     1.1 --- a/endpoint/WebContent/WEB-INF/connection.properties	Thu Nov 08 16:09:49 2012 +0200
     1.2 +++ b/endpoint/WebContent/WEB-INF/connection.properties	Thu Nov 08 23:52:31 2012 +0200
     1.3 @@ -2,5 +2,5 @@
     1.4  port=5432
     1.5  dbengine=postgis
     1.6  password=postgres
     1.7 -dbname=endpoint
     1.8 +dbname=endpoint2
     1.9  username=postgres
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/examples/teleios/runNoaRefinement.sh	Thu Nov 08 23:52:31 2012 +0200
     2.3 @@ -0,0 +1,116 @@
     2.4 +#! /bin/bash
     2.5 +
     2.6 +#
     2.7 +# This Source Code Form is subject to the terms of the Mozilla Public
     2.8 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     2.9 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
    2.10 +#
    2.11 +# Copyright (C) 2010, 2011, 2012, Pyravlos Team
    2.12 +#
    2.13 +# http://www.strabon.di.uoa.gr/
    2.14 +#
    2.15 +
    2.16 +
    2.17 +dataDir="/var/www/shapefiles2012all"
    2.18 +dataUrl="http://challenge.strabon.di.uoa.gr/shapefiles2012all/"
    2.19 +name="HMSG2_IR_039_s7"
    2.20 +suffix=".n3"
    2.21 +
    2.22 +logFile="chain.log"
    2.23 +countTime="/usr/bin/time -ao ${logFile} -f %e"
    2.24 +echo > ${logFile}
    2.25 +
    2.26 +insertMunicipalities="`cat insertMunicipalities.rq`"
    2.27 +deleteSeaHotspots="`cat deleteSeaHotspots.rq`"
    2.28 +landUseInvalidForFires="`cat landUseInvalidForFires.rq`"
    2.29 +refinePartialSeaHotspots="`cat refinePartialSeaHotspots.rq`"
    2.30 +refineTimePersistence="`cat refineTimePersistence.rq`"
    2.31 +
    2.32 +# Initialize
    2.33 +#sudo service postgresql restart
    2.34 +#dropdb endpoint
    2.35 +#createdb endpoint -T template_postgis
    2.36 +#sudo service tomcat6 restart
    2.37 +#./endpoint store http://localhost:8080/endpoint N-Triples -u http://pathway.di.uoa.gr/hotspots/grid_4.nt
    2.38 +
    2.39 +#./scripts/endpoint query http://localhost:8080/endpoint "SELECT (COUNT(*) AS ?C) WHERE {?s ?p ?o}"
    2.40 +#echo "Continue?"
    2.41 +#read a
    2.42 +
    2.43 +
    2.44 +for Month in `sec 7 8`; do
    2.45 +	for d in `sec 1 31`; do
    2.46 +		for h in `seq 0 12`; do
    2.47 +			for m in `seq 0 15 45`; do
    2.48 +            			time=`printf "%02d%02d\n" $h $m`
    2.49 +		        	time2=`printf "%02d:%02d\n" $h $m`
    2.50 +				date=`printf "%02d-%02d\n" $Month $d`
    2.51 +##            file=${dataDir}${name}_${time}$suffix
    2.52 +#            file=${dataUrl}${name}_${time}$suffix
    2.53 +#    
    2.54 +#            # store file
    2.55 +#            echo -n "storing 2007-08-25T${time2}:00 " >> ${logFile}
    2.56 +##            ${countTime} ./strabon -db endpoint store $file      
    2.57 +#            ${countTime} ./endpoint store http://localhost:8080/endpoint N-Triples -u ${file}
    2.58 +#            
    2.59 +##            echo "File ${file} stored!" >> ${logFile}
    2.60 +##            echo "Continue?"
    2.61 +##            read a
    2.62 +         
    2.63 +            # deleteSeaHotspots
    2.64 +            echo -n "deleteSeaHotspots 2007-${date}T${time2}:00 " >> ${logFile}
    2.65 +            query=`echo "${deleteSeaHotspots}" | sed "s/TIMESTAMP/2007-${date}T${time2}:00/g" | \
    2.66 +                sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \
    2.67 +                sed "s/SENSOR/MSG2/g"`
    2.68 +#            ${countTime} ./strabon -db endpoint update "${query}"
    2.69 +            ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
    2.70 +            
    2.71 +#            echo "File ${file} deleteSeaHotspots done!"
    2.72 +#            echo "Continue?"
    2.73 +#            read a
    2.74 +            
    2.75 +            # refinePartialSeaHotspots
    2.76 +            echo -n "refinePartialSeaHotspots 2007-${date}T${time2}:00 " >> ${logFile}
    2.77 +            query=`echo "${refinePartialSeaHotspots}" | sed "s/TIMESTAMP/2007-${date}T${time2}:00/g" | \
    2.78 +                sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \
    2.79 +                sed "s/SENSOR/MSG2/g"`
    2.80 +#            ${countTime} ./strabon -db endpoint update "${query}"
    2.81 +            ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
    2.82 +            
    2.83 +#            echo "File ${file} refinePartialSeaHotspots done!"
    2.84 +#            echo "Continue?"
    2.85 +#            read a
    2.86 +
    2.87 +            # refineTimePersistence
    2.88 +            echo -n "refineTimePersistence 2007-${date}T${time2}:00 " >> ${logFile}
    2.89 +            min_acquisition_time=`date --date="2007-${date} ${time2}:00 EEST -30 minutes" +%Y-%m-%dT%H:%m:00`
    2.90 +            query=`echo "${refineTimePersistence}" | sed "s/TIMESTAMP/2007-${date}T${time2}:00/g" | \
    2.91 +                sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \
    2.92 +                sed "s/SENSOR/MSG2/g" | \
    2.93 +                sed "s/ACQUISITIONS_IN_HALF_AN_HOUR/3.0/g" | \
    2.94 +                sed "s/MIN_ACQUISITION_TIME/${min_acquisition_time}/g"`
    2.95 +
    2.96 +#            echo "Query:"
    2.97 +#            echo "${query}"
    2.98 +#            echo "Continue?"
    2.99 +#            read a
   2.100 +#            ${countTime} ./strabon -db endpoint update "${query}"
   2.101 +#            ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
   2.102 +            ${countTime} ./endpoint update http://localhost:8080/endpoint "${query}"
   2.103 +            
   2.104 +#            echo "File ${file} refinePartialSeaHotspots done!"
   2.105 +#            echo "Continue?"
   2.106 +#            read a
   2.107 +    done
   2.108 +done
   2.109 +
   2.110 +
   2.111 +#for f in `ls /home/ggarbis/TELEIOS/NOA_Processing_Chain/chain_msg2/data/out_triples/HMSG2_IR_039_s7_070825_*.hotspots.n3`
   2.112 +#do
   2.113 +
   2.114 +#    echo "Store $f"
   2.115 +#	${countTime} ./scripts/strabon -db endpoint store $f
   2.116 +#	
   2.117 +#	
   2.118 +#done
   2.119 +