Strabon
changeset 414:7b42dd5d908b
removed queries/scripts under v2.1 and moved v2.1/V2.1/* to v2.1 (hope have removed the old versions)
author | Babis Nikolaou <charnik@di.uoa.gr> |
---|---|
date | Tue Jul 10 18:32:48 2012 +0300 (2012-07-10) |
parents | d66ca6eab8b1 |
children | 0f57e6892ecb |
files | scripts/v2.1/DeleteInSea.sparql scripts/v2.1/Refine.sparql scripts/v2.1/TimePersistence.sparql scripts/v2.1/V2.1/DeleteInSea.sparql scripts/v2.1/V2.1/Refine.sparql scripts/v2.1/V2.1/TimePersistence.sparql scripts/v2.1/V2.1/count.sparql scripts/v2.1/V2.1/discover.sparql scripts/v2.1/V2.1/endpoint scripts/v2.1/V2.1/runNoaRefinementChain.sh scripts/v2.1/V2.1/runNoaRefinementChain.sh-bakcup scripts/v2.1/V2.1/stderr.txt scripts/v2.1/count.sparql scripts/v2.1/discover.sparql scripts/v2.1/endpoint scripts/v2.1/runNoaRefinementChain.sh scripts/v2.1/runNoaRefinementChain.sh-bakcup scripts/v2.1/stderr.txt |
line diff
1.1 --- a/scripts/v2.1/V2.1/DeleteInSea.sparql Tue Jul 10 01:00:10 2012 +0300 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,18 +0,0 @@ 1.4 -PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 1.5 -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 1.6 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 1.7 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 1.8 - 1.9 -INSERT {?h noa:isDiscarded "1"^^xsd:int} 1.10 -WHERE { 1.11 -?h noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime; 1.12 - noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string; 1.13 - noa:isDerivedFromSensor "SENSOR"^^xsd:string; 1.14 - noa:hasGeometry ?hGeo. 1.15 - OPTIONAL { 1.16 - ?c rdf:type noa:Coastline; 1.17 - noa:hasGeometry ?cGeo . 1.18 - FILTER(strdf:anyInteract(?hGeo, ?cGeo)) . 1.19 - } 1.20 - FILTER(!bound(?c)) . 1.21 -}
2.1 --- a/scripts/v2.1/V2.1/Refine.sparql Tue Jul 10 01:00:10 2012 +0300 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,32 +0,0 @@ 2.4 -PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 2.5 -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 2.6 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 2.7 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 2.8 - 2.9 - 2.10 -INSERT { ?h noa:isDiscarded "1"^^xsd:int . 2.11 - ?valid rdf:type noa:Hotspot ; 2.12 - noa:hasConfidence ?conf ; 2.13 - noa:hasGeometry ?dif ; 2.14 - noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; 2.15 - noa:isDerivedFromSensor "SENSOR"^^xsd:string ; 2.16 - noa:hasConfirmation noa:unknown ; 2.17 - noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ; 2.18 - noa:isProducedBy noa:noa ; 2.19 - noa:isDerivedFromSatellite "SAT"^^xsd:string . 2.20 -} 2.21 -WHERE { 2.22 - SELECT ?h (strdf:intersection(?hGeo, strdf:union(?cGeo)) AS ?dif) (BNODE() AS ?valid) ?conf 2.23 - WHERE { 2.24 -?h noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime; 2.25 - noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ; 2.26 - noa:isDerivedFromSensor "SENSOR"^^xsd:string ; 2.27 - noa:hasGeometry ?hGeo ; 2.28 - noa:hasConfidence ?conf . 2.29 -?c rdf:type noa:Coastline ; 2.30 - noa:hasGeometry ?cGeo . 2.31 - FILTER(strdf:anyInteract(?hGeo, ?cGeo)) . 2.32 - } 2.33 - GROUP BY ?h ?hGeo ?conf 2.34 - HAVING strdf:overlap(?hGeo, strdf:union(?cGeo)) 2.35 -}
3.1 --- a/scripts/v2.1/V2.1/TimePersistence.sparql Tue Jul 10 01:00:10 2012 +0300 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,43 +0,0 @@ 3.4 -PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 3.5 -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 3.6 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 3.7 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 3.8 - 3.9 -INSERT { 3.10 - ?newHotspot rdf:type noa:Hotspot ; 3.11 - noa:hasConfidence ?hConfidence ; 3.12 - noa:hasGeometry ?hGeometry1 ; 3.13 - noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; 3.14 - noa:isDerivedFromSensor "SENSOR"^^xsd:string ; 3.15 - noa:hasConfirmation noa:unknown ; 3.16 - noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ; 3.17 - noa:isProducedBy noa:noa ; 3.18 - noa:isDerivedFromSatellite "SAT"^^xsd:string . 3.19 - 3.20 -} 3.21 -WHERE { 3.22 - SELECT (BNODE() AS ?newHotspot) 3.23 - (SUM(?hConfidence1)/ACQUISITIONS_IN_HALF_AN_HOUR AS ?hConfidence) 3.24 - ?hGeometry1 3.25 - WHERE { 3.26 - ?H1 noa:hasConfidence ?hConfidence1 . 3.27 - ?H1 noa:hasGeometry ?hGeometry1 . 3.28 - ?H1 noa:hasAcquisitionTime ?hAcquisitionTime1 . 3.29 - ?H1 noa:isDerivedFromSensor "SENSOR"^^xsd:string . 3.30 - ?H1 noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string . 3.31 - OPTIONAL { ?H1 noa:isDiscarded ?z } . 3.32 - FILTER (!BOUND(?z)) . 3.33 - FILTER( "MIN_ACQUISITION_TIME"^^xsd:dateTime <= ?hAcquisitionTime1 && ?hAcquisitionTime1 < "TIMESTAMP"^^xsd:dateTime ) . 3.34 - OPTIONAL { 3.35 - ?H2 noa:hasGeometry ?HGEO2 . 3.36 - ?H2 noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime . 3.37 - ?H2 noa:isDerivedFromSensor "SENSOR"^^xsd:string . 3.38 - ?H2 noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string . 3.39 - FILTER(("PROCESSING_CHAIN"^^xsd:string = ?hProcessingChain2)||("PROCESSING_CHAIN-TimePersistence"^^xsd:string = ?hProcessingChain2)). 3.40 - FILTER( strdf:equals(?hGeometry1, ?HGEO2) ) . 3.41 - } 3.42 - FILTER( !BOUND(?H2) ) . 3.43 - } 3.44 - GROUP BY ?hGeometry1 3.45 - HAVING(SUM(?hConfidence1)>0.0) 3.46 -}
4.1 --- a/scripts/v2.1/V2.1/count.sparql Tue Jul 10 01:00:10 2012 +0300 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,2 +0,0 @@ 4.4 -SELECT (count(*) AS ?count) 4.5 -WHERE {?s ?p ?o}
5.1 --- a/scripts/v2.1/V2.1/discover.sparql Tue Jul 10 01:00:10 2012 +0300 5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 5.3 @@ -1,24 +0,0 @@ 5.4 -#Discover hotspots depending on their acquisition time, processing chain and sensor 5.5 -#Return the hotspot's uri, its geometry and the affected municipalities 5.6 -#reference dataset: http://dev.strabon.di.uoa.gr/rdf/Kallikratis-Coastline.ntriples 5.7 - 5.8 -PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 5.9 -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 5.10 -PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 5.11 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 5.12 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 5.13 -PREFIX gag: <http://teleios.di.uoa.gr/ontologies/gagKallikratis.rdf#> 5.14 - 5.15 -SELECT ?h ?geo ?conf (GROUP_CONCAT(?dLabel ; SEPARATOR=', ') AS ?dimoi ) 5.16 -WHERE { 5.17 -?h noa:hasGeometry ?hGeo ; 5.18 - noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; 5.19 - noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ; 5.20 - noa:isDerivedFromSensor "SENSOR"^^xsd:string ; 5.21 - noa:hasConfidence ?conf . 5.22 -?d rdf:type gag:Dhmos; 5.23 - strdf:hasGeometry ?dGeo; 5.24 - rdfs:label ?dLabel. 5.25 - FILTER(strdf:anyInteract(?dGeo, ?hGeo)). 5.26 -} 5.27 -GROUP BY ?h (strdf:transform(?hGeo, <http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?geo) ?conf
6.1 --- a/scripts/v2.1/V2.1/endpoint Tue Jul 10 01:00:10 2012 +0300 6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 6.3 @@ -1,234 +0,0 @@ 6.4 -#!/bin/bash 6.5 -# 6.6 -# Script for executing SPARQL queries and SPARQL Update queries 6.7 -# as well as storing RDF triples on a Strabon Endpoint. 6.8 -# 6.9 -# Author: Charalampos (Babis) Nikolaou <charnik@di.uoa.gr> 6.10 -# 6.11 - 6.12 -# this command 6.13 -CMD="$(basename ${0})" 6.14 - 6.15 -function help() { 6.16 - echo "Usage: ${CMD} [OPTIONS] COMMAND ENDPOINT ARGS" 6.17 - echo 6.18 - echo "Execute SPARQL and SPARQL Update queries as well as store RDF triples on a Strabon endpoint." 6.19 - echo 6.20 - echo " COMMAND : one of query, queryfile, update, store, or help" 6.21 - echo " ENDPOINT : the URL of the Strabon Endpoint (e.g., http://localhost:8080/StrabonEndpoint)" 6.22 - echo " ARGS : arguments according to selected command" 6.23 - echo 6.24 - echo "OPTIONS can be any of the following" 6.25 - echo " -d : don't run, just print what shall be executed" 6.26 -} 6.27 - 6.28 -function help_query() { 6.29 - echo "Usage: ${CMD} query ENDPOINT SPARQL_QUERY [RESULT_FORMAT]" 6.30 - echo 6.31 - echo " ENDPOINT : the URL of Strabon Endpoint (e.g., http://localhost:8080/StrabonEndpoint/)" 6.32 - echo " SPARQL_QUERY : the SPARQL query to execute or the alias name corresponding to a" 6.33 - echo " predefined query such as:" 6.34 - echo " \`size': SELECT (count(*) as ?c) WHERE {?s ?p ?o}" 6.35 - echo " RESULT_FORMAT : the format of the result. Possible values are \`KMLMAP\, \`GEOJSON', " 6.36 - echo " \`HTML', \`KMZMAP', \`XML' (default), or \`KML'." 6.37 -} 6.38 - 6.39 -function help_queryfile() { 6.40 - echo "Usage: ${CMD} queryfile ENDPOINT SPARQL_QUERY_FILE [RESULT_FORMAT]" 6.41 - echo 6.42 - echo " ENDPOINT : the URL of Strabon Endpoint (e.g., http://localhost:8080/StrabonEndpoint/)" 6.43 - echo " SPARQL_QUERY_FILE : the file that contain the SPARQL query to execute" 6.44 - echo " RESULT_FORMAT : the format of the result. Possible values are \`KMLMAP\, \`GEOJSON', " 6.45 - echo " \`HTML', \`KMZMAP', \`XML' (default), or \`KML'." 6.46 -} 6.47 - 6.48 -function help_update() { 6.49 - echo "Usage: ${CMD} update ENDPOINT SPARQL_QUERY" 6.50 - echo 6.51 - echo " ENDPOINT : the URL of Strabon Endpoint (e.g., http://localhost:8080/StrabonEndpoint/)" 6.52 - echo " SPARQL_QUERY : the SPARQL update query to execute or the alias name corresponding to a" 6.53 - echo " predefined query such as:" 6.54 - echo " \`clear': DELETE {?s ?p ?o} WHERE {?s ?p ?o}" 6.55 -} 6.56 - 6.57 -function help_store() { 6.58 - echo "Usage: ${CMD} store ENDPOINT FORMAT -t TRIPLES|-u TRIPLES_URL" 6.59 - echo 6.60 - echo " ENDPOINT : the URL of Strabon Endpoint (e.g., http://localhost:8080/StrabonEndpoint/)" 6.61 - echo " FORMAT : the RDF format of the input (one of RDF/XML, N-Triples, Turtle, N3, TriX, TriG, or BinaryRDF)" 6.62 - echo " TRIPLES : the RDF triples to store" 6.63 - echo " TRIPLES_URL : the URL containing the RDF triples to store" 6.64 -} 6.65 - 6.66 -CURL_OPTS="-w HTTP_CODE='%{http_code}\n' -H \"Content-Type:application/x-www-form-urlencoded\" -H \"Accept:text/xml\"" 6.67 - 6.68 -# if set to 1, then only the command to be executed is printed 6.69 -DEBUG=0 6.70 - 6.71 -case "${1}" in 6.72 - -d) 6.73 - shift 6.74 - DEBUG=1 6.75 - ;; 6.76 -esac 6.77 - 6.78 -case "${1}" in 6.79 - help) 6.80 - shift 6.81 - if test $# -eq 1; then 6.82 - case "${1}" in 6.83 - query) 6.84 - help_query 6.85 - ;; 6.86 - queryfile) 6.87 - help_queryfile 6.88 - ;; 6.89 - update) 6.90 - help_update 6.91 - ;; 6.92 - store) 6.93 - help_store 6.94 - ;; 6.95 - *) 6.96 - help 6.97 - ;; 6.98 - esac 6.99 - exit 1 6.100 - fi 6.101 - help 6.102 - exit 0 6.103 - ;; 6.104 - query) 6.105 - shift 6.106 - if ! test $# -ge 2; then 6.107 - help_query 6.108 - exit 1 6.109 - fi 6.110 - URL="${1}/Query" 6.111 - QUERY="${2}" 6.112 - 6.113 - shift 6.114 - shift 6.115 - # predefined queries 6.116 - case "${QUERY}" in 6.117 - size) 6.118 - QUERY="SELECT (count(*) as ?c) WHERE {?s ?p ?o}" 6.119 - ;; 6.120 - esac 6.121 - 6.122 - # set default format 6.123 - FORMAT="XML" 6.124 - if test $# -eq 1; then 6.125 - FORMAT="${1}" 6.126 - fi 6.127 - 6.128 - case "${FORMAT}" in 6.129 - [Kk][Mm][Ll][Mm][Aa][Pp]|[Gg][Ee][Oo][Jj][Ss][Oo][Nn]|[Hh][Tt][Mm][Ll]|[Kk][mM][Zz][Mm][Aa][Pp]|[Xx][Mm][Ll]|[Kk][Mm][Ll]) 6.130 - shift 6.131 - ;; 6.132 - *) 6.133 - echo "${CMD}: unknown format \"${FORMAT}\"." 6.134 - echo "${CMD}: possible values are \`KMLMAP\, \`GEOJSON' \`HTML', \`KMZMAP', \`XML' (default), or \`KML'" 6.135 - exit 2 6.136 - ;; 6.137 - esac 6.138 - 6.139 - EXEC="curl ${CURL_OPTS} -d format='${FORMAT}' --data-urlencode SPARQLQuery='${QUERY}' ${URL}" 6.140 - ;; 6.141 - queryfile) 6.142 - shift 6.143 - if ! test $# -ge 2; then 6.144 - help_queryfile 6.145 - exit 1 6.146 - fi 6.147 - 6.148 - if [ ! -f ${2} ]; 6.149 - then 6.150 - echo "${CMD}: File not found." 6.151 - exit 2 6.152 - fi 6.153 - 6.154 - URL="${1}/Query" 6.155 - QUERY=`cat ${2} | sed 's/\"/\\\"/g'` 6.156 - 6.157 - shift 6.158 - shift 6.159 - 6.160 - # set default format 6.161 - FORMAT="XML" 6.162 - if test $# -eq 1; then 6.163 - FORMAT="${1}" 6.164 - fi 6.165 - 6.166 - case "${FORMAT}" in 6.167 - [Kk][Mm][Ll][Mm][Aa][Pp]|[Gg][Ee][Oo][Jj][Ss][Oo][Nn]|[Hh][Tt][Mm][Ll]|[Kk][mM][Zz][Mm][Aa][Pp]|[Xx][Mm][Ll]|[Kk][Mm][Ll]) 6.168 - shift 6.169 - ;; 6.170 - *) 6.171 - echo "${CMD}: unknown format \"${FORMAT}\"." 6.172 - echo "${CMD}: possible values are \`KMLMAP\, \`GEOJSON' \`HTML', \`KMZMAP', \`XML' (default), or \`KML'" 6.173 - exit 2 6.174 - ;; 6.175 - esac 6.176 - 6.177 - EXEC="curl ${CURL_OPTS} -d format='${FORMAT}' --data-urlencode SPARQLQuery='${QUERY}' ${URL}" 6.178 - ;; 6.179 - 6.180 - update) 6.181 - shift 6.182 - if ! test $# -eq 2; then 6.183 - help_update 6.184 - exit 1 6.185 - fi 6.186 - URL="${1}/Update" 6.187 - QUERY="${2}" 6.188 - 6.189 - # predefined queries 6.190 - case "${QUERY}" in 6.191 - clear) 6.192 - QUERY="DELETE {?s ?p ?o} WHERE {?s ?p ?o}" 6.193 - ;; 6.194 - esac 6.195 - 6.196 - EXEC="curl ${CURL_OPTS} --data-urlencode SPARQLQuery='${QUERY}' ${URL}" 6.197 - ;; 6.198 - store) 6.199 - shift 6.200 - if ! test $# -eq 4; then 6.201 - help_store 6.202 - exit 1 6.203 - fi 6.204 - URL="${1}/Store" 6.205 - FORMAT="${2}" 6.206 - case "${3}" in 6.207 - -t) 6.208 - TRIPLES="${4}" 6.209 - EXEC="curl ${CURL_OPTS} -d format='${FORMAT}' --data-urlencode data='${TRIPLES}' ${URL}" 6.210 - ;; 6.211 - -u) 6.212 - URL_TRIPLES="${4}" 6.213 - EXEC="curl ${CURL_OPTS} -d format='${FORMAT}' --data-urlencode url='${URL_TRIPLES}' -d fromurl='' ${URL}" 6.214 - ;; 6.215 - *) 6.216 - help_store 6.217 - exit 1 6.218 - ;; 6.219 - esac 6.220 - ;; 6.221 - *) 6.222 - help 6.223 - echo 6.224 - echo "${CMD}: unknown command \"${1}\"." 6.225 - exit 1 6.226 - ;; 6.227 -esac 6.228 - 6.229 -# execute or debug 6.230 -if test $DEBUG -eq 1; then 6.231 - echo "${CMD}: Debug is ON" 6.232 - echo "${CMD}: Printing command for execution" 6.233 - echo " $EXEC" 6.234 -else 6.235 - eval ${EXEC} 6.236 -fi 6.237 -
7.1 --- a/scripts/v2.1/V2.1/runNoaRefinementChain.sh Tue Jul 10 01:00:10 2012 +0300 7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 7.3 @@ -1,183 +0,0 @@ 7.4 -#!/bin/bash 7.5 -LOC="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 7.6 - 7.7 -ENDPOINT="http://localhost:8080/endpoint" 7.8 -DB="v21" 7.9 -GRIDURL="http://kk.di.uoa.gr/grid_4.nt" 7.10 -CHECKDIR="/home/konstantina/allhot/" 7.11 -POSTGISTEMPLATE="template_postgis" 7.12 - 7.13 -#dataDir="http://localhost/noa-teleios/out_triples/" 7.14 -#dataDir="http://kk.di.uoa.gr/out_triples/" 7.15 -dataDir="http://godel.di.uoa.gr/allhot/" 7.16 -name="HMSG2_IR_039_s7_07" 7.17 -suffix=".hotspots.nt" 7.18 - 7.19 -logFile="chain.log" 7.20 -#countWTime="/usr/bin/time -p %e" 7.21 -#echo > ${logFile} 7.22 - 7.23 -function timer() 7.24 -{ 7.25 - if [[ $# -eq 0 ]]; then 7.26 - echo $(date '+%s') 7.27 - else 7.28 - local stime=$1 7.29 - etime=$(date '+%s') 7.30 - 7.31 - if [[ -z "$stime" ]]; then stime=$etime; fi 7.32 - 7.33 - dt=$((etime - stime)) 7.34 - ds=$((dt % 60)) 7.35 - dm=$(((dt / 60) % 60)) 7.36 - dh=$((dt / 3600)) 7.37 - printf '%d:%02d:%02d' $dh $dm $ds 7.38 - fi 7.39 -} 7.40 - 7.41 -#prin 7.42 -#tmr1=$(timer) 7.43 -#meta 7.44 -#tmr2=$(timer) 7.45 -#ektypwsi 7.46 -#printf 'LALA %s %s\n' $((tmr2-tmr1)) $(timer $tmr1) 7.47 - 7.48 - 7.49 -deleteSeaHotspots=`cat ${LOC}/DeleteInSea.sparql` # | sed 's/\"/\\\"/g'` 7.50 -refinePartialSeaHotspots=`cat ${LOC}/Refine.sparql` # | sed 's/\"/\\\"/g'` 7.51 -refineTimePersistence=`cat ${LOC}/TimePersistence.sparql` # | sed 's/\"/\\\"/g'` 7.52 - 7.53 -# Initialize 7.54 -sudo service postgresql restart 7.55 -echo "Dropping endpoint database"; 7.56 -sudo -u postgres dropdb ${DB} 7.57 -echo "Creating endpoint database" 7.58 -sudo -u postgres createdb ${DB} -T ${POSTGISTEMPLATE} 7.59 -echo "restarting tomcat" 7.60 -sudo service tomcat7 restart 7.61 - 7.62 -echo "initializing database" 7.63 -echo "S D R TP" >>stderr.txt 7.64 - 7.65 -# ../endpoint store ${ENDPOINT} N-Triples -u ${GRIDURL} 7.66 - 7.67 -sudo -u postgres bash -c "curl -s http://dev.strabon.di.uoa.gr/rdf/Kallikratis-Coastline-dump.tgz|tar xz -O|psql -d ${DB}" 7.68 -#./scripts/endpoint query ${ENDPOINT} "SELECT (COUNT(*) AS ?C) WHERE {?s ?p ?o}" 7.69 -#sudo -u postgres psql -d endpoint -c 'CREATE INDEX datetime_values_idx_value ON datetime_values USING btree(value)'; 7.70 -#sudo -u postgres psql -d endpoint -c 'VACUUM ANALYZE;'; 7.71 - 7.72 - 7.73 -#echo "Continue?" 7.74 -#read a 7.75 - 7.76 - 7.77 -for mon in `seq 7 10`; do 7.78 -for d in `seq 1 30`; do 7.79 -for h in `seq 0 23 `; do 7.80 - for m in `seq 0 15 45`; do 7.81 - time=`printf "%02d%02d\n" $h $m` 7.82 - time2=`printf "%02d:%02d\n" $h $m` 7.83 - day=`printf "%02d" $d` 7.84 - month=`printf "%02d" $mon` 7.85 - file=${dataDir}${name}${month}${day}_${time}$suffix 7.86 -# file=${dataUrl}${name}_${time}$suffix 7.87 - 7.88 - check=${CHECKDIR}${name}${month}${day}_${time}$suffix 7.89 - 7.90 - if [[ ! -e $check ]]; 7.91 - then echo "FILE" $check "NOT EXISTS" ; continue 7.92 - fi 7.93 - 7.94 - # store file 7.95 - echo -n "storing " $file; echo; echo; 7.96 - # echo "Hotspot : " $h:$m >> stderr.txt 7.97 -# ${countTime} ./strabon -db endpoint store $file 7.98 - 7.99 - tmr1=$(timer) 7.100 - ../endpoint store ${ENDPOINT} N-Triples -u ${file} 7.101 - tmr2=$(timer) 7.102 -printf '%s ' $((tmr2-tmr1)) >>stderr.txt 7.103 - 7.104 - # sudo -u postgres psql -d endpoint -c 'VACUUM ANALYZE;'; 7.105 - 7.106 - echo;echo;echo;echo "File ${file} stored!" >> ${logFile} 7.107 -# echo "Continue?" 7.108 -# read a 7.109 - 7.110 - # deleteSeaHotspots 7.111 - echo -n "Going to deleteSeaHotspots 2007-${month}-${day}T${time2}:00 " ;echo; echo; echo; 7.112 - query=`echo "${deleteSeaHotspots}" | sed "s/TIMESTAMP/2007-${month}-${day}T${time2}:00/g" | \ 7.113 - sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 7.114 - sed "s/SENSOR/MSG2/g"` 7.115 -# ${countTime} ./strabon -db endpoint update "${query}" 7.116 - 7.117 -tmr1=$(timer) 7.118 - ../endpoint update ${ENDPOINT} "${query}" 7.119 - 7.120 -tmr2=$(timer) 7.121 -printf '%s ' $((tmr2-tmr1)) >>stderr.txt 7.122 - 7.123 - echo;echo;echo;echo "File ${file} deleteSeaHotspots done!" 7.124 -# echo "Continue?" 7.125 -# read a 7.126 - 7.127 - # refinePartialSeaHotspots 7.128 - echo -n "refinePartialSeaHotspots 2007-${month}-${day}T${time2}:00 " ; echo; echo ; echo; 7.129 - query=`echo "${refinePartialSeaHotspots}" | sed "s/TIMESTAMP/2007-${month}-${day}T${time2}:00/g" | \ 7.130 - sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 7.131 - sed "s/SENSOR/MSG2/g" |\ 7.132 - sed "s/SAT/METEOSAT9/g"` 7.133 -# ${countTime} ./strabon -db endpoint update "${query}" 7.134 -tmr1=$(timer) 7.135 - ../endpoint update ${ENDPOINT} "${query}" 7.136 - 7.137 -tmr2=$(timer) 7.138 -printf '%s ' $((tmr2-tmr1)) >>stderr.txt 7.139 - 7.140 - echo "File ${file} refinePartialSeaHotspots done!" 7.141 -# echo "Continue?" 7.142 -# read a 7.143 - 7.144 - # refineTimePersistence 7.145 - echo -n "Going to refineTimePersistence 2007-${month}-${day}T${time2}:00 ";echo;echo;echo; 7.146 - min_acquisition_time=`date --date="2007-${month}-${day} ${time2}:00 EEST -30 minutes" +%Y-%m-%dT%H:%m:00` 7.147 - query=`echo "${refineTimePersistence}" | sed "s/TIMESTAMP/2007-${month}-${day}T${time2}:00/g" | \ 7.148 - sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 7.149 - sed "s/SENSOR/MSG2/g" | \ 7.150 - sed "s/ACQUISITIONS_IN_HALF_AN_HOUR/3.0/g" | \ 7.151 - sed "s/MIN_ACQUISITION_TIME/${min_acquisition_time}/g"` |\ 7.152 - sed "s/SAT/METEOSAT9/g"` 7.153 - 7.154 -# echo "Query:" 7.155 -# echo "${query}" 7.156 -# echo "Continue?" 7.157 -# read a 7.158 -# ${countTime} ./strabon -db endpoint update "${query}" 7.159 -# ${countTime} ../endpoint update ${ENDPOINT} "${query}" 7.160 - 7.161 - sudo -u postgres psql -d ${DB} -c 'VACUUM ANALYZE;'; 7.162 - 7.163 - 7.164 -tmr1=$(timer) 7.165 - ../endpoint update ${ENDPOINT} "${query}" 7.166 - tmr2=$(timer) 7.167 -printf '%s \n' $((tmr2-tmr1)) >>stderr.txt 7.168 - 7.169 - echo;echo;echo;echo "File ${file} timePersistence done!" 7.170 -# echo "Continue?" 7.171 -# read a 7.172 - done 7.173 -done 7.174 -done 7.175 -done 7.176 - 7.177 - 7.178 -#for f in `ls /home/konstantina/noa-teleios/out_triples/HMSG2_IR_039_s7_070825_*.hotspots.n3` 7.179 -#do 7.180 - 7.181 -# echo "Store $f" 7.182 -# ${countTime} ./scripts/strabon -db endpoint store $f 7.183 -# 7.184 -# 7.185 -#done 7.186 -
8.1 --- a/scripts/v2.1/V2.1/runNoaRefinementChain.sh-bakcup Tue Jul 10 01:00:10 2012 +0300 8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 8.3 @@ -1,167 +0,0 @@ 8.4 -#!/bin/bash 8.5 -LOC="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 8.6 - 8.7 -ENDPOINT="http://localhost:8080/endpoint" 8.8 -DB="endpoint" 8.9 -GRIDURL="http://kk.di.uoa.gr/grid_4.nt" 8.10 - 8.11 -#dataDir="http://localhost/noa-teleios/out_triples/" 8.12 -dataDir="http://godel.di.uoa.gr/hotspots/" 8.13 -name="HMSG2_IR_039_s7_070825" 8.14 -suffix=".hotspots.n3" 8.15 - 8.16 -logFile="chain.log" 8.17 -#countWTime="/usr/bin/time -p %e" 8.18 -#echo > ${logFile} 8.19 - 8.20 -function timer() 8.21 -{ 8.22 - if [[ $# -eq 0 ]]; then 8.23 - echo $(date '+%s') 8.24 - else 8.25 - local stime=$1 8.26 - etime=$(date '+%s') 8.27 - 8.28 - if [[ -z "$stime" ]]; then stime=$etime; fi 8.29 - 8.30 - dt=$((etime - stime)) 8.31 - ds=$((dt % 60)) 8.32 - dm=$(((dt / 60) % 60)) 8.33 - dh=$((dt / 3600)) 8.34 - printf '%d:%02d:%02d' $dh $dm $ds 8.35 - fi 8.36 -} 8.37 - 8.38 -#prin 8.39 -#tmr1=$(timer) 8.40 -#meta 8.41 -#tmr2=$(timer) 8.42 -#ektypwsi 8.43 -#printf 'LALA %s %s\n' $((tmr2-tmr1)) $(timer $tmr1) 8.44 - 8.45 - 8.46 -deleteSeaHotspots=`cat ${LOC}/DeleteInSea.sparql` # | sed 's/\"/\\\"/g'` 8.47 -refinePartialSeaHotspots=`cat ${LOC}/Refine.sparql` # | sed 's/\"/\\\"/g'` 8.48 -refineTimePersistence=`cat ${LOC}/TimePersistence.sparql` # | sed 's/\"/\\\"/g'` 8.49 - 8.50 -# Initialize 8.51 -sudo service postgresql restart 8.52 -echo "Dropping endpoint database"; 8.53 -sudo -u postgres dropdb ${DB} 8.54 -echo "Creating endpoint database" 8.55 -sudo -u postgres createdb ${DB} -T template_postgis 8.56 -echo "restarting tomcat" 8.57 -sudo service tomcat7 restart 8.58 - 8.59 -echo "initializing database" 8.60 -echo "S D R TP" >>stderr.txt 8.61 - 8.62 - ../endpoint store ${ENDPOINT} N-Triples -u ${GRIDURL} 8.63 - 8.64 -#./scripts/endpoint query ${ENDPOINT} "SELECT (COUNT(*) AS ?C) WHERE {?s ?p ?o}" 8.65 -#sudo -u postgres psql -d endpoint -c 'CREATE INDEX datetime_values_idx_value ON datetime_values USING btree(value)'; 8.66 -#sudo -u postgres psql -d endpoint -c 'VACUUM ANALYZE;'; 8.67 - 8.68 - 8.69 -#echo "Continue?" 8.70 -#read a 8.71 - 8.72 - 8.73 - 8.74 - 8.75 -for h in `seq 0 23 `; do 8.76 - for m in `seq 0 15 45`; do 8.77 - time=`printf "%02d%02d\n" $h $m` 8.78 - time2=`printf "%02d:%02d\n" $h $m` 8.79 - file=${dataDir}${name}_${time}$suffix 8.80 -# file=${dataUrl}${name}_${time}$suffix 8.81 - 8.82 - # store file 8.83 - echo -n "storing " $file; echo; echo; 8.84 - # echo "Hotspot : " $h:$m >> stderr.txt 8.85 -# ${countTime} ./strabon -db endpoint store $file 8.86 - 8.87 - tmr1=$(timer) 8.88 - ../endpoint store ${ENDPOINT} N-Triples -u ${file} 8.89 - tmr2=$(timer) 8.90 -printf '%s ' $((tmr2-tmr1)) >>stderr.txt 8.91 - 8.92 - # sudo -u postgres psql -d endpoint -c 'VACUUM ANALYZE;'; 8.93 - 8.94 - echo;echo;echo;echo "File ${file} stored!" >> ${logFile} 8.95 -# echo "Continue?" 8.96 -# read a 8.97 - 8.98 - # deleteSeaHotspots 8.99 - echo -n "Going to deleteSeaHotspots 2007-08-25T${time2}:00 " ;echo; echo; echo; 8.100 - query=`echo "${deleteSeaHotspots}" | sed "s/TIMESTAMP/2007-08-25T${time2}:00/g" | \ 8.101 - sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 8.102 - sed "s/SENSOR/MSG2/g"` 8.103 -# ${countTime} ./strabon -db endpoint update "${query}" 8.104 - 8.105 -tmr1=$(timer) 8.106 - ../endpoint update ${ENDPOINT} "${query}" 8.107 - 8.108 -tmr2=$(timer) 8.109 -printf '%s ' $((tmr2-tmr1)) >>stderr.txt 8.110 - 8.111 - echo;echo;echo;echo "File ${file} deleteSeaHotspots done!" 8.112 -# echo "Continue?" 8.113 -# read a 8.114 - 8.115 - # refinePartialSeaHotspots 8.116 - echo -n "refinePartialSeaHotspots 2007-08-25T${time2}:00 " ; echo; echo ; echo; 8.117 - query=`echo "${refinePartialSeaHotspots}" | sed "s/TIMESTAMP/2007-08-25T${time2}:00/g" | \ 8.118 - sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 8.119 - sed "s/SENSOR/MSG2/g"` 8.120 -# ${countTime} ./strabon -db endpoint update "${query}" 8.121 -tmr1=$(timer) 8.122 - ../endpoint update ${ENDPOINT} "${query}" 8.123 - 8.124 -tmr2=$(timer) 8.125 -printf '%s ' $((tmr2-tmr1)) >>stderr.txt 8.126 - 8.127 - echo "File ${file} refinePartialSeaHotspots done!" 8.128 -# echo "Continue?" 8.129 -# read a 8.130 - 8.131 - # refineTimePersistence 8.132 - echo -n "Going to refineTimePersistence 2007-08-25T${time2}:00 ";echo;echo;echo; 8.133 - min_acquisition_time=`date --date="2007-08-25 ${time2}:00 EEST -30 minutes" +%Y-%m-%dT%H:%m:00` 8.134 - query=`echo "${refineTimePersistence}" | sed "s/TIMESTAMP/2007-08-25T${time2}:00/g" | \ 8.135 - sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 8.136 - sed "s/SENSOR/MSG2/g" | \ 8.137 - sed "s/ACQUISITIONS_IN_HALF_AN_HOUR/3.0/g" | \ 8.138 - sed "s/MIN_ACQUISITION_TIME/${min_acquisition_time}/g"` 8.139 - 8.140 -# echo "Query:" 8.141 -# echo "${query}" 8.142 -# echo "Continue?" 8.143 -# read a 8.144 -# ${countTime} ./strabon -db endpoint update "${query}" 8.145 -# ${countTime} ../endpoint update ${ENDPOINT} "${query}" 8.146 - 8.147 - sudo -u postgres psql -d ${DB} -c 'VACUUM ANALYZE;'; 8.148 - 8.149 - 8.150 -tmr1=$(timer) 8.151 - ../endpoint update ${ENDPOINT} "${query}" 8.152 - tmr2=$(timer) 8.153 -printf '%s \n' $((tmr2-tmr1)) >>stderr.txt 8.154 - 8.155 - echo;echo;echo;echo "File ${file} timePersistence done!" 8.156 -# echo "Continue?" 8.157 -# read a 8.158 - done 8.159 -done 8.160 - 8.161 - 8.162 -#for f in `ls /home/konstantina/noa-teleios/out_triples/HMSG2_IR_039_s7_070825_*.hotspots.n3` 8.163 -#do 8.164 - 8.165 -# echo "Store $f" 8.166 -# ${countTime} ./scripts/strabon -db endpoint store $f 8.167 -# 8.168 -# 8.169 -#done 8.170 -
9.1 --- a/scripts/v2.1/V2.1/stderr.txt Tue Jul 10 01:00:10 2012 +0300 9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 9.3 @@ -1,15 +0,0 @@ 9.4 -S D R TP 9.5 -S D R TP 9.6 -S D R TP 9.7 -S D R TP 9.8 -S D R TP 9.9 -S D R TP 9.10 -S D R TP 9.11 -S D R TP 9.12 -S D R TP 9.13 -S D R TP 9.14 -S D R TP 9.15 -S D R TP 9.16 -S D R TP 9.17 -S D R TP 9.18 -S D R TP
10.1 --- a/scripts/v2.1/runNoaRefinementChain.sh Tue Jul 10 01:00:10 2012 +0300 10.2 +++ b/scripts/v2.1/runNoaRefinementChain.sh Tue Jul 10 18:32:48 2012 +0300 10.3 @@ -2,14 +2,10 @@ 10.4 LOC="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 10.5 10.6 ENDPOINT="http://localhost:8080/endpoint" 10.7 -DB="endpoint" 10.8 +DB="v21" 10.9 GRIDURL="http://kk.di.uoa.gr/grid_4.nt" 10.10 - 10.11 CHECKDIR="/home/konstantina/allhot/" 10.12 -#CHECKDIR="${HOME}/teleios/nkua/Hotspots/" 10.13 - 10.14 -POSTGISTEMPLATE="postgistemplate" 10.15 -#POSTGISTEMPLATE="template_postgis" 10.16 +POSTGISTEMPLATE="template_postgis" 10.17 10.18 #dataDir="http://localhost/noa-teleios/out_triples/" 10.19 #dataDir="http://kk.di.uoa.gr/out_triples/" 10.20 @@ -58,18 +54,19 @@ 10.21 echo "Creating endpoint database" 10.22 sudo -u postgres createdb ${DB} -T ${POSTGISTEMPLATE} 10.23 echo "restarting tomcat" 10.24 -sudo service tomcat restart 10.25 +sudo service tomcat7 restart 10.26 10.27 echo "initializing database" 10.28 echo "S D R TP" >>stderr.txt 10.29 10.30 # ../endpoint store ${ENDPOINT} N-Triples -u ${GRIDURL} 10.31 10.32 -sudo -u postgres sh -c "curl -s http://dev.strabon.di.uoa.gr/rdf/Kallikratis-Coastline-dump.tgz|tar xz -O|psql -d ${DB}" 10.33 +sudo -u postgres bash -c "curl -s http://dev.strabon.di.uoa.gr/rdf/Kallikratis-Coastline-dump.tgz|tar xz -O|psql -d ${DB}" 10.34 #./scripts/endpoint query ${ENDPOINT} "SELECT (COUNT(*) AS ?C) WHERE {?s ?p ?o}" 10.35 #sudo -u postgres psql -d endpoint -c 'CREATE INDEX datetime_values_idx_value ON datetime_values USING btree(value)'; 10.36 #sudo -u postgres psql -d endpoint -c 'VACUUM ANALYZE;'; 10.37 10.38 + 10.39 #echo "Continue?" 10.40 #read a 10.41 10.42 @@ -84,7 +81,7 @@ 10.43 month=`printf "%02d" $mon` 10.44 file=${dataDir}${name}${month}${day}_${time}$suffix 10.45 # file=${dataUrl}${name}_${time}$suffix 10.46 - 10.47 + 10.48 check=${CHECKDIR}${name}${month}${day}_${time}$suffix 10.49 10.50 if [[ ! -e $check ]]; 10.51 @@ -94,19 +91,19 @@ 10.52 # store file 10.53 echo -n "storing " $file; echo; echo; 10.54 # echo "Hotspot : " $h:$m >> stderr.txt 10.55 -# ${countTime} ./strabon -db endpoint store $file 10.56 +# ${countTime} ./strabon -db endpoint store $file 10.57 10.58 tmr1=$(timer) 10.59 - ../endpoint store ${ENDPOINT} N-Triples -u ${file} 10.60 + ../endpoint store ${ENDPOINT} N-Triples -u ${file} 10.61 tmr2=$(timer) 10.62 printf '%s ' $((tmr2-tmr1)) >>stderr.txt 10.63 - 10.64 + 10.65 # sudo -u postgres psql -d endpoint -c 'VACUUM ANALYZE;'; 10.66 10.67 echo;echo;echo;echo "File ${file} stored!" >> ${logFile} 10.68 # echo "Continue?" 10.69 # read a 10.70 - 10.71 + 10.72 # deleteSeaHotspots 10.73 echo -n "Going to deleteSeaHotspots 2007-${month}-${day}T${time2}:00 " ;echo; echo; echo; 10.74 query=`echo "${deleteSeaHotspots}" | sed "s/TIMESTAMP/2007-${month}-${day}T${time2}:00/g" | \ 10.75 @@ -114,16 +111,16 @@ 10.76 sed "s/SENSOR/MSG2/g"` 10.77 # ${countTime} ./strabon -db endpoint update "${query}" 10.78 10.79 -tmr1=$(timer) 10.80 - ../endpoint update ${ENDPOINT} "${query}" 10.81 - 10.82 +tmr1=$(timer) 10.83 + ../endpoint update ${ENDPOINT} "${query}" 10.84 + 10.85 tmr2=$(timer) 10.86 printf '%s ' $((tmr2-tmr1)) >>stderr.txt 10.87 10.88 echo;echo;echo;echo "File ${file} deleteSeaHotspots done!" 10.89 # echo "Continue?" 10.90 # read a 10.91 - 10.92 + 10.93 # refinePartialSeaHotspots 10.94 echo -n "refinePartialSeaHotspots 2007-${month}-${day}T${time2}:00 " ; echo; echo ; echo; 10.95 query=`echo "${refinePartialSeaHotspots}" | sed "s/TIMESTAMP/2007-${month}-${day}T${time2}:00/g" | \ 10.96 @@ -133,6 +130,7 @@ 10.97 # ${countTime} ./strabon -db endpoint update "${query}" 10.98 tmr1=$(timer) 10.99 ../endpoint update ${ENDPOINT} "${query}" 10.100 + 10.101 tmr2=$(timer) 10.102 printf '%s ' $((tmr2-tmr1)) >>stderr.txt 10.103 10.104 @@ -147,7 +145,7 @@ 10.105 sed "s/PROCESSING_CHAIN/DynamicThresholds/g" | \ 10.106 sed "s/SENSOR/MSG2/g" | \ 10.107 sed "s/ACQUISITIONS_IN_HALF_AN_HOUR/3.0/g" | \ 10.108 - sed "s/MIN_ACQUISITION_TIME/${min_acquisition_time}/g" |\ 10.109 + sed "s/MIN_ACQUISITION_TIME/${min_acquisition_time}/g"` |\ 10.110 sed "s/SAT/METEOSAT9/g"` 10.111 10.112 # echo "Query:" 10.113 @@ -164,6 +162,7 @@ 10.114 ../endpoint update ${ENDPOINT} "${query}" 10.115 tmr2=$(timer) 10.116 printf '%s \n' $((tmr2-tmr1)) >>stderr.txt 10.117 + 10.118 echo;echo;echo;echo "File ${file} timePersistence done!" 10.119 # echo "Continue?" 10.120 # read a 10.121 @@ -178,7 +177,7 @@ 10.122 10.123 # echo "Store $f" 10.124 # ${countTime} ./scripts/strabon -db endpoint store $f 10.125 -# 10.126 -# 10.127 +# 10.128 +# 10.129 #done 10.130
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 11.2 +++ b/scripts/v2.1/stderr.txt Tue Jul 10 18:32:48 2012 +0300 11.3 @@ -0,0 +1,15 @@ 11.4 +S D R TP 11.5 +S D R TP 11.6 +S D R TP 11.7 +S D R TP 11.8 +S D R TP 11.9 +S D R TP 11.10 +S D R TP 11.11 +S D R TP 11.12 +S D R TP 11.13 +S D R TP 11.14 +S D R TP 11.15 +S D R TP 11.16 +S D R TP 11.17 +S D R TP 11.18 +S D R TP