Strabon

changeset 152:362c84669d89

merge
author George Garbis <ggarbis@di.uoa.gr>
date Thu May 17 15:07:52 2012 +0300 (2012-05-17)
parents 3b8c73978d32 4b3b6ea7513f
children 3c20be4822f7
files
line diff
     1.1 --- a/.hgtags	Thu May 17 15:07:24 2012 +0300
     1.2 +++ b/.hgtags	Thu May 17 15:07:52 2012 +0300
     1.3 @@ -6,3 +6,4 @@
     1.4  5a6948d2bfc5027b833d97276ec4e0e7ee1b292c v3.1.6
     1.5  3eaccd928b81b85e19b0d929e364643d794a2aa5 v3.1.7
     1.6  2338da4560729e5e48ef6822c516c7f1a4fc87db v3.1.8
     1.7 +30b26e89d0850f73d51aafb6e7450962e0bd64b8 v3.1.9
     2.1 --- a/endpoint/WebContent/WEB-INF/beans.xml	Thu May 17 15:07:24 2012 +0300
     2.2 +++ b/endpoint/WebContent/WEB-INF/beans.xml	Thu May 17 15:07:52 2012 +0300
     2.3 @@ -1,49 +1,63 @@
     2.4  <?xml version="1.0" encoding="UTF-8"?>
     2.5 -<beans xmlns="http://www.springframework.org/schema/beans"
     2.6 -	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
     2.7 -	xsi:schemaLocation="http://www.springframework.org/schema/beans 
     2.8 +<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     2.9 +    xmlns:jaxws="http://cxf.apache.org/jaxws"
    2.10 +    xmlns="http://www.springframework.org/schema/beans"
    2.11 +    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    2.12  						http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
    2.13 -						http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
    2.14 -	<import resource="classpath:META-INF/cxf/cxf.xml" />
    2.15 -	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    2.16 -	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
    2.17 +						http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd" >
    2.18  
    2.19 -	<bean id="strabonBean" class="eu.earthobservatory.org.StrabonEndpoint.StrabonBeanWrapper" destroy-method="destroy">
    2.20 -		<constructor-arg type="java.lang.String">
    2.21 -			<!-- Database name -->
    2.22 -			<value>darmstadt-noa</value>
    2.23 -		</constructor-arg>
    2.24 -		<constructor-arg type="java.lang.String">
    2.25 -			<!-- Username -->
    2.26 -			<value>kkyzir</value>
    2.27 -		</constructor-arg>
    2.28 -		<constructor-arg type="java.lang.String">
    2.29 -			<!-- Password -->
    2.30 -			<value>p1r3as</value>
    2.31 -		</constructor-arg>
    2.32 -		<constructor-arg type="int">
    2.33 -			<!-- Port -->
    2.34 -			<value>5432</value>
    2.35 -		</constructor-arg>
    2.36 -		<constructor-arg type="java.lang.String">
    2.37 -			<!-- Database server -->
    2.38 -			<value>localhost</value>
    2.39 -		</constructor-arg>
    2.40 -		<constructor-arg type="boolean">
    2.41 -			<!-- Check for locks and remove them (in case of a crash) -->
    2.42 -			<value>true</value>
    2.43 -		</constructor-arg>
    2.44 -		<constructor-arg type="java.lang.String">
    2.45 -			<!-- Query1 -->
    2.46 -			<value><![CDATA[select * where {?s ?p ?o} limit 10]]></value>
    2.47 -		</constructor-arg>
    2.48 -		<constructor-arg type="java.lang.String">
    2.49 -			<!-- Query2 -->
    2.50 -			<value><![CDATA[# Get all hotspots 
    2.51 -# - in Pelloponesus 
    2.52 -# - at 2007-08-23
    2.53 -# - of firms
    2.54 +    <import resource="classpath:META-INF/cxf/cxf.xml" />
    2.55  
    2.56 +    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    2.57 +
    2.58 +    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
    2.59 +
    2.60 +    <bean
    2.61 +        id="strabonBean"
    2.62 +        class="eu.earthobservatory.org.StrabonEndpoint.StrabonBeanWrapper"
    2.63 +        destroy-method="destroy" >
    2.64 +
    2.65 +        <constructor-arg type="java.lang.String" >
    2.66 +            <!-- Database name -->
    2.67 +            <value>endpoint</value>
    2.68 +        </constructor-arg>
    2.69 +
    2.70 +        <constructor-arg type="java.lang.String" >
    2.71 +            <!-- Username -->
    2.72 +            <value>kkyzir</value>
    2.73 +        </constructor-arg>
    2.74 +
    2.75 +        <constructor-arg type="java.lang.String" >
    2.76 +            <!-- Password -->
    2.77 +            <value>postgresql</value>
    2.78 +        </constructor-arg>
    2.79 +
    2.80 +        <constructor-arg type="int" >
    2.81 +            <!-- Port -->
    2.82 +            <value>5432</value>
    2.83 +        </constructor-arg>
    2.84 +
    2.85 +        <constructor-arg type="java.lang.String" >
    2.86 +            <!-- Database server -->
    2.87 +            <value>localhost</value>
    2.88 +        </constructor-arg>
    2.89 +
    2.90 +        <constructor-arg type="boolean" >
    2.91 +            <!-- Check for locks and remove them (in case of a crash) -->
    2.92 +            <value>true</value>
    2.93 +        </constructor-arg>
    2.94 +
    2.95 +         <constructor-arg>
    2.96 +             <list>
    2.97 +	             <list>
    2.98 +	                 <!-- Bean -->
    2.99 +	                <value>Query</value> 
   2.100 +	                <!-- Format -->
   2.101 +	                <value>HTML</value>   
   2.102 +	                <!-- Label -->
   2.103 +	                <value>Query 1: Discover raw data and products</value> 
   2.104 +	                <!-- Statement -->
   2.105 +	                <value><![CDATA[# Discovering raw data and products
   2.106  PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.107  PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   2.108  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   2.109 @@ -57,47 +71,278 @@
   2.110  PREFIX lgdo: <http://linkedgeodata.org/ontology/>
   2.111  PREFIX gn: <http://www.geonames.org/ontology#>
   2.112  
   2.113 -SELECT ?h ?hGeo ?hAcqTime ?hConfidence ?hConfirmation ?hProvider ?hSensor ?hSatellite
   2.114 +SELECT ?filename
   2.115 +WHERE {?file rdf:type noa:ShpFile ;
   2.116 +	         noa:hasFilename ?filename ;
   2.117 +	         noa:hasAcquisitionTime ?sensingTime .
   2.118 +	 FILTER( str(?sensingTime) >= "2007-08-26T12:00:00" ) .
   2.119 +	 FILTER( str(?sensingTime) <= "2007-08-26T12:30:00" ) .
   2.120 +	 ?file noa:isDerivedFromSensor ?sensor .
   2.121 +	 FILTER( str(?sensor) = "MSG2" ) .
   2.122 +	 ?file noa:producedFromProcessingChain ?chain .
   2.123 +	 FILTER( str(?chain) = "StaticThresholds" ) . 
   2.124 +}]]></value>
   2.125 +	            </list>
   2.126 +	            <list>
   2.127 +	                <!-- Bean -->
   2.128 +	                <value>Query</value> 
   2.129 +	                <!-- Format -->
   2.130 +	                <value>KMZMAP</value>
   2.131 +	                <!-- Label -->
   2.132 +	                <value>Query 2: Discover Hotspots</value> 
   2.133 +	                <!-- Statement -->
   2.134 +	                <value><![CDATA[# Get all hotspots 
   2.135 +# - in Pelloponesus 
   2.136 +# - at 2007-08-24
   2.137 +PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.138 +PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   2.139 +PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   2.140 +PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
   2.141 +PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
   2.142 +PREFIX teleios: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.143 +PREFIX gag: <http://www.semanticweb.org/ontologies/2011/gagKallikratis.rdf#>
   2.144 +PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
   2.145 +PREFIX georss: <http://www.georss.org/georss/>
   2.146 +PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   2.147 +PREFIX lgdo: <http://linkedgeodata.org/ontology/>
   2.148 +PREFIX gn: <http://www.geonames.org/ontology#>
   2.149 +
   2.150 +SELECT ?h ?hAcqTime ?hConfidence ?hConfirmation ?hProvider ?hSensor ?hSatellite (strdf:transform(?hGeo, <http://www.opengis.net/def/crs/EPSG/0/4326>) as ?geo) 
   2.151 +WHERE { ?h 	rdf:type noa:Hotspot;
   2.152 +			noa:hasGeometry ?hGeo;
   2.153 +			noa:hasAcquisitionTime ?hAcqTime;
   2.154 +			noa:hasConfidence ?hConfidence;
   2.155 +			noa:isProducedBy ?hProvider;
   2.156 +			noa:hasConfirmation ?hConfirmation;
   2.157 +			noa:isDerivedFromSensor ?hSensor;
   2.158 +			noa:isDerivedFromSatellite ?hSatellite ;
   2.159 +			noa:producedFromProcessingChain ?hChain .
   2.160 +	FILTER(str(?hChain) = "StaticThresholds").
   2.161 +	FILTER(?hAcqTime = "2007-08-24T14:45:00"^^xsd:dateTime) .
   2.162 +	FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?hGeo)) . 
   2.163 +}]]></value>
   2.164 +	            </list>
   2.165 +				<list>
   2.166 +	                <!-- Bean -->
   2.167 +	                 <value>Update</value>
   2.168 +	                <!-- Format -->
   2.169 +	                <value>HTML</value>
   2.170 +	                <!-- Label -->
   2.171 +	                <value>Update A: Remove hotspots in sea</value> 
   2.172 +	                <!-- Statement -->
   2.173 +	                <value><![CDATA[# Delete hotspots that lie in sea
   2.174 +PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.175 +PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   2.176 +PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   2.177 +PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
   2.178 +PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
   2.179 +PREFIX teleios: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.180 +PREFIX gag: <http://www.semanticweb.org/ontologies/2011/gagKallikratis.rdf#>
   2.181 +PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
   2.182 +PREFIX georss: <http://www.georss.org/georss/>
   2.183 +PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   2.184 +PREFIX lgdo: <http://linkedgeodata.org/ontology/>
   2.185 +PREFIX gn: <http://www.geonames.org/ontology#>
   2.186 +DELETE {?h ?property ?object}
   2.187 +WHERE { ?h 	rdf:type noa:Hotspot;
   2.188 +            noa:hasAcquisitionTime ?hAcqTime;
   2.189 +            noa:producedFromProcessingChain ?hChain;
   2.190 +            noa:hasGeometry ?hGeo;
   2.191 +            ?property ?object.
   2.192 +        FILTER(str(?hChain) = "StaticThresholds").
   2.193 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?hGeo)).
   2.194 +        FILTER("2007-08-24T14:45:00"^^xsd:dateTime = ?hAcqTime).
   2.195 +        OPTIONAL {
   2.196 +            ?c rdf:type noa:Coastline;
   2.197 +               noa:hasGeometry ?cGeo.
   2.198 +            FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?cGeo)).
   2.199 +            FILTER(strdf:anyInteract(?hGeo, ?cGeo)) . 
   2.200 +        }
   2.201 +        FILTER(!bound(?c)). 
   2.202 +}]]></value>
   2.203 +	            </list>
   2.204 +	            <list>
   2.205 +	                <!-- Bean -->
   2.206 +	                <value>Update</value> 
   2.207 +	                <!-- Format -->
   2.208 +	                <value>HTML</value>
   2.209 +	                <!-- Label -->
   2.210 +	                <value>Update B: Refine hotspots in sea</value>
   2.211 +	                <!-- Statement -->
   2.212 +	                <value><![CDATA[# Refine the geometry of hotspots that partially lie in sea
   2.213 +PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.214 +PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   2.215 +PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   2.216 +PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
   2.217 +PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
   2.218 +PREFIX teleios: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.219 +PREFIX gag: <http://www.semanticweb.org/ontologies/2011/gagKallikratis.rdf#>
   2.220 +PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
   2.221 +PREFIX georss: <http://www.georss.org/georss/>
   2.222 +PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   2.223 +PREFIX lgdo: <http://linkedgeodata.org/ontology/>
   2.224 +PREFIX gn: <http://www.geonames.org/ontology#>
   2.225 +
   2.226 +DELETE { ?h noa:hasGeometry ?hGeo}
   2.227 +INSERT { ?h noa:hasGeometry ?dif}
   2.228  WHERE {
   2.229 -    ?h  a noa:Hotspot ; # all
   2.230 -        noa:hasGeometry ?hGeo ; # all
   2.231 -        noa:hasAcquisitionTime ?hAcqTime ; # all
   2.232 -        FILTER( "2007-08-24T00:00:00"^^xsd:dateTime <= ?hAcqTime && ?hAcqTime <= "2007-09-24T00:00:00"^^xsd:dateTime$
   2.233 -}
   2.234 -]]></value>
   2.235 -		</constructor-arg>
   2.236 -		<constructor-arg type="java.lang.String">
   2.237 -			<!-- Query3 -->
   2.238 -			<value><![CDATA[PREFIX+noa%3A+<http%3A%2F%2Fteleios.di.uoa.gr%2Fontologies%2FnoaOntology.owl%23>%0D%0APREFIX+clc%3A+<http%3A%2F%2Fteleios.di.uoa.gr%2Fontologies%2FclcOntology.owl%23>%0D%0APREFIX+rdf%3A+<http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23>%0D%0APREFIX+rdfs%3A+<http%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23>%0D%0APREFIX+strdf%3A+<http%3A%2F%2Fstrdf.di.uoa.gr%2Fontology%23>%0D%0APREFIX+teleios%3A+<http%3A%2F%2Fteleios.di.uoa.gr%2Fontologies%2FnoaOntology.owl%23>%0D%0APREFIX+gag%3A+<http%3A%2F%2Fwww.semanticweb.org%2Fontologies%2F2011%2FgagKallikratis.rdf%23>%0D%0APREFIX+geo%3A+<http%3A%2F%2Fwww.w3.org%2F2003%2F01%2Fgeo%2Fwgs84_pos%23>%0D%0APREFIX+georss%3A+<http%3A%2F%2Fwww.georss.org%2Fgeorss%2F>%0D%0APREFIX+xsd%3A+<http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23>%0D%0APREFIX+lgdo%3A+<http%3A%2F%2Flinkedgeodata.org%2Fontology%2F>%0D%0APREFIX+gn%3A+<http%3A%2F%2Fwww.geonames.org%2Fontology%23>%0D%0A%0D%0ASELECT+%3Fn+%3FnGeo+%3FnType+%3FnLabel%0D%0A{%0D%0A++++%3Fn++a+%3FnType+%3B%0D%0A++++++++geo%3Ageometry+%3FnGeo+%3B%0D%0A++++++++rdfs%3Alabel+%3FnLabel+.%0D%0A++++++++FILTER(+%3FnType+%3D+lgdo%3AHospital+||+%3FnType+%3D+lgdo%3AAerodrome+||+%3FnType+%3D+lgdo%3ARailway+)+.%0D%0A++++++++FILTER(++strdf%3Acontains(%22POLYGON((21.027+38.36%2C+23.77+38.36%2C+23.77+36.05%2C+21.027+36.05%2C+21.027+38.36))%22^^strdf%3AWKT%2C+%3FnGeo)+)+.%0D%0A}&format=KML]]></value>
   2.239 -		</constructor-arg>
   2.240 -		<constructor-arg type="java.lang.String">
   2.241 -			<!-- Query4 -->
   2.242 -			<value><![CDATA[%23+Get+all+Perfectures%0D%0A%23+-+in+Pelloponesus%0D%0A%0D%0A%23real%090m31.239s%0D%0A%23user%090m8.060s%0D%0A%23sys%090m0.480s%0D%0A%0D%0APREFIX+noa%3A+<http%3A%2F%2Fteleios.di.uoa.gr%2Fontologies%2FnoaOntology.owl%23>%0D%0APREFIX+clc%3A+<http%3A%2F%2Fteleios.di.uoa.gr%2Fontologies%2FclcOntology.owl%23>%0D%0APREFIX+rdf%3A+<http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23>%0D%0APREFIX+rdfs%3A+<http%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23>%0D%0APREFIX+strdf%3A+<http%3A%2F%2Fstrdf.di.uoa.gr%2Fontology%23>%0D%0APREFIX+teleios%3A+<http%3A%2F%2Fteleios.di.uoa.gr%2Fontologies%2FnoaOntology.owl%23>%0D%0APREFIX+gag%3A+<http%3A%2F%2Fwww.semanticweb.org%2Fontologies%2F2011%2FgagKallikratis.rdf%23>%0D%0APREFIX+geo%3A+<http%3A%2F%2Fwww.w3.org%2F2003%2F01%2Fgeo%2Fwgs84_pos%23>%0D%0APREFIX+georss%3A+<http%3A%2F%2Fwww.georss.org%2Fgeorss%2F>%0D%0APREFIX+xsd%3A+<http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23>%0D%0APREFIX+lgdo%3A+<http%3A%2F%2Flinkedgeodata.org%2Fontology%2F>%0D%0APREFIX+gn%3A+<http%3A%2F%2Fwww.geonames.org%2Fontology%23>%0D%0A%0D%0ASELECT+%3Fg+%3FgYpesCode+%3FgContainer+%3FgLabel+(+strdf%3Aboundary(%3FgGeog)+as+%3FgBoundary+)%0D%0AWHERE+{%0D%0A++++%3Fg++a+gag%3ADhmos+%3B%0D%0A++++++++noa%3AhasYpesCode+%3FgYpesCode+%3B%0D%0A++++++++gag%3AisPartOf+%3FgContainer+%3B%0D%0A++++++++rdfs%3Alabel+%3FgLabel+%3B%0D%0A++++++++strdf%3AhasGeometry+%3FgGeog+.%0D%0A++++FILTER(++strdf%3Acontains(%22POLYGON((21.027+38.36%2C+23.77+38.36%2C+23.77+36.05%2C+21.027+36.05%2C+21.027+38.36))%22^^strdf%3AWKT%2C+%3FgGeog)+)+.%0D%0A}&format=KML]]></value>
   2.243 -		</constructor-arg>
   2.244 -		<constructor-arg type="java.lang.String">
   2.245 -			<!-- Query5 -->
   2.246 -			<value><![CDATA[%23+Get+all+Prefectures%0D%0A%23+-+in+Pelloponesus%0D%0A%0D%0A%23real%090m31.239s%0D%0A%23user%090m8.060s%0D%0A%23sys%090m0.480s%0D%0A%0D%0APREFIX+noa%3A+<http%3A%2F%2Fteleios.di.uoa.gr%2Fontologies%2FnoaOntology.owl%23>%0D%0APREFIX+clc%3A+<http%3A%2F%2Fteleios.di.uoa.gr%2Fontologies%2FclcOntology.owl%23>%0D%0APREFIX+rdf%3A+<http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23>%0D%0APREFIX+rdfs%3A+<http%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23>%0D%0APREFIX+strdf%3A+<http%3A%2F%2Fstrdf.di.uoa.gr%2Fontology%23>%0D%0APREFIX+teleios%3A+<http%3A%2F%2Fteleios.di.uoa.gr%2Fontologies%2FnoaOntology.owl%23>%0D%0APREFIX+gag%3A+<http%3A%2F%2Fwww.semanticweb.org%2Fontologies%2F2011%2FgagKallikratis.rdf%23>%0D%0APREFIX+geo%3A+<http%3A%2F%2Fwww.w3.org%2F2003%2F01%2Fgeo%2Fwgs84_pos%23>%0D%0APREFIX+georss%3A+<http%3A%2F%2Fwww.georss.org%2Fgeorss%2F>%0D%0APREFIX+xsd%3A+<http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23>%0D%0APREFIX+lgdo%3A+<http%3A%2F%2Flinkedgeodata.org%2Fontology%2F>%0D%0APREFIX+gn%3A+<http%3A%2F%2Fwww.geonames.org%2Fontology%23>%0D%0A%0D%0ASELECT+%3Fg+%3FgYpesCode+%3FgContainer+%3FgLabel+(+strdf%3Aboundary(%3FgGeog)+as+%3FgBoundary+)%0D%0AWHERE+{%0D%0A++++%3Fg++a+gag%3ADhmos+%3B%0D%0A++++++++noa%3AhasYpesCode+%3FgYpesCode+%3B%0D%0A++++++++gag%3AisPartOf+%3FgContainer+%3B%0D%0A++++++++rdfs%3Alabel+%3FgLabel+%3B%0D%0A++++++++strdf%3AhasGeometry+%3FgGeog+.%0D%0A++++FILTER(++strdf%3Acontains(%22POLYGON((21.027+38.36%2C+23.77+38.36%2C+23.77+36.05%2C+21.027+36.05%2C+21.027+38.36))%22^^strdf%3AWKT%2C+%3FgGeog)+)+.%0D%0A}&format=KML]]></value>
   2.247 -		</constructor-arg>
   2.248 -		<constructor-arg type="java.lang.String">
   2.249 -			<!-- Query6 -->
   2.250 -                        <value><![CDATA[]]></value>
   2.251 -		</constructor-arg>
   2.252 -		<constructor-arg type="java.lang.String">
   2.253 -			<!-- Query7 -->
   2.254 -                        <value><![CDATA[]]></value>
   2.255 -		</constructor-arg>
   2.256 -		<constructor-arg type="java.lang.String">
   2.257 -			<!-- Query8 -->
   2.258 -                        <value><![CDATA[]]></value>
   2.259 -		</constructor-arg>
   2.260 -                <constructor-arg type="java.lang.String">
   2.261 -                        <!-- Default format -->
   2.262 -                        <value><![CDATA[format=KMZMAP]]></value>
   2.263 -                </constructor-arg>
   2.264 -	</bean>
   2.265 +SELECT DISTINCT ?h ?hGeo (strdf:intersection(?hGeo, strdf:union(?cGeo)) AS ?dif)
   2.266 +WHERE { ?h rdf:type noa:Hotspot;
   2.267 +           noa:hasAcquisitionTime ?hAcqTime;
   2.268 +           noa:producedFromProcessingChain ?hChain;
   2.269 +           noa:hasGeometry ?hGeo.
   2.270 +        FILTER("2007-08-24T14:45:00"^^xsd:dateTime = ?hAcqTime).
   2.271 +        FILTER(str(?hChain) = "StaticThresholds").
   2.272 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?hGeo)).
   2.273 +        ?c rdf:type noa:Coastline ;
   2.274 +           noa:hasGeometry ?cGeo .
   2.275 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?cGeo)).
   2.276 +        FILTER(strdf:anyInteract(?hGeo, ?cGeo)).}
   2.277 +        GROUP BY ?h ?hGeo
   2.278 +        HAVING strdf:overlap(?hGeo, strdf:union(?cGeo)) 
   2.279 +}]]></value>
   2.280 +	            </list>
   2.281 +	            <list>
   2.282 +	                <!-- Bean -->
   2.283 +	                <value>Query</value> 
   2.284 +	                <!-- Format -->
   2.285 +	                <value>KMZMAP</value>
   2.286 +	                <!-- Label -->
   2.287 +	                <value>Query 3: Discover coniferous forests</value> 
   2.288 +	                <!-- Statement -->
   2.289 +	                <value><![CDATA[#Get all coniferous forests in Peloponnese
   2.290 +PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.291 +PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   2.292 +PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   2.293 +PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
   2.294 +PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
   2.295 +PREFIX teleios: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.296 +PREFIX gag: <http://www.semanticweb.org/ontologies/2011/gagKallikratis.rdf#>
   2.297 +PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
   2.298 +PREFIX georss: <http://www.georss.org/georss/>
   2.299 +PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   2.300 +PREFIX lgdo: <http://linkedgeodata.org/ontology/>
   2.301 +PREFIX gn: <http://www.geonames.org/ontology#>
   2.302  
   2.303 -<!-- 	<bean id="queryBean" class="eu.earthobservatory.org.StrabonEndpoint.QueryBean"> -->
   2.304 -<!-- 		<property name="strabon" ref="strabonBean" /> -->
   2.305 -<!-- 	</bean> -->
   2.306 +SELECT ?a ?aGeo
   2.307 +WHERE{ ?a rdf:type clc:Area;
   2.308 +          clc:hasLandUse ?aLandUse;
   2.309 +          noa:hasGeometry ?aGeo.
   2.310 +       ?aLandUse rdf:type ?aLandUseType.
   2.311 +       FILTER(?aLandUseType = clc:ConiferousForest).
   2.312 +       FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^strdf:WKT,?aGeo)). 
   2.313 +}]]></value>
   2.314 +	            </list>
   2.315 +	            <list>
   2.316 +	                <!-- Bean -->
   2.317 +	                <value>Query</value> 
   2.318 +	                <!-- Format -->
   2.319 +	                <value>KMZMAP</value>
   2.320 +	                <!-- Label -->
   2.321 +	                <value>Query 4: Discover primary roads</value> 
   2.322 +	                <!-- Statement -->
   2.323 +	                <value><![CDATA[# Get all municipalities of Pelloponnese
   2.324 +PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.325 +PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   2.326 +PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   2.327 +PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
   2.328 +PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
   2.329 +PREFIX teleios: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.330 +PREFIX gag: <http://www.semanticweb.org/ontologies/2011/gagKallikratis.rdf#>
   2.331 +PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
   2.332 +PREFIX georss: <http://www.georss.org/georss/>
   2.333 +PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   2.334 +PREFIX lgdo: <http://linkedgeodata.org/lontology/>
   2.335 +PREFIX gn: <http://www.geonames.org/ontology#>
   2.336  
   2.337 -</beans>
   2.338 +SELECT  ?d ?dGeo
   2.339 +WHERE { ?d rdf:type gag:Dhmos; 
   2.340 +           strdf:hasGeometry ?dGeo; 
   2.341 +           rdfs:label ?dLabel. 
   2.342 +           FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?dGeo)). 
   2.343 +}]]></value>
   2.344 +	            </list>
   2.345 +	            <list>
   2.346 +	                <!-- Bean -->
   2.347 +	                <value>Query</value> 
   2.348 +	                <!-- Format -->
   2.349 +	                <value>KMZMAP</value>
   2.350 +	                <!-- Label -->
   2.351 +	                <value>Query 5: Get all primary roads in Pelloponnese</value> 
   2.352 +	                <!-- Statement -->
   2.353 +	                <value><![CDATA[# Get all primary roads in Pelloponnese
   2.354 +PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.355 +PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   2.356 +PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   2.357 +PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
   2.358 +PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
   2.359 +PREFIX teleios: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.360 +PREFIX gag: <http://www.semanticweb.org/ontologies/2011/gagKallikratis.rdf#>
   2.361 +PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
   2.362 +PREFIX georss: <http://www.georss.org/georss/>
   2.363 +PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   2.364 +PREFIX lgdo: <http://linkedgeodata.org/ontology/>
   2.365 +PREFIX gn: <http://www.geonames.org/ontology#>
   2.366 +
   2.367 +SELECT  ?r ?rGeo
   2.368 +WHERE { ?r rdf:type ?rType ;
   2.369 +           noa:hasGeometry ?rGeo .
   2.370 +        FILTER(?rType = lgdo:Primary) .
   2.371 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05,21.027 38.36))"^^strdf:WKT, ?rGeo) ). 
   2.372 +}]]></value>
   2.373 +	            </list>
   2.374 +	            <list>
   2.375 +	                <!-- Bean -->
   2.376 +	                <value>Query</value> 
   2.377 +	                <!-- Format -->
   2.378 +	                <value>KMZMAP</value>
   2.379 +	                <!-- Label -->
   2.380 +	                <value>Query 6: Discover hotspots</value> 
   2.381 +	                <!-- Statement -->
   2.382 +	                <value><![CDATA[# Get all hotspots 
   2.383 +# - in Pelloponesus 
   2.384 +# - at 2007-08-24
   2.385 +PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.386 +PREFIX clc: <http://teleios.di.uoa.gr/ontologies/clcOntology.owl#>
   2.387 +PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   2.388 +PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
   2.389 +PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
   2.390 +PREFIX teleios: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   2.391 +PREFIX gag: <http://www.semanticweb.org/ontologies/2011/gagKallikratis.rdf#>
   2.392 +PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
   2.393 +PREFIX georss: <http://www.georss.org/georss/>
   2.394 +PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   2.395 +PREFIX lgdo: <http://linkedgeodata.org/ontology/>
   2.396 +PREFIX gn: <http://www.geonames.org/ontology#>
   2.397 +
   2.398 +SELECT  ?h ?hAcqTime (strdf:transform(?hGeo, <http://www.opengis.net/def/crs/EPSG/0/4326>) as ?geo) 
   2.399 +WHERE { ?h 	rdf:type noa:Hotspot;
   2.400 +            noa:hasGeometry ?hGeo;
   2.401 +            noa:hasAcquisitionTime ?hAcqTime;
   2.402 +            noa:producedFromProcessingChain ?hChain .
   2.403 +        FILTER(str(?hChain) = "StaticThresholds").
   2.404 +        FILTER(?hAcqTime = "2007-08-24T14:45:00"^^xsd:dateTime) .
   2.405 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^ strdf:WKT, ?hGeo)) . 
   2.406 +        ?a rdf:type clc:Area;
   2.407 +           clc:hasLandUse ?aLandUse;
   2.408 +           noa:hasGeometry ?aGeo.
   2.409 +        ?aLandUse rdf:type ?aLandUseType.
   2.410 +        FILTER(?aLandUseType = clc:Forest).
   2.411 +        FILTER(strdf:contains("POLYGON((21.027 38.36, 23.77 38.36, 23.77 36.05, 21.027 36.05, 21.027 38.36))"^^strdf:WKT,?aGeo)). 
   2.412 +        FILTER(strdf:overlap(?aGeo, ?hGeo)) . 
   2.413 +}]]></value>
   2.414 +	            </list>
   2.415 +<!-- 	            <list> -->
   2.416 +<!-- 	                Bean -->
   2.417 +<!-- 	                <value>Query</value>  -->
   2.418 +<!-- 	                Format -->
   2.419 +<!-- 	                <value>KMZMAP</value> -->
   2.420 +<!-- 	                Label -->
   2.421 +<!-- 	                <value></value>  -->
   2.422 +<!-- 	                Statement -->
   2.423 +<!-- 	                <value></value> -->
   2.424 +<!-- 	            </list> -->
   2.425 +            </list>
   2.426 +         </constructor-arg>
   2.427 +    </bean>
   2.428 +</beans>
   2.429 \ No newline at end of file
     3.1 --- a/endpoint/pom.xml	Thu May 17 15:07:24 2012 +0300
     3.2 +++ b/endpoint/pom.xml	Thu May 17 15:07:52 2012 +0300
     3.3 @@ -4,7 +4,7 @@
     3.4  	<parent>
     3.5  		<groupId>eu.earthobservatory</groupId>
     3.6  		<artifactId>strabon</artifactId>
     3.7 -		<version>3.1.9-SNAPSHOT</version>
     3.8 +		<version>3.1.10-SNAPSHOT</version>
     3.9  	</parent>
    3.10  
    3.11  	<artifactId>strabon-endpoint</artifactId>
     4.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Thu May 17 15:07:24 2012 +0300
     4.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Thu May 17 15:07:52 2012 +0300
     4.3 @@ -12,7 +12,11 @@
     4.4  import java.net.URLEncoder;
     4.5  import java.security.SecureRandom;
     4.6  import java.util.Date;
     4.7 +import java.util.HashMap;
     4.8 +import java.util.Hashtable;
     4.9  import java.util.Iterator;
    4.10 +import java.util.List;
    4.11 +import java.util.Map;
    4.12  import java.util.zip.ZipEntry;
    4.13  import java.util.zip.ZipOutputStream;
    4.14  
    4.15 @@ -31,6 +35,8 @@
    4.16  import org.springframework.web.context.WebApplicationContext;
    4.17  import org.springframework.web.context.support.WebApplicationContextUtils;
    4.18  
    4.19 +import eu.earthobservatory.org.StrabonEndpoint.StrabonBeanWrapper.Entry;
    4.20 +
    4.21  
    4.22  public class QueryBean extends HttpServlet {
    4.23  
    4.24 @@ -231,7 +237,7 @@
    4.25  			if (hive.getSPARQLQuery() != null)
    4.26  				out.write(hive.getSPARQLQuery());
    4.27  
    4.28 -			appendHTML2(out);
    4.29 +			appendHTML2(out, hive.getFormat());
    4.30  
    4.31  			out.append("</table></td></tr></table>");
    4.32  
    4.33 @@ -313,7 +319,7 @@
    4.34  			if (hive.getSPARQLQuery() != null)
    4.35  				out.write(hive.getSPARQLQuery());
    4.36  
    4.37 -			appendHTML2(out);
    4.38 +			appendHTML2(out, hive.getFormat());
    4.39  
    4.40  			out.append("</table></td></tr></table>");
    4.41  
    4.42 @@ -381,7 +387,7 @@
    4.43  			if (hive.getSPARQLQuery() != null)
    4.44  				out.write(hive.getSPARQLQuery());
    4.45  
    4.46 -			appendHTML2(out);
    4.47 +			appendHTML2(out, hive.getFormat());
    4.48  
    4.49  			String answer = "";
    4.50  			if (hive.getSPARQLQuery() != null) {
    4.51 @@ -540,17 +546,34 @@
    4.52  		out.println("<td style=\"border: 1px dashed #bbbbbb;\"><textarea name=\"SPARQLQuery\" rows=\"15\" cols=\"100\">");
    4.53  	}
    4.54  
    4.55 -	protected static void appendHTML2(PrintWriter out) {
    4.56 +	protected static void appendHTML2(PrintWriter out, String format) {
    4.57  		out.println("</textarea></td>");
    4.58  		//		out.println("<td style=\"border: 1px dashed #bbbbbb;\"><input type=\"radio\" name=\"format\" value=\"KML\">KML<br/>");
    4.59  		//		out.println("<input type=\"radio\" name=\"format\" value=\"HTML\">HTML</td>");
    4.60  		out.println("<td style=\"border: 1px dashed #bbbbbb;\"><center>Output Format:<br/><select name=\"format\">");
    4.61 -		out.println("	<option value=\"KMZMAP\">HTML with google maps (kmz)</option>");
    4.62 -		out.println("	<option value=\"KMLMAP\">HTML with google maps (kml)</option>");
    4.63 -		out.println("	<option value=\"HTML\">HTML</option>");
    4.64 -		out.println("	<option value=\"KML\">KML</option>");
    4.65 -		out.println("	<option value=\"XML\">XML</option>");
    4.66 -		out.println("	<option value=\"GEOJSON\">GeoJSON</option>");
    4.67 +		
    4.68 +		Map<String, String> selections = new HashMap<String, String>();
    4.69 +		selections.put("KMZMAP", "HTML with google maps (kmz)");
    4.70 +		selections.put("KMLMAP", "HTML with google maps (kml)");
    4.71 +		selections.put("HTML", "HTML");
    4.72 +		//selections.put("KMZ", "KZM file");
    4.73 +		selections.put("KML", "KML file");
    4.74 +		selections.put("XML", "XML");
    4.75 +		selections.put("GEOJSON", "GeoJSON");
    4.76 +		
    4.77 +		Iterator <String> it = selections.keySet().iterator();
    4.78 +		
    4.79 +		while (it.hasNext()) {
    4.80 +			String key = it.next();
    4.81 +			String value = selections.get(key);
    4.82 +			out.print("<option ");
    4.83 +			if (key.equalsIgnoreCase(format))
    4.84 +				out.print("selected");
    4.85 +			
    4.86 +			out.println(" value=\"" + key + "\">" + value + "</option>");
    4.87 +		}
    4.88 +		
    4.89 +		
    4.90  		out.println("</select></center></td>");
    4.91  		out.println("</tr>");
    4.92  		out.println("<tr>");
    4.93 @@ -579,14 +602,27 @@
    4.94  
    4.95  	protected static void appendHTMLQ(PrintWriter out, StrabonBeanWrapper strabonWrapper) throws UnsupportedEncodingException {
    4.96  		out.println("<tr><td width=\"90\">");
    4.97 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery1(), "UTF-8")+ "&" + strabonWrapper.getFormat() + "\">&nbsp;&middot;&nbsp;Query 1</a></br> ");		
    4.98 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery2(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 2</a></br> ");
    4.99 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery3(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 3</a></br> ");
   4.100 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery4(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 4</a></br> ");
   4.101 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery5(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 5</a></br> ");
   4.102 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery6(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 6</a></br> ");
   4.103 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery7(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 7</a></br>");
   4.104 -		out.println("<a href=\"Query?SPARQLQuery="+URLEncoder.encode(strabonWrapper.getQuery8(), "UTF-8")+ "&" + strabonWrapper.getFormat() +"\">&nbsp;&middot;&nbsp;Query 8</a> ");
   4.105 +		List<Entry> entries = strabonWrapper.getEntries();
   4.106 +		Iterator<Entry> it = entries.iterator();
   4.107 +		while (it.hasNext()) {
   4.108 +			Entry entry = it.next();
   4.109 +			out.println(createLink(entry));
   4.110 +		}
   4.111  		out.println("</td></tr> ");
   4.112  	}
   4.113 +	
   4.114 +	private static String createLink(Entry entry) throws UnsupportedEncodingException {
   4.115 +		StringBuffer buf = new StringBuffer(1024);
   4.116 +		buf.append("<a href=\"");
   4.117 +		buf.append(entry.getBean());
   4.118 +		buf.append("?SPARQLQuery=");
   4.119 +		buf.append(URLEncoder.encode(entry.getStatement(), "UTF-8"));
   4.120 +		buf.append("&format=");
   4.121 +		buf.append(entry.getFormat());
   4.122 +		buf.append("\">&nbsp;&middot;&nbsp;");
   4.123 +		buf.append(entry.getLabel());
   4.124 +		buf.append("</a><br/>");
   4.125 +		
   4.126 +		return buf.toString();
   4.127 +	}
   4.128  }
     5.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java	Thu May 17 15:07:24 2012 +0300
     5.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java	Thu May 17 15:07:52 2012 +0300
     5.3 @@ -3,8 +3,13 @@
     5.4  import java.io.IOException;
     5.5  import java.io.StringReader;
     5.6  import java.net.URL;
     5.7 +import java.sql.Array;
     5.8  import java.sql.SQLException;
     5.9 +import java.util.ArrayList;
    5.10 +import java.util.Iterator;
    5.11 +import java.util.List;
    5.12  
    5.13 +import org.hsqldb.lib.Collection;
    5.14  import org.openrdf.model.Resource;
    5.15  import org.openrdf.query.MalformedQueryException;
    5.16  import org.openrdf.query.QueryEvaluationException;
    5.17 @@ -16,73 +21,150 @@
    5.18  import eu.earthobservatory.runtime.postgis.Strabon;
    5.19  
    5.20  public class StrabonBeanWrapper implements org.springframework.beans.factory.DisposableBean {
    5.21 +	public class Entry {
    5.22 +		private String label;
    5.23 +		private String bean;
    5.24 +		private String statement;
    5.25 +		private String format;
    5.26 +
    5.27 +		public Entry(String label, String bean, String statement, String format) {
    5.28 +			this.label = label;
    5.29 +			this.bean = bean;
    5.30 +			this.statement = statement;
    5.31 +			this.format = format;
    5.32 +		}
    5.33 +		public String getLabel() {
    5.34 +			return label;
    5.35 +		}
    5.36 +		public void setLabel(String label) {
    5.37 +			this.label = label;
    5.38 +		}
    5.39 +		public String getBean() {
    5.40 +			return bean;
    5.41 +		}
    5.42 +		public void setBean(String bean) {
    5.43 +			this.bean = bean;
    5.44 +		}
    5.45 +		public String getStatement() {
    5.46 +			return statement;
    5.47 +		}
    5.48 +		public void setStatement(String statement) {
    5.49 +			this.statement = statement;
    5.50 +		}
    5.51 +		public String getFormat() {
    5.52 +			return format;
    5.53 +		}
    5.54 +		public void setFormat(String format) {
    5.55 +			this.format = format;
    5.56 +		}
    5.57 +	}
    5.58 +
    5.59  	private String serverName;
    5.60  	private int port;
    5.61  	private String databaseName;
    5.62  	private String user;
    5.63  	private String password;
    5.64 -	
    5.65 +
    5.66  	private Strabon strabon = null;
    5.67  	private boolean checkForLockTable;
    5.68 -	private String query1;
    5.69 -	private String query2;
    5.70 -	private String query3;
    5.71 -	private String query4;
    5.72 -	private String query5;
    5.73 -	private String query6;
    5.74 -	private String query7;
    5.75 -	private String query8;
    5.76 -	private String format;
    5.77 -	
    5.78 +	private List<Entry> entries;
    5.79 +
    5.80  	public StrabonBeanWrapper() {
    5.81  		this.strabon = null;
    5.82  	}
    5.83 -	
    5.84 +
    5.85  	public StrabonBeanWrapper(Strabon strabon) {
    5.86  		this.strabon = strabon;
    5.87  	}
    5.88 -	
    5.89 -	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable, String query1, String query2, String query3, String query4, String query5, String query6, String query7, String query8) {
    5.90 +
    5.91 +//	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable, String query1, String query2, String query3, String query4, String query5, String query6, String query7, String query8) {
    5.92 +//		this.serverName = serverName;
    5.93 +//		this.port = port;
    5.94 +//		this.databaseName = databaseName;
    5.95 +//		this.user = user;
    5.96 +//		this.password = password;
    5.97 +//		this.checkForLockTable = checkForLockTable;
    5.98 +//		//this.strabon = new Strabon(databaseName, user, password, port, serverName, checkForLockTable);
    5.99 +//		this.query1 = query1;/
   5.100 +//		this.query2 = query2;
   5.101 +//		this.query3 = query3;
   5.102 +//		this.query4 = query4;
   5.103 +//		this.query5 = query5;
   5.104 +//		this.query6 = query6;
   5.105 +//		this.query7 = query7;
   5.106 +//		this.query8 = query8;
   5.107 +//		format = "format=HTML";
   5.108 +//		init();
   5.109 +//	}
   5.110 +//
   5.111 +//	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable, String query1, String query2, String query3, String query4, String query5, String query6, String query7, String query8, String format) {
   5.112 +//		this.serverName = serverName;
   5.113 +//		this.port = port;
   5.114 +//		this.databaseName = databaseName;
   5.115 +//		this.user = user;
   5.116 +//		this.password = password;
   5.117 +//		this.checkForLockTable = checkForLockTable;
   5.118 +//		//this.strabon = new Strabon(databaseName, user, password, port, serverName, checkForLockTable);
   5.119 +//		this.query1 = query1;
   5.120 +//		this.query2 = query2;
   5.121 +//		this.query3 = query3;
   5.122 +//		this.query4 = query4;
   5.123 +//		this.query5 = query5;
   5.124 +//		this.query6 = query6;
   5.125 +//		this.query7 = query7;
   5.126 +//		this.query8 = query8;
   5.127 +//		this.format = format;
   5.128 +//
   5.129 +//		init();
   5.130 +//	}
   5.131 +
   5.132 +	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable, List<List> args) {
   5.133  		this.serverName = serverName;
   5.134  		this.port = port;
   5.135  		this.databaseName = databaseName;
   5.136  		this.user = user;
   5.137  		this.password = password;
   5.138  		this.checkForLockTable = checkForLockTable;
   5.139 -		//this.strabon = new Strabon(databaseName, user, password, port, serverName, checkForLockTable);
   5.140 -		this.query1 = query1;
   5.141 -		this.query2 = query2;
   5.142 -		this.query3 = query3;
   5.143 -		this.query4 = query4;
   5.144 -		this.query5 = query5;
   5.145 -		this.query6 = query6;
   5.146 -		this.query7 = query7;
   5.147 -		this.query8 = query8;
   5.148 -		format = "format=HTML";
   5.149 +		this.entries = new ArrayList<StrabonBeanWrapper.Entry>(args.size());
   5.150 +		
   5.151 +		Iterator<List> entryit = args.iterator();
   5.152 +		
   5.153 +		while (entryit.hasNext()) {
   5.154 +			List list = entryit.next();
   5.155 +			Iterator<String> it = list.iterator();
   5.156 +			
   5.157 +			while (it.hasNext()) {
   5.158 +				int items = 0;
   5.159 +				String label = "", bean = "'", statement = "", format = ""; 
   5.160 +	
   5.161 +				if (it.hasNext()) {
   5.162 +					bean = it.next();
   5.163 +					items++;
   5.164 +				}
   5.165 +				if (it.hasNext()) {
   5.166 +					format = it.next();
   5.167 +					items++;
   5.168 +				}
   5.169 +				if (it.hasNext()) {
   5.170 +					label = it.next();
   5.171 +					items++;
   5.172 +				}
   5.173 +				if (it.hasNext()) {
   5.174 +					statement = it.next();
   5.175 +					items++;
   5.176 +				}
   5.177 +				
   5.178 +				
   5.179 +				if (items == 4) {
   5.180 +					Entry entry = new Entry(label, bean, statement, format);
   5.181 +					this.entries.add(entry);
   5.182 +				}
   5.183 +			}
   5.184 +		}
   5.185 +
   5.186  		init();
   5.187  	}
   5.188 -	
   5.189 -	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable, String query1, String query2, String query3, String query4, String query5, String query6, String query7, String query8, String format) {
   5.190 -		this.serverName = serverName;
   5.191 -		this.port = port;
   5.192 -		this.databaseName = databaseName;
   5.193 -		this.user = user;
   5.194 -		this.password = password;
   5.195 -		this.checkForLockTable = checkForLockTable;
   5.196 -		//this.strabon = new Strabon(databaseName, user, password, port, serverName, checkForLockTable);
   5.197 -		this.query1 = query1;
   5.198 -		this.query2 = query2;
   5.199 -		this.query3 = query3;
   5.200 -		this.query4 = query4;
   5.201 -		this.query5 = query5;
   5.202 -		this.query6 = query6;
   5.203 -		this.query7 = query7;
   5.204 -		this.query8 = query8;
   5.205 -		this.format = format;
   5.206 -		
   5.207 -		init();
   5.208 -	}
   5.209 -	
   5.210 +
   5.211  	private boolean init() {
   5.212  		if (this.strabon == null) {
   5.213  			try {
   5.214 @@ -96,10 +178,10 @@
   5.215  				return false;
   5.216  			}
   5.217  		}
   5.218 -		
   5.219 +
   5.220  		return true;
   5.221  	}
   5.222 -	
   5.223 +
   5.224  	public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName) throws SQLException, ClassNotFoundException {
   5.225  		this.strabon = new Strabon(databaseName, user, password, port, serverName, true);
   5.226  	}
   5.227 @@ -115,35 +197,35 @@
   5.228  	public void destroy() throws Exception {
   5.229  		strabon.close();
   5.230  	}
   5.231 -	
   5.232 -	
   5.233 -	
   5.234 +
   5.235 +
   5.236 +
   5.237  	public Object query(String queryString, String answerFormatStrabon) throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, ClassNotFoundException {
   5.238  		if ((this.strabon == null) && (!init())) {
   5.239  			throw new RepositoryException("Could not connect to Strabon.");
   5.240  		} 
   5.241 -		
   5.242 +
   5.243  		return strabon.query(queryString, answerFormatStrabon, strabon.getSailRepoConnection());
   5.244  	}
   5.245 -	
   5.246 +
   5.247  	public Object update(String updateString, String answerFormatStrabon) throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, ClassNotFoundException {
   5.248  		if ((this.strabon == null) && (!init())) {
   5.249  			throw new RepositoryException("Could not connect to Strabon.");
   5.250  		} 
   5.251 -		
   5.252 -    	//String newQueryString = TemporalWrapper.rebuildQuery(queryString);
   5.253 -    	
   5.254 -    	System.out.println("================================================================");
   5.255 -    	System.out.println("Update:");
   5.256 -    	System.out.println(updateString);
   5.257 -    	System.out.println("================================================================");
   5.258 -    	System.out.println("Answer format: " + answerFormatStrabon);
   5.259 -    	System.out.println("================================================================");
   5.260 -    	//System.out.println("Rewritten query:");
   5.261 -    	//System.out.println(newQueryString);
   5.262 -    	//System.out.println("================================================================");
   5.263 -		
   5.264 -   		//return strabon.query(newQueryString, answerFormatStrabon, strabon.getSailRepoConnection());
   5.265 +
   5.266 +		//String newQueryString = TemporalWrapper.rebuildQuery(queryString);
   5.267 +
   5.268 +		System.out.println("================================================================");
   5.269 +		System.out.println("Update:");
   5.270 +		System.out.println(updateString);
   5.271 +		System.out.println("================================================================");
   5.272 +		System.out.println("Answer format: " + answerFormatStrabon);
   5.273 +		System.out.println("================================================================");
   5.274 +		//System.out.println("Rewritten query:");
   5.275 +		//System.out.println(newQueryString);
   5.276 +		//System.out.println("================================================================");
   5.277 +
   5.278 +		//return strabon.query(newQueryString, answerFormatStrabon, strabon.getSailRepoConnection());
   5.279  		strabon.update(updateString, strabon.getSailRepoConnection());
   5.280  		return "OK!";
   5.281  	}
   5.282 @@ -169,26 +251,26 @@
   5.283  		if ((this.strabon == null) && (!init())) {
   5.284  			throw new RepositoryException("Could not connect to Strabon.");
   5.285  		}
   5.286 -		
   5.287 +
   5.288  		// get sail connection
   5.289  		SailRepositoryConnection conn = strabon.getSailRepoConnection();
   5.290 -		
   5.291 +
   5.292  		try {
   5.293  			// store data
   5.294  			if (url) {
   5.295  				conn.add(new URL(source_data), "", format, new Resource[1]);
   5.296 -				
   5.297 +
   5.298  			} else {
   5.299  				conn.add(new StringReader(source_data), "", format, new Resource[1]);
   5.300  			}
   5.301 -			
   5.302 +
   5.303  		} catch (Exception e) {
   5.304  			throw e;
   5.305  		}
   5.306 -		
   5.307 -    	return true;
   5.308 +
   5.309 +		return true;
   5.310  	}
   5.311 -	
   5.312 +
   5.313  	private String getDetails() {
   5.314  		String details = "-----------------------------------------\n";
   5.315  		details += "Connection details:\n";
   5.316 @@ -202,78 +284,90 @@
   5.317  		return details;
   5.318  	}
   5.319  
   5.320 -	public String getQuery1() {
   5.321 -		return query1;
   5.322 -	}
   5.323 -
   5.324 -	public void setQuery1(String query1) {
   5.325 -		this.query1 = query1;
   5.326 -	}
   5.327 -
   5.328 -	public String getQuery2() {
   5.329 -		return query2;
   5.330 -	}
   5.331 -
   5.332 -	public void setQuery2(String query2) {
   5.333 -		this.query2 = query2;
   5.334 -	}
   5.335 -
   5.336 -	public String getQuery3() {
   5.337 -		return query3;
   5.338 -	}
   5.339 -
   5.340 -	public void setQuery3(String query3) {
   5.341 -		this.query3 = query3;
   5.342 +//	public String getQuery1() {
   5.343 +//		return query1;
   5.344 +//	}
   5.345 +//
   5.346 +//	public void setQuery1(String query1) {
   5.347 +//		this.query1 = query1;
   5.348 +//	}
   5.349 +//
   5.350 +//	public String getQuery2() {
   5.351 +//		return query2;
   5.352 +//	}
   5.353 +//
   5.354 +//	public void setQuery2(String query2) {
   5.355 +//		this.query2 = query2;
   5.356 +//	}
   5.357 +//
   5.358 +//	public String getQuery3() {
   5.359 +//		return query3;
   5.360 +//	}
   5.361 +//
   5.362 +//	public void setQuery3(String query3) {
   5.363 +//		this.query3 = query3;
   5.364 +//	}
   5.365 +//
   5.366 +//	public String getQuery4() {
   5.367 +//		return query4;
   5.368 +//	}
   5.369 +//
   5.370 +//	public void setQuery4(String query4) {
   5.371 +//		this.query4 = query4;
   5.372 +//	}
   5.373 +//
   5.374 +//	public String getQuery5() {
   5.375 +//		return query5;
   5.376 +//	}
   5.377 +//
   5.378 +//	public void setQuery5(String query5) {
   5.379 +//		this.query5 = query5;
   5.380 +//	}
   5.381 +//
   5.382 +//	public String getQuery6() {
   5.383 +//		return query6;
   5.384 +//	}
   5.385 +//
   5.386 +//	public void setQuery6(String query6) {
   5.387 +//		this.query6 = query6;
   5.388 +//	}
   5.389 +//
   5.390 +//	public String getQuery7() {
   5.391 +//		return query7;
   5.392 +//	}
   5.393 +//
   5.394 +//	public void setQuery7(String query7) {
   5.395 +//		this.query7 = query7;
   5.396 +//	}
   5.397 +//	public String getQuery8() {
   5.398 +//		return query8;
   5.399 +//	}
   5.400 +//
   5.401 +//	public void setQuery8(String query8) {
   5.402 +//		this.query8 = query8;
   5.403 +//	}
   5.404 +//
   5.405 +//	public String getFormat() {
   5.406 +//		return format;
   5.407 +//	}
   5.408 +//
   5.409 +//	public void setFormat(String format) {
   5.410 +//		this.format = format;
   5.411 +//	}
   5.412 +	public List<Entry> getEntries() {
   5.413 +		return this.entries;
   5.414  	}
   5.415  	
   5.416 -	public String getQuery4() {
   5.417 -		return query4;
   5.418 -	}
   5.419 -
   5.420 -	public void setQuery4(String query4) {
   5.421 -		this.query4 = query4;
   5.422 -	}
   5.423 -
   5.424 -	public String getQuery5() {
   5.425 -		return query5;
   5.426 -	}
   5.427 -
   5.428 -	public void setQuery5(String query5) {
   5.429 -		this.query5 = query5;
   5.430 -	}
   5.431 -
   5.432 -	public String getQuery6() {
   5.433 -		return query6;
   5.434 -	}
   5.435 -
   5.436 -	public void setQuery6(String query6) {
   5.437 -		this.query6 = query6;
   5.438 -	}
   5.439 -
   5.440 -	public String getQuery7() {
   5.441 -		return query7;
   5.442 -	}
   5.443 -
   5.444 -	public void setQuery7(String query7) {
   5.445 -		this.query7 = query7;
   5.446 -	}
   5.447 -	public String getQuery8() {
   5.448 -		return query8;
   5.449 -	}
   5.450 -
   5.451 -	public void setQuery8(String query8) {
   5.452 -		this.query8 = query8;
   5.453 -	}
   5.454 -
   5.455 -	public String getFormat() {
   5.456 -		return format;
   5.457 -	}
   5.458 -
   5.459 -	public void setFormat(String format) {
   5.460 -		this.format = format;
   5.461 +	public void setEntries(List<Entry> entries) {
   5.462 +		this.entries = entries;
   5.463  	}
   5.464  	
   5.465 -	
   5.466 +	public Entry getEntry(int i) {
   5.467 +		if (i < 0 || i >= this.entries.size())
   5.468 +			return null;
   5.469 +		
   5.470 +		return this.entries.get(i);
   5.471 +	}
   5.472  	
   5.473  }
   5.474  
     6.1 --- a/evaluation/pom.xml	Thu May 17 15:07:24 2012 +0300
     6.2 +++ b/evaluation/pom.xml	Thu May 17 15:07:52 2012 +0300
     6.3 @@ -1,12 +1,11 @@
     6.4 -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     6.5 -	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     6.6 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     6.7  
     6.8  	<modelVersion>4.0.0</modelVersion>
     6.9  
    6.10  	<parent>
    6.11  		<groupId>eu.earthobservatory</groupId>
    6.12  		<artifactId>strabon</artifactId>
    6.13 -		<version>3.1.9-SNAPSHOT</version>
    6.14 +		<version>3.1.10-SNAPSHOT</version>
    6.15  	</parent>
    6.16  
    6.17  	<groupId>org.openrdf.sesame</groupId>
     7.1 --- a/generaldb/pom.xml	Thu May 17 15:07:24 2012 +0300
     7.2 +++ b/generaldb/pom.xml	Thu May 17 15:07:52 2012 +0300
     7.3 @@ -6,7 +6,7 @@
     7.4  	<parent>
     7.5  		<groupId>eu.earthobservatory</groupId>
     7.6  		<artifactId>strabon</artifactId>
     7.7 -		<version>3.1.9-SNAPSHOT</version>
     7.8 +		<version>3.1.10-SNAPSHOT</version>
     7.9  	</parent>
    7.10    
    7.11  	<groupId>org.openrdf.sesame</groupId>
     8.1 --- a/monetdb/pom.xml	Thu May 17 15:07:24 2012 +0300
     8.2 +++ b/monetdb/pom.xml	Thu May 17 15:07:52 2012 +0300
     8.3 @@ -6,7 +6,7 @@
     8.4  	<parent>
     8.5  		<groupId>eu.earthobservatory</groupId>
     8.6  		<artifactId>strabon</artifactId>
     8.7 -		<version>3.1.9-SNAPSHOT</version>
     8.8 +		<version>3.1.10-SNAPSHOT</version>
     8.9  	</parent>
    8.10    
    8.11  	<groupId>org.openrdf.sesame</groupId>
     9.1 --- a/pom.xml	Thu May 17 15:07:24 2012 +0300
     9.2 +++ b/pom.xml	Thu May 17 15:07:52 2012 +0300
     9.3 @@ -4,7 +4,7 @@
     9.4  
     9.5  	<groupId>eu.earthobservatory</groupId>
     9.6  	<artifactId>strabon</artifactId>
     9.7 -	<version>3.1.9-SNAPSHOT</version>
     9.8 +	<version>3.1.10-SNAPSHOT</version>
     9.9  	<packaging>pom</packaging>
    9.10  
    9.11  	<parent>
    9.12 @@ -29,7 +29,7 @@
    9.13  	</modules>
    9.14  
    9.15  	<properties>
    9.16 -        <eu.earthobservatory.version>3.1.9-SNAPSHOT</eu.earthobservatory.version>
    9.17 +        <eu.earthobservatory.version>3.1.10-SNAPSHOT</eu.earthobservatory.version>
    9.18  		<sesame.version>2.6.3</sesame.version>
    9.19  		<aduna.appbase.version>3.5.0</aduna.appbase.version>
    9.20  		<slf4j.version>1.6.1</slf4j.version>
    10.1 --- a/postgis/pom.xml	Thu May 17 15:07:24 2012 +0300
    10.2 +++ b/postgis/pom.xml	Thu May 17 15:07:52 2012 +0300
    10.3 @@ -6,7 +6,7 @@
    10.4  	<parent>
    10.5  		<groupId>eu.earthobservatory</groupId>
    10.6  		<artifactId>strabon</artifactId>
    10.7 -		<version>3.1.9-SNAPSHOT</version>
    10.8 +		<version>3.1.10-SNAPSHOT</version>
    10.9  	</parent>
   10.10    
   10.11  	<groupId>org.openrdf.sesame</groupId>
    11.1 --- a/resultio/pom.xml	Thu May 17 15:07:24 2012 +0300
    11.2 +++ b/resultio/pom.xml	Thu May 17 15:07:52 2012 +0300
    11.3 @@ -5,7 +5,7 @@
    11.4  	<parent>
    11.5  		<groupId>eu.earthobservatory</groupId>
    11.6  		<artifactId>strabon</artifactId>
    11.7 -		<version>3.1.9-SNAPSHOT</version>
    11.8 +		<version>3.1.10-SNAPSHOT</version>
    11.9  	</parent>
   11.10  
   11.11  	<groupId>org.openrdf.sesame</groupId>
    12.1 --- a/runtime/pom.xml	Thu May 17 15:07:24 2012 +0300
    12.2 +++ b/runtime/pom.xml	Thu May 17 15:07:52 2012 +0300
    12.3 @@ -1,12 +1,11 @@
    12.4 -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    12.5 -	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    12.6 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    12.7  
    12.8  	<modelVersion>4.0.0</modelVersion>
    12.9  
   12.10  	<parent>
   12.11  		<groupId>eu.earthobservatory</groupId>
   12.12  		<artifactId>strabon</artifactId>
   12.13 -		<version>3.1.9-SNAPSHOT</version>
   12.14 +		<version>3.1.10-SNAPSHOT</version>
   12.15  	</parent>
   12.16  
   12.17  	<artifactId>strabon-runtime</artifactId>