Strabon

changeset 832:a472e5d377b4 DiffDateTime

runChain takes hotspots from server and minor changes in comments and printings
author George Garbis <ggarbis@di.uoa.gr>
date Thu Jan 03 15:06:58 2013 +0200 (2013-01-03)
parents 52396ec09aae
children e933de33721c
files examples/teleios/exampleFires.ttl examples/teleios/runChain.sh
line diff
     1.1 --- a/examples/teleios/exampleFires.ttl	Fri Dec 21 16:29:49 2012 +0200
     1.2 +++ b/examples/teleios/exampleFires.ttl	Thu Jan 03 15:06:58 2013 +0200
     1.3 @@ -2,6 +2,7 @@
     1.4  # Έχει 4 ομάδες hotspot.
     1.5  # Η δύο πρώτες ομάδες (h111,h112,h121) απέχουν 10 λεπτά (persistence=10') άρα πάνε μαζί.
     1.6  # Η δύο τελευταίες (h211, h221, h222) απέχουν πάλι δέκα λεπτά και πάνε μαζί.
     1.7 +# Άρα η επερώτηση θα μου απαντήσει τις δύο ομάδες (με την ίδια γεωμετριά και διαφορετικά start και end times)
     1.8  
     1.9  @prefix lgd: <http://linkedgeodata.org/triplify/> .
    1.10  @prefix lgdgeo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
     2.1 --- a/examples/teleios/runChain.sh	Fri Dec 21 16:29:49 2012 +0200
     2.2 +++ b/examples/teleios/runChain.sh	Thu Jan 03 15:06:58 2013 +0200
     2.3 @@ -4,7 +4,7 @@
     2.4  # License, v. 2.0. If a copy of the MPL was not distributed with this file, you
     2.5  # can obtain one at http://mozilla.org/MPL/2.0/. 
     2.6  # 
     2.7 -# Copyright (C) 2010, 2011, 2012, Pyravlos Team 
     2.8 +# Copyright (C) 2010, 2011, 2012, 2013 Pyravlos Team 
     2.9  # 
    2.10  # http://www.strabon.di.uoa.gr/ 
    2.11  #
    2.12 @@ -25,11 +25,14 @@
    2.13      echo "Execute NOA chain with refinements and measure time."
    2.14      echo                                                                        
    2.15      echo "OPTIONS can be any of the following"                                  
    2.16 -    echo "  -d,--db   		: PostGIS database"                
    2.17 -    echo "  -e,--endpoint   : Strabon Endpoint"
    2.18 -    echo "  -h,--hotposts	: URL where hotspots are stored"
    2.19 -	echo "  -b,--background	: Background data"                                           
    2.20 -	echo "  -l,--log		: Log file"                                           
    2.21 +    echo "  -d,--db   					: PostGIS database"                
    2.22 +    echo "  -e,--endpoint   			: Strabon Endpoint"
    2.23 +    echo "  -h,--hotposts				: URL where hotspots are stored"
    2.24 +	echo "  -b,--background         	: Background data"                                           
    2.25 +	echo "  -l,--log		            : Log file"                                           
    2.26 +	echo "  -c,--chain		            : Processing chain of hotspots"
    2.27 +	echo "  -p,--persistence            : Value of persistence of discoverFires query"
    2.28 +	echo "  -r,--repeat_in_persistence  : Value of repeat_in_persistence of discoverFires query"     
    2.29  }
    2.30  
    2.31  # If no arguments are given it returns miliseconds from 1970-01-01 00:00:00 UTC
    2.32 @@ -70,8 +73,8 @@
    2.33  
    2.34  # Handled a postgres database
    2.35  # -$1: Command (create/drop/store)
    2.36 -# -$2: Dump file to store (if store is given as $1)
    2.37 -#	   'spatial' to create a spatial database (if create is given as $1)
    2.38 +# -$2: Dump file to store (if runscript is given as command)
    2.39 +#	   or 'spatial' to create a spatial database (if create is given as command)
    2.40  function handlePostgresDatabase() {
    2.41  	local command=$1
    2.42  	local db=$2
    2.43 @@ -226,7 +229,7 @@
    2.44  # default values
    2.45  endpoint="http://pathway.di.uoa.gr:8080/endpoint"
    2.46  db="NOA2012"
    2.47 -hotspotsURL="http://pathway.di.uoa.gr/hotspots"
    2.48 +hotspotsURL="http://jose.di.uoa.gr/rdf/hotspots/MSG1"
    2.49  bgFile="http://dev.strabon.di.uoa.gr/rdf/Kallikratis-Coastline-Corine-dump-postgres-9.tgz"
    2.50  logFile="runChain.log"
    2.51  
    2.52 @@ -266,6 +269,21 @@
    2.53  			logFile=${1}
    2.54  			shift
    2.55  			;;
    2.56 +        -c|--chain)
    2.57 +            shift
    2.58 +            chain=${1}
    2.59 +            shift
    2.60 +            ;;
    2.61 +        -p|--persistence)
    2.62 +            shift
    2.63 +            persistence=${1}
    2.64 +            shift
    2.65 +            ;;
    2.66 +        -r|--repeat_in_persistence)
    2.67 +            shift
    2.68 +            repeat_in_persistence=${1}
    2.69 +            shift
    2.70 +            ;;
    2.71  		*)
    2.72  			echo "unknown argument ${1}"
    2.73  			help
    2.74 @@ -295,14 +313,16 @@
    2.75  
    2.76  #${loc}/../../scripts/endpoint query ${endpoint} size 
    2.77  #exit -1
    2.78 -echo "Timestamp Store Municipalities DeleteInSea InvalidForFires DeleteReflections RefineInCoast TimePersistence" > ${logFile}
    2.79 +echo "Timestamp Store Municipalities DeleteInSea InvalidForFires DeleteReflections RefineInCoast TimePersistence DiscoverHotspots DiscoverFires" > ${logFile}
    2.80 +echo > /home/ggarbis/discoverFires.log
    2.81 +echo > /home/ggarbis/discover.log
    2.82  
    2.83  years="2012" #"2007 2008 2010 2011"
    2.84  for y in ${years}; do
    2.85 -    hotspots="`ls /var/www/hotspots/${y} | sort | grep -o 'HMSG.*\.nt'`"
    2.86 +#    hotspots="`ls /var/www/hotspots/${y} | sort | grep -o 'HMSG.*\.nt'`"
    2.87  	# get hotpost URLS
    2.88 -#	for hot in $(curl -s ${hotspotsURL}/${y}/ | grep -o '>HMSG.*\.nt' | colrm 1 1); do
    2.89 -	for hot in ${hotspots}; do
    2.90 +	for hot in $(curl -s ${hotspotsURL}/${y}/ | grep -o '>HMSG.*\.nt' | colrm 1 1); do
    2.91 +#	for hot in ${hotspots}; do
    2.92  		file="${hotspotsURL}/${y}/${hot}"
    2.93  
    2.94  		time_status=$(echo ${hot} | egrep -o '[[:digit:]]{6}_[[:digit:]]{4}')
    2.95 @@ -328,7 +348,7 @@
    2.96  		echo -n "${timestamp} " >> ${logFile}
    2.97          
    2.98  		handleStrabonEndpoint ${endpoint} store ${file}
    2.99 -        echo "Store ${file}" ; # read t
   2.100 +        echo "Processing File ${file}" ; # read t
   2.101  
   2.102  		# Insert Municipalities	
   2.103  		update="`${instantiate} -t ${timestamp} -c ${chain} -s ${sensor} ${loc}/insertMunicipalities.rq`"
   2.104 @@ -361,24 +381,24 @@
   2.105  		minTime=`date --date="${year}-${month}-${day} ${time2}:00 EEST -30 minutes" +%Y-%m-%dT%H:%M:00`
   2.106  		update="`${instantiate} -t ${timestamp} -c ${chain} -s ${sensor} -m ${minTime} ${loc}/refineTimePersistence.rq`"
   2.107  #       echo "Refine Time Persistence: ${update}" ; read t
   2.108 -		handleStrabonEndpoint ${endpoint} update "${update}"
   2.109 +		handleStrabonEndpoint ${endpoint} update "${update}" #2>&1 | tee /home/ggarbis/timePersistence.log
   2.110  
   2.111 -##		#sudo -u postgres psql -d ${DB} -c 'VACUUM ANALYZE;';
   2.112 +		#sudo -u postgres psql -d ${DB} -c 'VACUUM ANALYZE;';
   2.113          
   2.114  		# Discover
   2.115  		minTime=`date --date="${year}-${month}-${day} 00:00 EEST" +%Y-%m-%dT%H:%M:00`
   2.116  		maxTime=`date --date="${year}-${month}-${day} 23:59 EEST" +%Y-%m-%dT%H:%M:00`
   2.117          query="`${instantiate} -c ${chain} -s ${sensor} -m ${minTime} -M ${maxTime} ${loc}/discover.rq`"
   2.118 -       echo "Discover: ${query}" ; read t
   2.119 -		handleStrabonEndpoint ${endpoint} query "${query}" | tee /home/ggarbis/discover.log
   2.120 +#        echo "Discover: ${query}" ; #read t
   2.121 +		handleStrabonEndpoint ${endpoint} query "${query}" 2>&1 >> /home/ggarbis/discover.log
   2.122      
   2.123  		# Discover Fires
   2.124  		minTime=`date --date="${year}-${month}-${day} 00:00 EEST" +%Y-%m-%dT%H:%M:00`
   2.125  		maxTime=`date --date="${year}-${month}-${day} 23:59 EEST" +%Y-%m-%dT%H:%M:00`
   2.126          query="`${instantiate} -c ${chain} -s ${sensor} -m ${minTime} -M ${maxTime} -p 10 -r 3 ${loc}/discoverFires.rq`"
   2.127 -        echo "Discover Fires: ${query}" ; #read t
   2.128 -		handleStrabonEndpoint ${endpoint} query "${query}" #| tee /home/ggarbis/discoverFires.log
   2.129 -#    
   2.130 +#        echo "Discover Fires: ${query}" ; #read t
   2.131 +		handleStrabonEndpoint ${endpoint} query "${query}" 2>&1 >> /home/ggarbis/discoverFires.log
   2.132 +
   2.133          echo >> ${logFile}    
   2.134  	done
   2.135  done