Strabon

changeset 1337:4dff2f1163d8 temporals

Merge with default branch.
author Panayiotis Smeros <psmeros@di.uoa.gr>
date Fri May 23 13:37:11 2014 +0300 (2014-05-23)
parents 404eacc0f0be e5abd174045f
children c83a650c0a1b
files .hgtags ChangeLog README endpoint-client/pom.xml endpoint-client/src/main/java/eu/earthobservatory/org/StrabonEndpoint/client/HTTPClient.java endpoint-exec/pom.xml endpoint/WebContent/WEB-INF/connection.properties endpoint/WebContent/query.jsp endpoint/WebContent/teleios-header.html endpoint/pom.xml endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java evaluation/pom.xml generaldb/pom.xml generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBSelectQueryOptimizer.java monetdb/pom.xml pom.xml postgis/pom.xml postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java resultio-spatial/api/pom.xml resultio-spatial/pom.xml resultio-spatial/sparqlgeojson/pom.xml resultio-spatial/sparqlhtml/pom.xml resultio-spatial/sparqlkml/pom.xml resultio-spatial/sparqlkml/src/main/java/org/openrdf/query/resultio/sparqlkml/stSPARQLResultsKMLWriter.java resultio-spatial/sparqlxml/pom.xml resultio-spatial/text/pom.xml resultio-spatial/text/src/main/java/org/openrdf/query/resultio/text/stSPARQLResultsTSVWriter.java runtime/pom.xml runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java testsuite/pom.xml vocab/pom.xml
line diff
     1.1 --- a/.hgtags	Sun Dec 15 15:45:55 2013 +0200
     1.2 +++ b/.hgtags	Fri May 23 13:37:11 2014 +0300
     1.3 @@ -17,6 +17,7 @@
     1.4  97afadc6d589b318924ca774659418c055fdf3a0 v3.2.6
     1.5  b3e0d7415823df2e814aa6fa45aa13374a81e706 v3.2.7
     1.6  389213ce7843a9c490be447400c1a5c46d44cc96 v3.2.8
     1.7 +92b90ac06d39f8fcf76de046f22bb64526d5ff28 v3.2.9
     1.8  0ed49ee3eb94c6bfc122254342e86bfd097c1200 v3.2.9-temporals
     1.9  0ed49ee3eb94c6bfc122254342e86bfd097c1200 v3.2.9-temporals
    1.10  0000000000000000000000000000000000000000 v3.2.9-temporals
     2.1 --- a/ChangeLog	Sun Dec 15 15:45:55 2013 +0200
     2.2 +++ b/ChangeLog	Fri May 23 13:37:11 2014 +0300
     2.3 @@ -1,12 +1,40 @@
     2.4  	* Fixed a bug that occured when storing quads from endpoint.
     2.5  
     2.6 -Sun Oct 20 20:23:14 2013  Pyravlos Team
     2.7 +	* Version 3.2.10 released.
     2.8 +
     2.9 +	* Various changes in the interface and behavior of Strabon Endpoint:
    2.10 +	  - Revised the logos and the sample queries.
    2.11 +	  - Results query limit is set to zero (unlimited).
    2.12 +	  - Users can now store RDF data that is present in a file on the
    2.13 +	    client side (the file is uploaded to the server).
    2.14 +	  - Credentials are now required for uploading files or executing
    2.15 +	    UPDATE queries, unless Strabon Endpoint runs locally (localhost).
    2.16 +	  - When viewing the results of queries in HTML, any URI is now an
    2.17 +	    active link to itself. Previously, that URI was being DESCRIBEd
    2.18 +	    and one was being transferred to a page viewing the result of the
    2.19 +	    DESCRIBE query.
    2.20 +	  - The DESCRIBE functionality can now be accessed through the menu bar.
    2.21 +	
    2.22 +	* Fixed a bug where strdf:intersection function did not work as an
    2.23 +	aggregate when used without 'GROUP BY'.
    2.24 +	(bug #46 https://bug.strabon.di.uoa.gr/ticket/46)
    2.25 +
    2.26 +Sat Oct 19 23:37:23 2013   Pyravlos Team
    2.27  
    2.28  	* Version 3.2.9 released.
    2.29  
    2.30  	* Added support for the following google chart types: PieChart, 
    2.31  	AreaChart and ColumnChart to strabon endpoint. 
    2.32  	
    2.33 +	* Added Timemap as new results format in Strabon endpoint. This 
    2.34 +	option displays results in a map and a timeline on the same time, 
    2.35 +	using the Timemap js library (http://code.google.com/p/timemap/).
    2.36 +	The KMLWriter has been extended for that purpose, by transforming
    2.37 +	dateTime values that are included in the result set into the respective
    2.38 +	TimeStamp KML primitive (https://developers.google.com/kml/documentation/time). 
    2.39 +	In the "temporals" branch, the values of the strdf:period datatype 
    2.40 +	are converted into the respective KML TimeSpan primitive. 
    2.41 +	
    2.42  	* Added extension function <http://postgis.net/ST_Centroid> which is
    2.43  	mapped to the ST_Centroid(geometry) extension function of PostGIS.
    2.44  	See also: <http://postgis.org/docs/ST_Centroid.html>.
    2.45 @@ -46,6 +74,11 @@
    2.46  	geo:wktLiteral.
    2.47  	(bug #33: http://bug.strabon.di.uoa.gr/ticket/33)
    2.48  	
    2.49 +	* Endpoint Client now supports querying of Virtuoso and Parliament endpoints.
    2.50 +
    2.51 +	* Endpoint Client now supports store and update operations, but only
    2.52 +	for Strabon Endpoints.
    2.53 +
    2.54  	*Modified the NQUADSTranslator so that the rewritten triples are 
    2.55  	immediately flushed to the database once they are created. 
    2.56  	
    2.57 @@ -84,6 +117,29 @@
    2.58  	(https://portal.opengeospatial.org/files/?artifact_id=47664, pg. 53) have been 
    2.59  	implemented.
    2.60  
    2.61 +	* Changed the definition and implementation of strdf:distance function, by
    2.62 +	adopting the definition of GeoSPARQL.
    2.63 +	(bug #23: http://bug.strabon.di.uoa.gr/ticket/23) 
    2.64 +
    2.65 +	* Changed the definition and implementation of strdf:buffer function, by
    2.66 +        adopting the definition of GeoSPARQL.
    2.67 +        (bug #35: http://bug.strabon.di.uoa.gr/ticket/35)
    2.68 +
    2.69 +	* Added geof:distance and geof:buffer functions, which have the same definition
    2.70 +	with strdf:distance and strdf:buffer respectively.
    2.71 +	(bug #32: http://bug.strabon.di.uoa.gr/ticket/32)
    2.72 +
    2.73 +	* Added a download button when performing describe and construct queries at the
    2.74 +        endpoint.
    2.75 +        (bug #38: http://bug.strabon.di.uoa.gr/ticket/38)
    2.76 +
    2.77 +	* Fixed a bug, where XMLWriter and TSVWriter did not return geometries with the
    2.78 +	SRID.
    2.79 +	(bug #47: http://bug.strabon.di.uoa.gr/ticket/47)
    2.80 +
    2.81 +	* Fixed a bug where the GeoSPARQL construct functions did not return the datatype 
    2.82 +	geo:wktLiteral datatype but strdf:WKT.
    2.83 +
    2.84  Tue Mar 26 13:28:26 2013   Pyravlos Team
    2.85  
    2.86  	* Version 3.2.8 released.
     3.1 --- a/README	Sun Dec 15 15:45:55 2013 +0200
     3.2 +++ b/README	Fri May 23 13:37:11 2014 +0300
     3.3 @@ -448,13 +448,13 @@
     3.4  The system Strabon has been developed by the following members of our team:
     3.5  
     3.6  * Manos Karpathiotakis	<mk@di.uoa.gr>
     3.7 -* Kostis Kyzirakos	<kkyzir@di.uoa.gr>
     3.8 +* Kostis Kyzirakos	<Kostis.Kyzirakos@cwi.nl>
     3.9  * Manolis Koubarakis	<koubarak@di.uoa.gr>
    3.10  * Giorgos Garbis	<ggarbis@di.uoa.gr>
    3.11  * Konstantina Bereta	<konstantina.bereta@di.uoa.gr>
    3.12  * Charalampos Nikolaou	<charnik@di.uoa.gr>
    3.13  * Stella Gianakopoulou	<sgian@di.uoa.gr>
    3.14 -* Panagiotis Smeros	<psmeros@di.uoa.gr>
    3.15 +* Panayiotis Smeros	<psmeros@di.uoa.gr>
    3.16  * Kallirroi Dogani	<kallirroi@di.uoa.gr>
    3.17  
    3.18  
    3.19 @@ -481,6 +481,31 @@
    3.20  
    3.21  Known Issues
    3.22  ============
    3.23 +* Strabon depends on a version of Sesame OpenRDF that is not hosted at the central
    3.24 +  repository of Maven. These artifacts resided on the Maven repository of Aduna 
    3.25 +  which is not maintained any more. For this reason, you can use a mirror repository 
    3.26 +  hosted by Ontotext. To configure maven to use the Ontotext mirror for the Aduna 
    3.27 +  repository, you append to your settings file ${user.home}/.m2/settings.xml) the 
    3.28 +  following:
    3.29 +
    3.30 +<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    3.31 +  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    3.32 +  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
    3.33 +                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
    3.34 +...
    3.35 +...
    3.36 +  <mirrors>
    3.37 +    <mirror>
    3.38 +      <id>aduna-mirror</id>
    3.39 +      <name>Aduna Maven Repository - Mirror</name>
    3.40 +      <url>http://maven.ontotext.com/content/repositories/aduna/</url>
    3.41 +      <mirrorOf>aduna-opensource.releases</mirrorOf>
    3.42 +    </mirror>
    3.43 +  </mirrors>
    3.44 +...
    3.45 +...
    3.46 +</settings>
    3.47 +
    3.48   * By default, Tomcat uses ISO-8859-1 character encoding when decoding URLs received 
    3.49     from a browser. This can cause problems when encoding is UTF-8, and you are using 
    3.50     international characters. In order to fix this, edit conf/server.xml and find the 
     4.1 --- a/endpoint-client/pom.xml	Sun Dec 15 15:45:55 2013 +0200
     4.2 +++ b/endpoint-client/pom.xml	Fri May 23 13:37:11 2014 +0300
     4.3 @@ -137,7 +137,7 @@
     4.4  			<plugin>
     4.5                                  <groupId>org.apache.maven.plugins</groupId>
     4.6                                  <artifactId>maven-shade-plugin</artifactId>
     4.7 -                                <version>2.0</version>
     4.8 +                                <version>2.2</version>
     4.9                          <!--
    4.10                                  <configuration>
    4.11                                  </configuration>
     5.1 --- a/endpoint/WebContent/WEB-INF/beans.xml	Sun Dec 15 15:45:55 2013 +0200
     5.2 +++ b/endpoint/WebContent/WEB-INF/beans.xml	Fri May 23 13:37:11 2014 +0300
     5.3 @@ -55,7 +55,7 @@
     5.4  
     5.5          <constructor-arg type="boolean" >
     5.6              <!-- Check for locks and remove them (in case of a crash) -->
     5.7 -            <value>false</value>
     5.8 +            <value>true</value>
     5.9          </constructor-arg>
    5.10  
    5.11          <constructor-arg type="java.lang.String" >
    5.12 @@ -65,9 +65,16 @@
    5.13          
    5.14          <constructor-arg type="int" >
    5.15              <!-- Query limit -->
    5.16 -            <value>1000</value>
    5.17 +            <value>0</value>
    5.18          </constructor-arg>
    5.19          
    5.20 +        <constructor-arg type="boolean" >
    5.21 +            <!-- Load from File -->
    5.22 +            <value>true</value>
    5.23 +        </constructor-arg>
    5.24 +     
    5.25 +     	<!-- Boolean variable linkURL in stSPARQLResultsHTMLWriter.java (line 115) to change the links between web and describe -->
    5.26 +        
    5.27          <constructor-arg type="java.lang.String" >
    5.28              <!-- Default prefixes -->
    5.29              <!-- PREFIX gag: <http://teleios.di.uoa.gr/ontologies/gagKallikratis.rdf#> -->
    5.30 @@ -77,8 +84,9 @@
    5.31  PREFIX geonames:<http://www.geonames.org/ontology#>
    5.32  PREFIX clc: <http://geo.linkedopendata.gr/corine/ontology#>
    5.33  PREFIX gag: <http://geo.linkedopendata.gr/greekadministrativeregion/ontology#>
    5.34 -PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
    5.35 -PREFIX dlr: <http://www.earthobservatory.eu/ontologies/dlrOntology-v2.owl#>
    5.36 +PREFIX geo: <http://www.opengis.net/ont/geosparql#>
    5.37 +PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
    5.38 +PREFIX geor: <http://www.opengis.net/def/rule/geosparql/>
    5.39  PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
    5.40  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    5.41  PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    5.42 @@ -97,236 +105,20 @@
    5.43  	                 <!-- Bean -->
    5.44  	                <value>Query</value> 
    5.45  	                <!-- Format -->
    5.46 -	                <value>KML</value>   
    5.47 +	                <value>HTML</value>   
    5.48  	                <!-- Label -->
    5.49 -	                <value>[ΝΟΑ] Select all hotspots of 2012 before any refinement</value> 
    5.50 +	                <value>Find all triples in the dataset.</value> 
    5.51  	                <!-- Statement -->
    5.52 -	                <value><![CDATA[PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 
    5.53 -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
    5.54 -PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
    5.55 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 
    5.56 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
    5.57 -PREFIX gag: <http://geo.linkedopendata.gr/greekadministrativeregion/ontology#>
    5.58 -
    5.59 -SELECT ?h  (strdf:transform(?hGeo, <http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?geo) ?conf ?municipality
    5.60 +	                <value><![CDATA[
    5.61 +SELECT *
    5.62  WHERE { 
    5.63 -?h   noa:hasGeometry ?hGeo ;
    5.64 -     noa:hasAcquisitionTime ?hAcquisitionTime ; 
    5.65 -     noa:producedFromProcessingChain ?hProcessingChain ; 
    5.66 -     noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string ;
    5.67 -     noa:hasConfidence ?conf ;
    5.68 -     gag:hasMunicipality ?municipality .
    5.69 -     FILTER(?hProcessingChain = "DynamicThresholds" || ?hProcessingChain = "DynamicThresholds-TimePersistence") .
    5.70 -     FILTER("2012-05-01T00:00:00"^^xsd:dateTime <= ?hAcquisitionTime && ?hAcquisitionTime < "2012-10-01T00:00:00"^^xsd:dateTime ) .
    5.71 -     OPTIONAL {?h noa:isDiscarded ?disc }.
    5.72 -     FILTER (!bound(?disc)) .
    5.73 +	?s ?p ?o	
    5.74  }
    5.75  ]]></value>
    5.76  	                <!-- Description -->
    5.77  					<value></value>
    5.78  					<!-- Hander (plain, download, map or map_local)-->
    5.79 -					<value>map_local</value>
    5.80 -	            </list>
    5.81 -	            <list>
    5.82 -	                 <!-- Bean -->
    5.83 -	                <value>Query</value> 
    5.84 -	                <!-- Format -->
    5.85 -	                <value>KML</value>   
    5.86 -	                <!-- Label -->
    5.87 -	                <value>[ΝΟΑ] Select all hotspots of 2012 after refinement operation 'delete in sea'</value> 
    5.88 -	                <!-- Statement -->
    5.89 -	                <value><![CDATA[PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
    5.90 -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    5.91 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
    5.92 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
    5.93 -PREFIX gag: <http://geo.linkedopendata.gr/greekadministrativeregion/ontology#>
    5.94 -
    5.95 -INSERT {?h noa:isDiscarded "1"^^xsd:int ;
    5.96 -           noa:refinedBy noa:seaInconsistency .
    5.97 -} 
    5.98 -WHERE {
    5.99 -?h   noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ;
   5.100 -     noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ;
   5.101 -     noa:isDerivedFromSensor "SENSOR"^^xsd:string .
   5.102 -       OPTIONAL {
   5.103 -    ?h	gag:hasMunicipality ?municipalit .
   5.104 -  } 
   5.105 -  FILTER(!bound(?municipality)) .
   5.106 -}	                ]]></value>
   5.107 -	                <!-- Description -->
   5.108 -					<value></value>
   5.109 -					<!-- Hander (plain, download, map or map_local)-->
   5.110 -					<value>map_local</value>
   5.111 -	            </list>
   5.112 -	            <list>
   5.113 -	                 <!-- Bean -->
   5.114 -	                <value>Query</value> 
   5.115 -	                <!-- Format -->
   5.116 -	                <value>KML</value>   
   5.117 -	                <!-- Label -->
   5.118 -	                <value>[ΝΟΑ] Select all hotspots of 2012 after refinement operation 'delete in inconsistent areas'</value> 
   5.119 -	                <!-- Statement -->
   5.120 -	                <value><![CDATA[PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 
   5.121 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 
   5.122 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   5.123 -
   5.124 -SELECT ?h (strdf:transform(?hGeo, <http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?geo) ("Corine Land Cover inconsistency" as ?refinement)
   5.125 -WHERE { 
   5.126 -    ?h   noa:hasGeometry ?hGeo ;
   5.127 -         noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ;
   5.128 -         noa:refinedBy noa:clcInconsistency .
   5.129 -}	                ]]></value>
   5.130 -	                <!-- Description -->
   5.131 -					<value></value>
   5.132 -					<!-- Hander (plain, download, map or map_local)-->
   5.133 -					<value>map_local</value>
   5.134 -	            </list>
   5.135 -	            <list>
   5.136 -	                 <!-- Bean -->
   5.137 -	                <value>Query</value> 
   5.138 -	                <!-- Format -->
   5.139 -	                <value>KML</value>   
   5.140 -	                <!-- Label -->
   5.141 -	                <value>[ΝΟΑ] Select all hotspots of 2012 after refinement operation 'refine in coast'</value> 
   5.142 -	                <!-- Statement -->
   5.143 -	                <value><![CDATA[PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 
   5.144 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 
   5.145 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   5.146 -
   5.147 -SELECT ?h (strdf:transform(?hGeo, <http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?geo) ("Corine Land Cover inconsistency" as ?refinement)
   5.148 -WHERE { 
   5.149 -    ?h   noa:hasGeometry ?hGeo ;
   5.150 -         noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ;
   5.151 -         noa:refinedBy noa:clcInconsistency .
   5.152 -}	                ]]></value>
   5.153 -	                <!-- Description -->
   5.154 -					<value></value>
   5.155 -					<!-- Hander (plain, download, map or map_local)-->
   5.156 -					<value>map_local</value>
   5.157 -	            </list>
   5.158 -	            <list>
   5.159 -	                 <!-- Bean -->
   5.160 -	                <value>Query</value> 
   5.161 -	                <!-- Format -->
   5.162 -	                <value>KML</value>   
   5.163 -	                <!-- Label -->
   5.164 -	                <value>[ΝΟΑ] Select all hotspots of 2012 after refinement operation 'refine according to time persistence'</value> 
   5.165 -	                <!-- Statement -->
   5.166 -	                <value><![CDATA[PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 
   5.167 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 
   5.168 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   5.169 -
   5.170 -SELECT ?h (strdf:transform(?hGeo, <http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?geo) ("Temporal persistence" as ?refinement)
   5.171 -WHERE { 
   5.172 -    ?h   noa:hasGeometry ?hGeo ;
   5.173 -         noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ;
   5.174 -         noa:refinedBy noa:temporalPersistence .
   5.175 -}	                ]]></value>
   5.176 -	                <!-- Description -->
   5.177 -					<value></value>
   5.178 -					<!-- Hander (plain, download, map or map_local)-->
   5.179 -					<value>map_local</value>
   5.180 -	            </list>
   5.181 -	            <list>
   5.182 -	                 <!-- Bean -->
   5.183 -	                <value>Query</value> 
   5.184 -	                <!-- Format -->
   5.185 -	                <value>KML</value>   
   5.186 -	                <!-- Label -->
   5.187 -	                <value>[NOA] Select all that have been refined by a refinement operation</value> 
   5.188 -	                <!-- Statement -->
   5.189 -	                <value><![CDATA[PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   5.190 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
   5.191 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   5.192 -
   5.193 -SELECT (strdf:transform(?hGeo, <http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?geo) (GROUP_CONCAT(?refinement; separator=", ") AS ?refinements)
   5.194 -WHERE { 
   5.195 -    ?h   noa:hasGeometry ?hGeo ;
   5.196 -         noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ;
   5.197 -         noa:refinedBy ?refinement .
   5.198 -}
   5.199 -GROUP BY ?geo	                ]]></value>
   5.200 -	                <!-- Description -->
   5.201 -					<value></value>
   5.202 -					<!-- Hander (plain, download, map or map_local)-->
   5.203 -					<value>map_local</value>
   5.204 -	            </list>	            
   5.205 -	            <list>
   5.206 -             		<!-- Single valued elements correspond to headers -->
   5.207 -					<value>Enrich available information</value>
   5.208 -	            </list>
   5.209 -				<list>
   5.210 -	                 <!-- Bean -->
   5.211 -	                <value>Query</value> 
   5.212 -	                <!-- Format -->
   5.213 -	                <value>HTML</value>   
   5.214 -	                <!-- Label -->
   5.215 -	                <value>[NOA + GAG]Connect each hotspot with the municipality where it is located</value> 
   5.216 -	                <!-- Statement -->
   5.217 -	                <value><![CDATA[PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   5.218 -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   5.219 -PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
   5.220 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
   5.221 -PREFIX gag: <http://geo.linkedopendata.gr/greekadministrativeregion/ontology#>
   5.222 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
   5.223 -
   5.224 -INSERT { ?h gag:hasMunicipality ?muni }
   5.225 -WHERE { 
   5.226 -SELECT ?h (SAMPLE(?mLabel) AS ?muni)
   5.227 -  WHERE {
   5.228 -	?h  rdf:type noa:Hotspot ;
   5.229 -		noa:hasGeometry ?hGeo ;
   5.230 -		noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string ;
   5.231 -		noa:producedFromProcessingChain "DynamicThresholds"^^xsd:string ;
   5.232 -        noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime.
   5.233 -	?m	rdf:type gag:Dhmos ;
   5.234 -		rdfs:label ?mLabel ;
   5.235 -		gag:hasGeometry ?mGeo .
   5.236 -	FILTER(strdf:intersects(?hGeo, ?mGeo)) .
   5.237 -  }  
   5.238 -  GROUP BY ?h
   5.239 -}]]></value>
   5.240 -	                <!-- Description -->
   5.241 -					<value></value>
   5.242 -					<!-- Hander (plain, download, map or map_local)-->
   5.243 -					<value></value>
   5.244 -	            </list>
   5.245 -	            
   5.246 -	            <list>
   5.247 -             		<!-- Single valued elements correspond to headers -->
   5.248 -					<value>Increase accuracy with respect to underlying area</value>
   5.249 -	            </list>
   5.250 -				<list>
   5.251 -	                 <!-- Bean -->
   5.252 -	                <value>Query</value> 
   5.253 -	                <!-- Format -->
   5.254 -	                <value>HTML</value>   
   5.255 -	                <!-- Label -->
   5.256 -	                <value>[NOA+GAG] Delete all hotspots that fall in the sea</value> 
   5.257 -	                <!-- Statement -->
   5.258 -	                <value><![CDATA[PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
   5.259 -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   5.260 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
   5.261 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
   5.262 -PREFIX gag: <http://geo.linkedopendata.gr/greekadministrativeregion/ontology#>
   5.263 -
   5.264 -INSERT {?h noa:isDiscarded "1"^^xsd:int ;
   5.265 -           noa:refinedBy noa:seaInconsistency .
   5.266 -} 
   5.267 -WHERE {
   5.268 -?h   noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ;
   5.269 -     noa:producedFromProcessingChain "DynamicThresholds"^^xsd:string ;
   5.270 -     noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string .
   5.271 -       OPTIONAL {
   5.272 -    ?h	gag:hasMunicipality ?municipality .
   5.273 -  } 
   5.274 -  FILTER(!bound(?municipality)) .
   5.275 -}
   5.276 -	                ]]></value>
   5.277 -	                <!-- Description -->
   5.278 -					<value></value>
   5.279 -					<!-- Hander (plain, download, map or map_local)-->
   5.280 -					<value>plain</value>
   5.281 +					<value>Plain</value>
   5.282  	            </list>
   5.283  	            <list>
   5.284  	                 <!-- Bean -->
   5.285 @@ -334,151 +126,116 @@
   5.286  	                <!-- Format -->
   5.287  	                <value>HTML</value>   
   5.288  	                <!-- Label -->
   5.289 -	                <value>[NOA+Coastline] Delete the part of polygons that fall in the sea</value> 
   5.290 +	                <value>Select all distinct subjects that appear in the dataset.</value> 
   5.291  	                <!-- Statement -->
   5.292 -	                <value><![CDATA[PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 
   5.293 -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
   5.294 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 
   5.295 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
   5.296 -PREFIX gag: <http://geo.linkedopendata.gr/greekadministrativeregion/ontology#>
   5.297 -
   5.298 -
   5.299 -INSERT { ?h noa:isDiscarded "1"^^xsd:int . 
   5.300 -	    ?valid rdf:type noa:Hotspot ;
   5.301 -	    noa:hasConfidence ?conf ;
   5.302 -	    noa:hasGeometry ?dif ;
   5.303 -	    gag:hasMunicipality ?municipality ;
   5.304 -	    noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; 
   5.305 -	    noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string ;
   5.306 -	    noa:hasConfirmation noa:unknown ;
   5.307 -	    noa:producedFromProcessingChain "DynamicThresholds"^^xsd:string ; 
   5.308 -	    noa:isProducedBy noa:noa ;
   5.309 -	    noa:isDerivedFromSatellite "METEOSAT8"^^xsd:string ;
   5.310 -            noa:refinedBy noa:coastlineRefinement ;
   5.311 -            noa:refinedBy ?refined .
   5.312 +	                <value><![CDATA[
   5.313 +SELECT DISTINCT (?s AS ?subject)
   5.314 +WHERE { 
   5.315 +	?s ?p ?o
   5.316  }
   5.317 -WHERE { 
   5.318 -  SELECT ?h  (strdf:intersection(?hGeo, strdf:union(?cGeo)) AS ?dif) (URI(CONCAT(STR(?h),"/refined")) AS ?valid) ?conf ?municipality
   5.319 -  WHERE { 
   5.320 -	 ?h     noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime; 
   5.321 -       		noa:producedFromProcessingChain "DynamicThresholds"^^xsd:string ; 
   5.322 -       		noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string ;
   5.323 -		noa:hasGeometry ?hGeo ;
   5.324 -       		gag:hasMunicipality ?municipality ;
   5.325 -       		noa:hasConfidence ?conf .
   5.326 -	 ?c     rdf:type gag:GeometryPart ;
   5.327 -       		gag:hasGeometry ?cGeo .
   5.328 -       	FILTER(strdf:mbbIntersects(?hGeo, ?cGeo)) . 
   5.329 -	OPTIONAL { ?h noa:refinedBy ?refined } .
   5.330 -  }
   5.331 -  GROUP BY ?h ?hGeo ?conf ?municipality
   5.332 -  HAVING strdf:overlap(?hGeo, strdf:union(?cGeo))
   5.333 -}	                ]]></value>
   5.334 +]]></value>
   5.335  	                <!-- Description -->
   5.336  					<value></value>
   5.337  					<!-- Hander (plain, download, map or map_local)-->
   5.338 -					<value></value>
   5.339 +					<value>Plain</value>
   5.340  	            </list>
   5.341 -	             <list>
   5.342 +	            <list>
   5.343  	                 <!-- Bean -->
   5.344  	                <value>Query</value> 
   5.345  	                <!-- Format -->
   5.346  	                <value>HTML</value>   
   5.347  	                <!-- Label -->
   5.348 -	                <value>[NOA+CLC] Delete all hotspots that intersect with inconsistent areas</value> 
   5.349 +	                <value>Select all distinct predicates that appear in the dataset.</value> 
   5.350  	                <!-- Statement -->
   5.351 -	                <value><![CDATA[PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 
   5.352 -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
   5.353 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 
   5.354 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
   5.355 -PREFIX clc: <http://geo.linkedopendata.gr/corine/ontology#>
   5.356 -
   5.357 -INSERT {?h noa:isDiscarded "1"^^xsd:int ;
   5.358 -           noa:refinedBy noa:clcInconsistency .
   5.359 -} 
   5.360 -WHERE {
   5.361 -	SELECT ?h WHERE 
   5.362 -	{
   5.363 -		?h  noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ;
   5.364 -			noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ;
   5.365 -			noa:isDerivedFromSensor "SENSOR"^^xsd:string ;
   5.366 -			noa:hasGeometry ?hGeo.
   5.367 -		?a  rdf:type   clc:ExcludeArea;
   5.368 -			clc:hasGeometry ?aGeo.
   5.369 -		FILTER(strdf:mbbIntersects(?hGeo,?aGeo)).
   5.370 -	} 
   5.371 -	GROUP BY ?h ?hGeo
   5.372 -	HAVING strdf:contains(strdf:union(?aGeo),?hGeo)
   5.373 -}]]></value>
   5.374 +	                <value><![CDATA[
   5.375 +SELECT DISTINCT (?p AS ?predicate)
   5.376 +WHERE { 
   5.377 +	?s ?p ?o
   5.378 +}
   5.379 +]]></value>
   5.380  	                <!-- Description -->
   5.381  					<value></value>
   5.382  					<!-- Hander (plain, download, map or map_local)-->
   5.383 -					<value>plain</value>
   5.384 +					<value>Plain</value>
   5.385  	            </list>
   5.386 +	            
   5.387  	            <list>
   5.388 -             		<!-- Single valued elements correspond to headers -->
   5.389 -					<value>Increase accuracy with respect to time persistence</value>
   5.390 -	            </list>
   5.391 -				<list>
   5.392  	                 <!-- Bean -->
   5.393  	                <value>Query</value> 
   5.394  	                <!-- Format -->
   5.395  	                <value>HTML</value>   
   5.396  	                <!-- Label -->
   5.397 -	                <value>[NOA] Add virtual hotspots accoring to time persistence of actually detected hotspots</value> 
   5.398 +	                <value>Select all distinct objets that appear in the dataset.</value> 
   5.399  	                <!-- Statement -->
   5.400 -	                <value><![CDATA[PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 
   5.401 -PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
   5.402 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 
   5.403 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
   5.404 -PREFIX gag: <http://geo.linkedopendata.gr/greekadministrativeregion/ontology#>
   5.405 -
   5.406 -INSERT {?newHotspot rdf:type noa:Hotspot ;
   5.407 -		    noa:hasConfidence ?hConfidence ;
   5.408 -		    noa:hasGeometry ?hGeometry1 ;
   5.409 -		    noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; 
   5.410 -		    noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string ;
   5.411 -		    noa:hasConfirmation noa:unknown ;
   5.412 -		    noa:producedFromProcessingChain "DynamicThresholds-TimePersistence"^^xsd:string ; 
   5.413 -		    noa:isProducedBy noa:noa ;
   5.414 -		    gag:hasMunicipality ?hMunicipality1 ;
   5.415 -		    noa:isDerivedFromSatellite "METEOSAT8"^^xsd:string ;
   5.416 -                    noa:refinedBy noa:temporalPersistence ;
   5.417 -                    noa:refinedBy ?refined .
   5.418 +	                <value><![CDATA[
   5.419 +SELECT DISTINCT (?o AS ?object)
   5.420 +WHERE { 
   5.421 +	?s ?p ?o	
   5.422  }
   5.423 -WHERE {
   5.424 -	SELECT  (URI(CONCAT(STR(MAX(?h1)),"/virtual/NEW_HOTSPOT")) AS ?newHotspot)
   5.425 -			(SUM(?hConfidence1)/ACQUISITIONS_IN_HALF_AN_HOUR AS ?hConfidence)
   5.426 -			?hGeometry1 ?hMunicipality1
   5.427 -  WHERE {
   5.428 -    ?h1 noa:hasConfidence ?hConfidence1 ;
   5.429 -        noa:hasGeometry ?hGeometry1 ;
   5.430 -        gag:hasMunicipality ?hMunicipality1 ;
   5.431 -        noa:hasAcquisitionTime ?hAcquisitionTime1 ;
   5.432 -        noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string ;
   5.433 -        noa:producedFromProcessingChain "DynamicThresholds"^^xsd:string .
   5.434 -    OPTIONAL { ?h1 noa:isDiscarded ?z } .
   5.435 -    FILTER (!BOUND(?z)) .
   5.436 -    OPTIONAL { ?h1 noa:refinedBy ?refined } .
   5.437 -    FILTER( "MIN_ACQUISITION_TIME"^^xsd:dateTime <= ?hAcquisitionTime1 && ?hAcquisitionTime1 < "TIMESTAMP"^^xsd:dateTime ) .
   5.438 -    OPTIONAL {
   5.439 -      ?h2 noa:hasGeometry ?hGeometry2 ;
   5.440 -          noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ;
   5.441 -          noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string ;
   5.442 -          noa:producedFromProcessingChain ?hProcessingChain2 .
   5.443 -      FILTER(("DynamicThresholds"^^xsd:string = ?hProcessingChain2)||("DynamicThresholds-TimePersistence"^^xsd:string = ?hProcessingChain2)).
   5.444 -      FILTER( strdf:mbbEquals(?hGeometry1, ?hGeometry2) ) .
   5.445 -    }
   5.446 -    FILTER( !BOUND(?h2) ) .
   5.447 -  }
   5.448 -  GROUP BY ?hGeometry1 ?hMunicipality1
   5.449 -  HAVING(SUM(?hConfidence1)>0.0)
   5.450 -}]]></value>
   5.451 +]]></value>
   5.452  	                <!-- Description -->
   5.453  					<value></value>
   5.454  					<!-- Hander (plain, download, map or map_local)-->
   5.455 -					<value>plain</value>
   5.456 +					<value>Plain</value>
   5.457  	            </list>
   5.458 +	            <list>
   5.459 +	                 <!-- Bean -->
   5.460 +	                <value>Query</value> 
   5.461 +	                <!-- Format -->
   5.462 +	                <value>HTML</value>   
   5.463 +	                <!-- Label -->
   5.464 +	                <value>Find all distinct classes of the dataset.</value> 
   5.465 +	                <!-- Statement -->
   5.466 +	                <value><![CDATA[PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>	                
   5.467 +
   5.468 +SELECT DISTINCT (?o AS ?class)
   5.469 +WHERE { 
   5.470 +	?s rdf:type ?o
   5.471 +}
   5.472 +]]></value>
   5.473 +	                <!-- Description -->
   5.474 +					<value></value>
   5.475 +					<!-- Hander (plain, download, map or map_local)-->
   5.476 +					<value>Plain</value>
   5.477 +	            </list>
   5.478 +	            
   5.479 +	        	<list>
   5.480 +	                 <!-- Bean -->
   5.481 +	                <value>Query</value> 
   5.482 +	                <!-- Format -->
   5.483 +	                <value>HTML</value>   
   5.484 +	                <!-- Label -->
   5.485 +	                <value>Find the number of triples that appear in the dataset.</value> 
   5.486 +	                <!-- Statement -->
   5.487 +	                <value><![CDATA[SELECT (COUNT(?s) AS ?NumOfTriples)
   5.488 +WHERE { 
   5.489 +	?s ?p ?o
   5.490 +}
   5.491 +]]></value>
   5.492 +	                <!-- Description -->
   5.493 +					<value></value>
   5.494 +					<!-- Hander (plain, download, map or map_local)-->
   5.495 +					<value>Plain</value>
   5.496 +	            </list>
   5.497 +	            <list>
   5.498 +	                 <!-- Bean -->
   5.499 +	                <value>Query</value> 
   5.500 +	                <!-- Format -->
   5.501 +	                <value>HTML</value>   
   5.502 +	                <!-- Label -->
   5.503 +	                <value>Present the first ten triples of the dataset.</value> 
   5.504 +	                <!-- Statement -->
   5.505 +	                <value><![CDATA[SELECT *
   5.506 +WHERE { 
   5.507 +	?s ?p ?o
   5.508 +}
   5.509 +LIMIT 10
   5.510 +]]></value>
   5.511 +	                <!-- Description -->
   5.512 +					<value></value>
   5.513 +					<!-- Hander (plain, download, map or map_local)-->
   5.514 +					<value>Plain</value>
   5.515 +	            </list>      
   5.516  
   5.517  				<list>
   5.518               		<!-- Single valued elements correspond to headers -->
   5.519 @@ -507,7 +264,7 @@
   5.520  				<list>
   5.521  					<!-- Link to bean: two arguemnts -->
   5.522  					<value>Configuration</value>
   5.523 -					<value>ChangeConnection</value>
   5.524 +					<value>connection.jsp</value>
   5.525  				</list>
   5.526              </list>
   5.527           </constructor-arg>
     6.1 --- a/endpoint/WebContent/WEB-INF/connection.properties	Sun Dec 15 15:45:55 2013 +0200
     6.2 +++ b/endpoint/WebContent/WEB-INF/connection.properties	Fri May 23 13:37:11 2014 +0300
     6.3 @@ -1,6 +1,6 @@
     6.4  hostname=localhost
     6.5  port=5432
     6.6  dbengine=postgis
     6.7 -password=p1r3as
     6.8 -dbname=npd
     6.9 +password=postgres
    6.10 +dbname=endpoint
    6.11  username=postgres
     7.1 --- a/endpoint/WebContent/connection.jsp	Sun Dec 15 15:45:55 2013 +0200
     7.2 +++ b/endpoint/WebContent/connection.jsp	Fri May 23 13:37:11 2014 +0300
     7.3 @@ -32,19 +32,41 @@
     7.4  		ul#icons li {margin: 1px; position: relative; padding: 1px 0; cursor: pointer; float: left;  list-style: none;}
     7.5  		ul#icons span.ui-icon {float: left; margin: 0 1px;}
     7.6  		</style>
     7.7 -		<title>TELEIOS: Strabon Endpoint</title>
     7.8 +		<title>Strabon Endpoint</title>
     7.9  	</head>
    7.10  <body topmargin="0" leftmargin="0" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
    7.11  
    7.12  <!-- include TELEIOS header and description -->
    7.13 -<jsp:include page="teleios-header.html"/>
    7.14 +<jsp:include page="header.html"/>
    7.15  <!-- include TELEIOS header and description -->
    7.16  
    7.17  <FORM method=POST enctype="UTF-8" accept-charset="UTF-8" action="DBConnect">
    7.18  <input type="hidden" name="query" value="<%=request.getAttribute("query")%>"/>
    7.19  <input type="hidden" name="handle" value="<%=request.getAttribute("handle")%>"/>
    7.20  <input type="hidden" name="format" value="<%=request.getAttribute("format")%>"/>
    7.21 -<TABLE class="style4">
    7.22 +<TABLE class="style4">	
    7.23 +	<% if (request.getAttribute("error") != null) {%>
    7.24 +		<!-- Error Message -->
    7.25 +	  		<TR><TD colspan=2>
    7.26 +	  		<CENTER><P style="color: red;"><%=request.getAttribute("error") %></P></CENTER>
    7.27 +	  		</TD></TR>
    7.28 +		<!-- Error Message -->
    7.29 +	<%}%>
    7.30 +
    7.31 +	<%if (request.getAttribute("info") != null) { %>
    7.32 +		<!-- Info Message -->
    7.33 +  		<TR><TD colspan=2>
    7.34 +  		<CENTER><P><%=request.getAttribute("info") %></P></CENTER>
    7.35 +  		</TD></TR>
    7.36 +		<!-- Info Message -->
    7.37 +	<%}%>
    7.38 +	<tr>
    7.39 +		<td colspan=2 id="output">
    7.40 +			<div style="font-size:13px"> 
    7.41 +				You must be logged in to change configuration, or run in localhost.
    7.42 +			</div>
    7.43 +		</td>	
    7.44 +	</tr>
    7.45  	<TR> 
    7.46  		<TD valign="top" class="style4">Database Name:</TD>
    7.47  		<TD><input type="text" name="dbname" value="<%=request.getAttribute("dbname")%>"/></TD>
    7.48 @@ -78,6 +100,7 @@
    7.49  		<TD colspan=2><input type="submit" value="Connect"/></TD>
    7.50  	</TR>
    7.51  </TABLE>
    7.52 +
    7.53  </FORM>
    7.54  <br/><br/><br/><br/><br/>
    7.55  </BODY>
     8.1 --- a/endpoint/WebContent/describe.jsp	Sun Dec 15 15:45:55 2013 +0200
     8.2 +++ b/endpoint/WebContent/describe.jsp	Fri May 23 13:37:11 2014 +0300
     8.3 @@ -80,13 +80,13 @@
     8.4  		ul#icons span.ui-icon {float: left; margin: 0 1px;}
     8.5  	</style>
     8.6  	
     8.7 -		<title>TELEIOS: Strabon Endpoint</title>
     8.8 +		<title>Strabon Endpoint</title>
     8.9  	
    8.10  	</head>
    8.11  <body topmargin="0" leftmargin="0" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
    8.12  
    8.13  <!-- include TELEIOS header and description -->
    8.14 -<jsp:include page="teleios-header.html"/>
    8.15 +<jsp:include page="header.html"/>
    8.16  <!-- include TELEIOS header and description -->
    8.17  
    8.18  <FORM enctype="UTF-8" accept-charset="UTF-8" method="post" action="Describe">
    8.19 @@ -208,12 +208,13 @@
    8.20  
    8.21  </table></td></tr>
    8.22  
    8.23 +
    8.24 +</table>
    8.25 +</form>
    8.26  <% if (request.getAttribute("response") != null) {%>
    8.27  	<!-- Response -->
    8.28 -	<tr><%=request.getAttribute("response") %></tr>
    8.29 +	<div><%=request.getAttribute("response") %></div>
    8.30  	<!-- Response -->
    8.31  <%}%>
    8.32 -</table>
    8.33 -</form>
    8.34  </body>
    8.35  </html>
    8.36 \ No newline at end of file
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/endpoint/WebContent/header.html	Fri May 23 13:37:11 2014 +0300
     9.3 @@ -0,0 +1,37 @@
     9.4 +<TABLE width="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
     9.5 +  
     9.6 +	<TR>
     9.7 +      <TD height="1"></TD>
     9.8 +	</TR>		
     9.9 +	<TR>
    9.10 +      <TD height="60"> 
    9.11 +        <table width="100%" border=0>
    9.12 +         <tr>
    9.13 +            <td width="1">&nbsp;</td>
    9.14 +            <td valign="top" width="50px"><a href="http://en.uoa.gr"><img border="0" src="images/uoa_logo.png" /></a></td>
    9.15 +            <td valign="middle" align="left">
    9.16 +            <span class="logo"><a href="query.jsp">&nbsp;stSPARQL Endpoint</a></span><br><span class="style4"></span></td>
    9.17 +          </tr>
    9.18 +        </table>
    9.19 +      </TD>
    9.20 +	</TR>
    9.21 +	<TR>
    9.22 +      <TD height="50" id="intro">
    9.23 +<p> On this page you can execute stSPARQL queries against the Strabon backend.
    9.24 +<!--  <a onclick="return toggleMe('par')">(More)</a>  -->
    9.25 +<!--
    9.26 +In this context NOA has been developing a real-time fire hotspot detection service for effectively monitoring 
    9.27 +a fire-front. The technique is based on the use of acquisitions originating from the SEVIRI  sensor, on top of MSG-1 and MSG-2 satellite platforms.
    9.28 +-->
    9.29 +<!-- Since 2007, NOA operates an MSG/SEVIRI acquisition station, and has been systematically
    9.30 +archiving raw satellite images on a 5 and 15 minutes basis, the respective temporal resolutions of MSG-1 and MSG-2.  -->
    9.31 +The acquired data are then annotated using the stRDF model and can be queried using the stSPARQL query language.
    9.32 + 
    9.33 +On the left sidebar, some example stSPARQL queries to aquire information on the dataset, are provided. 
    9.34 +<!--The NOA use case is described in more detail in the VLDB
    9.35 +demo paper <a href="http://www.earthobservatory.eu/publications/p2010_manoliskoubarakis_vldb2012-2.pdf">here</a>. 
    9.36 +-->
    9.37 +</p> 
    9.38 +      </TD>
    9.39 +	</TR>
    9.40 +</TABLE>
    10.1 Binary file endpoint/WebContent/images/uoa_logo.png has changed
    11.1 --- a/endpoint/WebContent/query.jsp	Sun Dec 15 15:45:55 2013 +0200
    11.2 +++ b/endpoint/WebContent/query.jsp	Fri May 23 13:37:11 2014 +0300
    11.3 @@ -172,10 +172,10 @@
    11.4  			var map;
    11.5  			// create map
    11.6  			<%if(request.getAttribute("handle").toString().contains("timemap")){ %>	
    11.7 -			map = tm.getNativeMap();
    11.8 -			map.setOptions(myOptions);
    11.9 +				map = tm.getNativeMap();
   11.10 +				map.setOptions(myOptions);
   11.11  			<%} else {%>
   11.12 -			var map = new google.maps.Map(document.getElementById("map"), myOptions);
   11.13 +				var map = new google.maps.Map(document.getElementById("map"), myOptions);
   11.14  			<%}%>
   11.15  			<% if (request.getAttribute("pathToKML") == null) {%>
   11.16  			//	center at Brahames
   11.17 @@ -185,7 +185,7 @@
   11.18  			addListener(map);
   11.19  
   11.20  			
   11.21 -		<%if ("map_local".equals(request.getAttribute("handle")) || ("timemap_local".equals(request.getAttribute("handle")))) {%>
   11.22 +		<%if ("map_local".equals(request.getAttribute("handle"))) {%>
   11.23  			// display using geoxml3
   11.24  			var myParser = new geoXML3.parser({map: map});
   11.25  			myParser.parse(kml);			
   11.26 @@ -195,7 +195,7 @@
   11.27  		<%}%>
   11.28  		
   11.29  		<%if (("map".equals(request.getAttribute("handle"))) || ("map_local".equals(request.getAttribute("handle")))
   11.30 -		|| ("timemap".equals(request.getAttribute("handle"))) || ("timemap_local".equals(request.getAttribute("handle")))) {%>	
   11.31 +		|| ("timemap".equals(request.getAttribute("handle")))) {%>	
   11.32  			$('html, body').animate({
   11.33  				scrollTop: $("#divResultsStart").offset().top
   11.34  			}, 1500);
   11.35 @@ -306,7 +306,7 @@
   11.36  
   11.37      </script>
   11.38      
   11.39 -     </script>
   11.40 +
   11.41      <link href="js/timemap/examples.css" type="text/css" rel="stylesheet"/>
   11.42      <style>
   11.43      div#timelinecontainer{ height: 310px; }
   11.44 @@ -315,7 +315,7 @@
   11.45      
   11.46   	<!-- jQuery end -->
   11.47   
   11.48 -	<title>TELEIOS: Strabon Endpoint</title>
   11.49 +	<title>Strabon Endpoint</title>
   11.50  	   <!--Load the AJAX API-->
   11.51      <script type="text/javascript" src="https://www.google.com/jsapi"></script>
   11.52      <script type="text/javascript">
   11.53 @@ -355,7 +355,7 @@
   11.54  <body topmargin="0" leftmargin="0" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" onload="initialize()">
   11.55  
   11.56  <!-- include TELEIOS header and description -->
   11.57 -<%@ include file="teleios-header.html"%>
   11.58 +<%@ include file="header.html"%>
   11.59  <!-- include TELEIOS header and description -->
   11.60  
   11.61  <FORM enctype="UTF-8" accept-charset="UTF-8" method="post" action="Query">
   11.62 @@ -438,7 +438,7 @@
   11.63  <tr>
   11.64  	<td id="output" colspan=2>
   11.65  		<div style="font-size:13px"> 
   11.66 -			You must be logged in to perform update queries.
   11.67 +			You must be logged in to perform update queries, or run in localhost.
   11.68  		</div>
   11.69  	</td>
   11.70  </tr>
   11.71 @@ -466,7 +466,6 @@
   11.72  		<OPTION value="map"<%= ("map".equals(handle)) ? "selected":""%>>On a map</OPTION>
   11.73  		<OPTION value="map_local"<%= ("map_local".equals(handle)) ? "selected":""%>>On a map (localhost)</OPTION>
   11.74  		<OPTION value="timemap"<%= ("timemap".equals(handle)) ? "selected":""%>>On a timemap</OPTION>
   11.75 -		<OPTION value="timemap_local"<%= ("timemap_local".equals(handle)) ? "selected":""%>>On a timemap (localhost)</OPTION>
   11.76  	</SELECT>
   11.77  	</td>
   11.78  </tr>
    12.1 --- a/endpoint/WebContent/store.jsp	Sun Dec 15 15:45:55 2013 +0200
    12.2 +++ b/endpoint/WebContent/store.jsp	Fri May 23 13:37:11 2014 +0300
    12.3 @@ -58,12 +58,12 @@
    12.4  		ul#icons li {margin: 1px; position: relative; padding: 1px 0; cursor: pointer; float: left;  list-style: none;}
    12.5  		ul#icons span.ui-icon {float: left; margin: 0 1px;}
    12.6  	</style>
    12.7 -		<title>TELEIOS: Strabon Endpoint</title>
    12.8 +		<title>Strabon Endpoint</title>
    12.9  	</head>
   12.10  <body topmargin="0" leftmargin="0" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
   12.11  
   12.12  <!-- include TELEIOS header and description -->
   12.13 -<jsp:include page="teleios-header.html"/>
   12.14 +<jsp:include page="header.html"/>
   12.15  <!-- include TELEIOS header and description -->
   12.16  
   12.17  <FORM method=POST enctype="UTF-8" accept-charset="UTF-8" action="Store">
   12.18 @@ -159,7 +159,7 @@
   12.19  	<tr>
   12.20  		<td colspan=2 id="output">
   12.21  			<div style="font-size:13px"> 
   12.22 -				You must be logged in to store.
   12.23 +				You must be logged in to store, or run in localhost.
   12.24  			</div>
   12.25  		</td>	
   12.26  	</tr>
    13.1 --- a/endpoint/WebContent/teleios-header.html	Sun Dec 15 15:45:55 2013 +0200
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,44 +0,0 @@
    13.4 -<TABLE width="80%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
    13.5 -  
    13.6 -	<TR>
    13.7 -      <TD height="1"></TD>
    13.8 -	</TR>		
    13.9 -	<TR>
   13.10 -      <TD height="60"> 
   13.11 -        <table width="100%" border=0>
   13.12 -         <tr>
   13.13 -            <td width="1">&nbsp;</td>
   13.14 -            <td valign="top" width="50px"><a href="query.jsp"><img border="0" src="images/teleios_logo.png" /></a></td>
   13.15 -            <td valign="top" align="left">
   13.16 -            <span class="logo"><a href="query.jsp">&nbsp;stSPARQL Endpoint</a></span><br><span class="style4"></span></td>
   13.17 -          </tr>
   13.18 -        </table>
   13.19 -      </TD>
   13.20 -	</TR>
   13.21 -	<TR>
   13.22 -      <TD height="50" id="intro">
   13.23 -<p> On this page you can execute stSPARQL queries against the Strabon backend. 
   13.24 -The dataset is based on  the following ontologies: 
   13.25 -<a href="http://harmonisa.uni-klu.ac.at/content/land-use-land-cover-ontologies">Corine Land Cover</a>, 
   13.26 -<a>Greek Administrative Geography (Kallikratis)</a>, 
   13.27 -<a href="http://labs.mondeca.com/dataset/lov/details/vocabulary_lgdo.html">Linked Geodata</a>, and 
   13.28 -<a href="http://www.geonames.org/search.html?q=ontology&country=">Geonames</a>.
   13.29 -We also use the <a href="http://teleios.di.uoa.gr/ontologies/dlrOntology-v2.owl">DLR</a> and <a href="http://teleios.di.uoa.gr/ontologies/noaOntology.owl">NOA</a> ontology we developed for the 
   13.30 -in the context of the European FP7 project <a href="http://www.earthobservatory.eu/">TELEIOS</a>. 
   13.31 -<!--  <a onclick="return toggleMe('par')">(More)</a>  -->
   13.32 -<!--
   13.33 -In this context NOA has been developing a real-time fire hotspot detection service for effectively monitoring 
   13.34 -a fire-front. The technique is based on the use of acquisitions originating from the SEVIRI  sensor, on top of MSG-1 and MSG-2 satellite platforms.
   13.35 --->
   13.36 -<!-- Since 2007, NOA operates an MSG/SEVIRI acquisition station, and has been systematically
   13.37 -archiving raw satellite images on a 5 and 15 minutes basis, the respective temporal resolutions of MSG-1 and MSG-2.  -->
   13.38 -The acquired data are then annotated using the stRDF model and can be queried using the stSPARQL query language.
   13.39 - 
   13.40 -On the left sidebar, some example stSPARQL queries are provided. 
   13.41 -<!--The NOA use case is described in more detail in the VLDB
   13.42 -demo paper <a href="http://www.earthobservatory.eu/publications/p2010_manoliskoubarakis_vldb2012-2.pdf">here</a>. 
   13.43 --->
   13.44 -</p> 
   13.45 -      </TD>
   13.46 -	</TR>
   13.47 -</TABLE>
    14.1 --- a/endpoint/pom.xml	Sun Dec 15 15:45:55 2013 +0200
    14.2 +++ b/endpoint/pom.xml	Fri May 23 13:37:11 2014 +0300
    14.3 @@ -191,7 +191,7 @@
    14.4  								<include>connection.jsp</include>
    14.5  								<include>connection.jsp</include>
    14.6  								<include>browse.jsp</include>
    14.7 -								<include>teleios-header.html</include>
    14.8 +								<include>header.html</include>
    14.9  							</includes>
   14.10  						</resource>
   14.11  
    15.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/ConnectionBean.java	Sun Dec 15 15:45:55 2013 +0200
    15.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/ConnectionBean.java	Fri May 23 13:37:11 2014 +0300
    15.3 @@ -14,6 +14,7 @@
    15.4  import java.io.FileOutputStream;
    15.5  import java.io.IOException;
    15.6  import java.io.InputStream;
    15.7 +import java.net.InetAddress;
    15.8  import java.util.Properties;
    15.9  
   15.10  import javax.servlet.RequestDispatcher;
   15.11 @@ -59,6 +60,22 @@
   15.12  	 */
   15.13  	private ServletContext context;
   15.14  	
   15.15 +	//Check for localHost. Works with ipV4 and ipV6
   15.16 +	public static boolean isLocalClient(HttpServletRequest request) { 
   15.17 +        HttpServletRequest testRequest = request; 
   15.18 +        try { 
   15.19 +            	InetAddress remote = InetAddress.getByName(testRequest.getRemoteAddr()); 
   15.20 +            	if (remote.isLoopbackAddress()) { 
   15.21 +            		return true;
   15.22 +            	} 
   15.23 +            	InetAddress localHost = InetAddress.getLocalHost(); 
   15.24 +            	String localAddress = localHost.getHostAddress(); 
   15.25 +            	String remoteAddress = remote.getHostAddress(); 
   15.26 +            	return (remoteAddress != null && remoteAddress.equalsIgnoreCase(localAddress)); 
   15.27 +        } catch (Exception e) { } 
   15.28 +        return false; 
   15.29 +    } 
   15.30 +	
   15.31  	@Override
   15.32  	public void init(ServletConfig servletConfig) throws ServletException {
   15.33  		super.init(servletConfig);
   15.34 @@ -85,63 +102,83 @@
   15.35  	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
   15.36  		RequestDispatcher dispatcher;
   15.37  		
   15.38 -		// set new connection details
   15.39 -		strabonWrapper.setConnectionDetails(request.getParameter("dbname"), 
   15.40 -											request.getParameter("username"), 
   15.41 -											request.getParameter("password"), 
   15.42 -											request.getParameter("port"),
   15.43 -											request.getParameter("hostname"), 
   15.44 -											request.getParameter("dbengine"));
   15.45 +		//Authorization
   15.46 +		boolean authorized;
   15.47  		
   15.48 -		// pass the query, format, and the handle that had been issued to the dispatcher
   15.49 -		request.setAttribute("query",  	request.getAttribute("query"));
   15.50 -		request.setAttribute("format",  request.getAttribute("format"));
   15.51 -		request.setAttribute("handle", 	request.getAttribute("handle"));
   15.52 +		if(!isLocalClient(request)) {
   15.53 +			Authenticate authenticate = new Authenticate();
   15.54 +			String authorization = request.getHeader("Authorization");
   15.55 +	   		
   15.56 +			authorized = authenticate.authenticateUser(authorization, context);
   15.57 +		}
   15.58 +		else
   15.59 +			authorized = true;
   15.60 +				
   15.61 +	   	if (!authorized) {	   		 
   15.62 +	   		// not allowed, so report he's unauthorized
   15.63 +	   		response.setHeader("WWW-Authenticate", "BASIC realm=\"Please login\"");
   15.64 +	   		response.sendError(HttpServletResponse.SC_UNAUTHORIZED);	   		 
   15.65 +	   	}
   15.66 +	   	else {	 		
   15.67 +	   	// set new connection details
   15.68 +	 		strabonWrapper.setConnectionDetails(request.getParameter("dbname"), 
   15.69 +	 											request.getParameter("username"), 
   15.70 +	 											request.getParameter("password"), 
   15.71 +	 											request.getParameter("port"),
   15.72 +	 											request.getParameter("hostname"), 
   15.73 +	 											request.getParameter("dbengine"));
   15.74 +	 		
   15.75 +	 		// pass the query, format, and the handle that had been issued to the dispatcher
   15.76 +	 		request.setAttribute("query",  	request.getAttribute("query"));
   15.77 +	 		request.setAttribute("format",  request.getAttribute("format"));
   15.78 +	 		request.setAttribute("handle", 	request.getAttribute("handle"));
   15.79  
   15.80 -		if (logger.isInfoEnabled()) {
   15.81 -			logger.info("[StrabonEndpoint.ConnectionBean] Establishing connection with database using new connection details.");
   15.82 -		}
   15.83 -		
   15.84 -		// establish connection
   15.85 -		if (strabonWrapper.init()) { // successfully connected, go to query.jsp
   15.86 -			if (logger.isInfoEnabled()) {
   15.87 -				logger.info("[StrabonEndpoint.ConnectionBean] Connection with database established.");
   15.88 -				logger.info("[StrabonEndpoint.ConnectionBean] Saving new connection details in {}.", CONNECTION_PROPERTIES_FILE);
   15.89 -			}
   15.90 +	 		if (logger.isInfoEnabled()) {
   15.91 +	 			logger.info("[StrabonEndpoint.ConnectionBean] Establishing connection with database using new connection details.");
   15.92 +	 		}
   15.93 +	 		
   15.94 +	 		// establish connection
   15.95 +	 		if (strabonWrapper.init()) { // successfully connected, go to query.jsp
   15.96 +	 			if (logger.isInfoEnabled()) {
   15.97 +	 				logger.info("[StrabonEndpoint.ConnectionBean] Connection with database established.");
   15.98 +	 				logger.info("[StrabonEndpoint.ConnectionBean] Saving new connection details in {}.", CONNECTION_PROPERTIES_FILE);
   15.99 +	 			}
  15.100 +	 			
  15.101 +	 			// save the new connection details
  15.102 +	 			saveNewConnectionDetails(request.getParameter("dbname"),
  15.103 +	 									 request.getParameter("username"), 
  15.104 +	 									 request.getParameter("password"), 
  15.105 +	 									 request.getParameter("port"), 
  15.106 +	 									 request.getParameter("hostname"), 
  15.107 +	 									 request.getParameter("dbengine"));
  15.108 +	 			
  15.109 +	 			if (logger.isInfoEnabled()) {
  15.110 +	 				logger.info("[StrabonEndpoint.ConnectionBean] New connection details succesfully saved.");
  15.111 +	 			}
  15.112 +	 			
  15.113 +	 			// go to query.jsp
  15.114 +	 			dispatcher = request.getRequestDispatcher("/query.jsp");
  15.115 +	 			
  15.116 +	 		} else { // try again
  15.117 +	 			if (logger.isInfoEnabled()) {
  15.118 +	 				logger.info("[StrabonEndpoint.ConnectionBean] Cannot establish connection with database.");
  15.119 +	 			}
  15.120 +	 			
  15.121 +	 			// pass the current details of the connection
  15.122 +	 			request.setAttribute("dbname", 	 request.getParameter("dbname"));
  15.123 +	 			request.setAttribute("username", request.getParameter("username"));
  15.124 +	 			request.setAttribute("password", request.getParameter("password"));
  15.125 +	 			request.setAttribute("port", 	 request.getParameter("port"));
  15.126 +	 			request.setAttribute("hostname", request.getParameter("hostname"));
  15.127 +	 			request.setAttribute("dbengine", request.getParameter("dbengine"));
  15.128 +	 			
  15.129 +	 			dispatcher = request.getRequestDispatcher("/connection.jsp");
  15.130 +	 			
  15.131 +	 		}
  15.132 +	 		
  15.133 +	 		dispatcher.forward(request, response);
  15.134 +	   	 }		
  15.135  			
  15.136 -			// save the new connection details
  15.137 -			saveNewConnectionDetails(request.getParameter("dbname"),
  15.138 -									 request.getParameter("username"), 
  15.139 -									 request.getParameter("password"), 
  15.140 -									 request.getParameter("port"), 
  15.141 -									 request.getParameter("hostname"), 
  15.142 -									 request.getParameter("dbengine"));
  15.143 -			
  15.144 -			if (logger.isInfoEnabled()) {
  15.145 -				logger.info("[StrabonEndpoint.ConnectionBean] New connection details succesfully saved.");
  15.146 -			}
  15.147 -			
  15.148 -			// go to query.jsp
  15.149 -			dispatcher = request.getRequestDispatcher("/query.jsp");
  15.150 -			
  15.151 -		} else { // try again
  15.152 -			if (logger.isInfoEnabled()) {
  15.153 -				logger.info("[StrabonEndpoint.ConnectionBean] Cannot establish connection with database.");
  15.154 -			}
  15.155 -			
  15.156 -			// pass the current details of the connection
  15.157 -			request.setAttribute("dbname", 	 request.getParameter("dbname"));
  15.158 -			request.setAttribute("username", request.getParameter("username"));
  15.159 -			request.setAttribute("password", request.getParameter("password"));
  15.160 -			request.setAttribute("port", 	 request.getParameter("port"));
  15.161 -			request.setAttribute("hostname", request.getParameter("hostname"));
  15.162 -			request.setAttribute("dbengine", request.getParameter("dbengine"));
  15.163 -			
  15.164 -			dispatcher = request.getRequestDispatcher("/connection.jsp");
  15.165 -			
  15.166 -		}
  15.167 -		
  15.168 -		dispatcher.forward(request, response);
  15.169  	}
  15.170  
  15.171  	private void saveNewConnectionDetails(String dbname, String username, String password, 
    16.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Sun Dec 15 15:45:55 2013 +0200
    16.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Fri May 23 13:37:11 2014 +0300
    16.3 @@ -267,8 +267,7 @@
    16.4  				    
    16.5  				    out.flush();
    16.6  				    
    16.7 -				} else if (("map".equals(handle) || "map_local".equals(handle) ||
    16.8 -				"timemap".equals(handle) || "timemap_local".equals(handle) ) && 
    16.9 +				} else if (("map".equals(handle) || "map_local".equals(handle) || "timemap".equals(handle)) && 
   16.10  						(queryResultFormat == stSPARQLQueryResultFormat.KML || 
   16.11  						 queryResultFormat == stSPARQLQueryResultFormat.KMZ) ) {
   16.12  					// show map (only valid for KML/KMZ)
    17.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StoreBean.java	Sun Dec 15 15:45:55 2013 +0200
    17.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StoreBean.java	Fri May 23 13:37:11 2014 +0300
    17.3 @@ -11,6 +11,7 @@
    17.4  
    17.5  import java.io.IOException;
    17.6  import java.io.UnsupportedEncodingException;
    17.7 +import java.net.InetAddress;
    17.8  import java.net.MalformedURLException;
    17.9  import java.net.URLDecoder;
   17.10  import java.util.Map;
   17.11 @@ -65,7 +66,23 @@
   17.12  	 * The context of the servlet
   17.13  	 */
   17.14  	private ServletContext context;
   17.15 -			
   17.16 +	
   17.17 +	//Check for localHost. Works with ipV4 and ipV6
   17.18 +	public static boolean isLocalClient(HttpServletRequest request) { 
   17.19 +	    HttpServletRequest testRequest = request; 
   17.20 +	    try { 
   17.21 +	    	InetAddress remote = InetAddress.getByName(testRequest.getRemoteAddr()); 
   17.22 +	        if (remote.isLoopbackAddress()) { 
   17.23 +	            return true;
   17.24 +	        } 
   17.25 +	        InetAddress localHost = InetAddress.getLocalHost(); 
   17.26 +	        String localAddress = localHost.getHostAddress(); 
   17.27 +	        String remoteAddress = remote.getHostAddress(); 
   17.28 +	        return (remoteAddress != null && remoteAddress.equalsIgnoreCase(localAddress)); 
   17.29 +	    } catch (Exception e) { } 
   17.30 +	    return false; 
   17.31 +	} 
   17.32 +	
   17.33  	@Override
   17.34  	public void init(ServletConfig servletConfig) throws ServletException {
   17.35  		super.init(servletConfig);
   17.36 @@ -95,7 +112,7 @@
   17.37  						 
   17.38  		boolean authorized;
   17.39  		
   17.40 -		if(!request.getLocalAddr().equals("127.0.0.1")) {
   17.41 +		if(!isLocalClient(request)) {
   17.42  			Authenticate authenticate = new Authenticate();
   17.43  			String authorization = request.getHeader("Authorization");
   17.44  	   		
    18.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java	Sun Dec 15 15:45:55 2013 +0200
    18.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java	Fri May 23 13:37:11 2014 +0300
    18.3 @@ -61,6 +61,7 @@
    18.4  	private String password;
    18.5  	private String dbBackend;
    18.6  	private int maxLimit;
    18.7 +	private boolean loadFromFile;
    18.8  	private String prefixes;
    18.9  	
   18.10  	private Strabon strabon = null;
   18.11 @@ -72,7 +73,7 @@
   18.12  
   18.13  	public StrabonBeanWrapper(String databaseName, String user, String password, 
   18.14  			int port, String serverName, boolean checkForLockTable, String dbBackend, 
   18.15 -			int maxLimit, String prefixes, 	List<List<String>> args) {
   18.16 +			int maxLimit, boolean loadFromFile,String prefixes, 	List<List<String>> args) {
   18.17  		this.serverName = serverName;
   18.18  		this.port = port;
   18.19  		this.databaseName = databaseName;
   18.20 @@ -80,7 +81,8 @@
   18.21  		this.password = password;
   18.22  		this.checkForLockTable = checkForLockTable;
   18.23  		this.dbBackend = dbBackend;
   18.24 -		this.maxLimit = maxLimit;		
   18.25 +		this.maxLimit = maxLimit;	
   18.26 +		this.loadFromFile = loadFromFile;
   18.27  		this.prefixes = prefixes;
   18.28  		this.entries = new ArrayList<StrabonBeanWrapperConfiguration>(args.size());
   18.29  		
   18.30 @@ -358,10 +360,11 @@
   18.31  
   18.32  		if (url) {
   18.33  			URL source = new URL(src);
   18.34 -			if (source.getProtocol().equalsIgnoreCase(FILE_PROTOCOL)) {
   18.35 +			if (source.getProtocol().equalsIgnoreCase(FILE_PROTOCOL) && !loadFromFile) {
   18.36  				// it would be a security issue if we read from the server's filesystem
   18.37  				throw new IllegalArgumentException("The protocol of the URL should be one of http or ftp.");
   18.38  			}
   18.39 +			
   18.40  		}
   18.41  
   18.42  		strabon.storeInRepo(src, null, context, format, inference);
    19.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/UpdateBean.java	Sun Dec 15 15:45:55 2013 +0200
    19.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/UpdateBean.java	Fri May 23 13:37:11 2014 +0300
    19.3 @@ -10,6 +10,7 @@
    19.4  package eu.earthobservatory.org.StrabonEndpoint;
    19.5  
    19.6  import java.io.IOException;
    19.7 +import java.net.InetAddress;
    19.8  import java.net.URLDecoder;
    19.9  
   19.10  import javax.servlet.RequestDispatcher;
   19.11 @@ -38,6 +39,22 @@
   19.12  	
   19.13  	private StrabonBeanWrapper strabonWrapper;
   19.14  	
   19.15 +	//Check for localHost. Works with ipV4 and ipV6
   19.16 +	public static boolean isLocalClient(HttpServletRequest request) { 
   19.17 +		HttpServletRequest testRequest = request; 
   19.18 +		try { 
   19.19 +		   	InetAddress remote = InetAddress.getByName(testRequest.getRemoteAddr()); 
   19.20 +		    if (remote.isLoopbackAddress()) { 
   19.21 +		        return true;
   19.22 +		    } 
   19.23 +		    InetAddress localHost = InetAddress.getLocalHost(); 
   19.24 +		    String localAddress = localHost.getHostAddress(); 
   19.25 +		    String remoteAddress = remote.getHostAddress(); 
   19.26 +		    return (remoteAddress != null && remoteAddress.equalsIgnoreCase(localAddress)); 
   19.27 +		} catch (Exception e) { } 
   19.28 +		return false; 
   19.29 +	} 
   19.30 +	
   19.31  	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
   19.32  		doPost(request, response);
   19.33  	}
   19.34 @@ -59,7 +76,7 @@
   19.35  		
   19.36  		request.setCharacterEncoding("UTF-8");						
   19.37  		ServletContext context = getServletContext();
   19.38 -		if(!request.getLocalAddr().equals("127.0.0.1")) {
   19.39 +		if(!isLocalClient(request)) {
   19.40  			Authenticate authenticate = new Authenticate();
   19.41  			String authorization = request.getHeader("Authorization");
   19.42  	   		
    20.1 --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/AbstractWKT.java	Sun Dec 15 15:45:55 2013 +0200
    20.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/AbstractWKT.java	Fri May 23 13:37:11 2014 +0300
    20.3 @@ -24,6 +24,7 @@
    20.4   * might not be valid.
    20.5   * 
    20.6   * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    20.7 + * @author Panayiotis Smeros <psmeros@di.uoa.gr>
    20.8   */
    20.9  public class AbstractWKT {
   20.10  
   20.11 @@ -94,7 +95,7 @@
   20.12  	public AbstractWKT(String literalValue) {
   20.13  		datatype = null;
   20.14  		
   20.15 -		if (literalValue.indexOf(WKTHelper.STRDF_SRID_DELIM) > 0) { // strdf:WKT
   20.16 +		if (literalValue.lastIndexOf(WKTHelper.STRDF_SRID_DELIM) > 0) { // strdf:WKT
   20.17  			datatype = GeoConstants.WKT;
   20.18  		
   20.19  			isstRDFWKT = true;
    21.1 --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/WKTHelper.java	Sun Dec 15 15:45:55 2013 +0200
    21.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/WKTHelper.java	Fri May 23 13:37:11 2014 +0300
    21.3 @@ -18,6 +18,7 @@
    21.4  /**
    21.5   * 
    21.6   * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    21.7 + * @author Panayiotis Smeros <psmeros@di.uoa.gr>
    21.8   *
    21.9   */
   21.10  public class WKTHelper {
   21.11 @@ -37,7 +38,7 @@
   21.12  	public static String getWithoutSRID(String wkt) {
   21.13  		if (wkt == null) return wkt;
   21.14  		
   21.15 -		int pos = wkt.indexOf(STRDF_SRID_DELIM);
   21.16 +		int pos = wkt.lastIndexOf(STRDF_SRID_DELIM);
   21.17  		if (pos != -1) {
   21.18  			return wkt.substring(0, pos);
   21.19  			
   21.20 @@ -59,7 +60,7 @@
   21.21  		
   21.22  		if (wkt == null) return srid;
   21.23  		
   21.24 -		int pos = wkt.indexOf(STRDF_SRID_DELIM);
   21.25 +		int pos = wkt.lastIndexOf(STRDF_SRID_DELIM);
   21.26  		if (pos != -1) {
   21.27  			try {
   21.28  				srid = Integer.parseInt(wkt.substring(wkt.lastIndexOf(CUT_DELIM) + 1).replace(URI_ENDING, ""));
    22.1 --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/iterator/StSPARQLGroupIterator.java	Sun Dec 15 15:45:55 2013 +0200
    22.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/iterator/StSPARQLGroupIterator.java	Fri May 23 13:37:11 2014 +0300
    22.3 @@ -449,9 +449,17 @@
    22.4  				}
    22.5  				else if(function instanceof IntersectionFunc)
    22.6  				{
    22.7 -					leftArg = (StrabonPolyhedron) evaluateConstruct(((FunctionCall) expr).getArgs().get(0),prototype);
    22.8 -					rightArg = (StrabonPolyhedron) evaluateConstruct(((FunctionCall) expr).getArgs().get(1),prototype);
    22.9 -					return StrabonPolyhedron.intersection(leftArg, rightArg);
   22.10 +					if(((FunctionCall) expr).getArgs().size()==1)
   22.11 +					{
   22.12 +						//Aggregate!!! => Value ready in spatialAggregatesResults
   22.13 +						return new StrabonPolyhedron(spatialAggregatesResult.get(expr));
   22.14 +					}
   22.15 +					else
   22.16 +					{
   22.17 +						leftArg = (StrabonPolyhedron) evaluateConstruct(((FunctionCall) expr).getArgs().get(0),prototype);
   22.18 +						rightArg = (StrabonPolyhedron) evaluateConstruct(((FunctionCall) expr).getArgs().get(1),prototype);
   22.19 +						return StrabonPolyhedron.intersection(leftArg, rightArg);
   22.20 +					}
   22.21  				}
   22.22  				else if(function instanceof DifferenceFunc)
   22.23  				{
   22.24 @@ -510,13 +518,14 @@
   22.25  			computeAggregateFunctions(fc, bindingSet);
   22.26  		}
   22.27  
   22.28 -		//Currently: Either Union OR Extent
   22.29 +		//Currently: Either Union OR Extent OR Intersection
   22.30  		private void computeAggregateFunctions(ValueExpr expr, BindingSet bindingSet)
   22.31  		{
   22.32  			if(expr instanceof FunctionCall)
   22.33  			{
   22.34  				Function function = FunctionRegistry.getInstance().get(((FunctionCall) expr).getURI());
   22.35  				boolean condition = ((!(function instanceof UnionFunc) || !(((FunctionCall) expr).getArgs().size()==1))
   22.36 +						&& (!(function instanceof IntersectionFunc) || !(((FunctionCall) expr).getArgs().size()==1))
   22.37  						&&!(function instanceof ExtentFunc));
   22.38  				if(condition)
   22.39  				{
   22.40 @@ -574,6 +583,10 @@
   22.41  						{
   22.42  							this.spatialAggregatesResult.put((FunctionCall) expr, poly.getGeometry());
   22.43  						}
   22.44 +						else if(function instanceof IntersectionFunc)
   22.45 +						{
   22.46 +							this.spatialAggregatesResult.put((FunctionCall) expr, poly.getGeometry());
   22.47 +						}
   22.48  						else if(function instanceof ExtentFunc)
   22.49  						{
   22.50  							Geometry env = poly.getGeometry().getEnvelope();
   22.51 @@ -593,6 +606,15 @@
   22.52  							united.setSRID(poly.getGeometry().getSRID());
   22.53  							this.spatialAggregatesResult.put((FunctionCall) expr, united);
   22.54  						}
   22.55 +						else if(function instanceof IntersectionFunc)
   22.56 +						{
   22.57 +							//XXX possible issue with expressions like
   22.58 +							// ?x hasGeom sth^^4326
   22.59 +							// ?x hasGeom sthElse^^2100
   22.60 +							Geometry intersection = aggr.intersection(poly.getGeometry());
   22.61 +							intersection.setSRID(poly.getGeometry().getSRID());
   22.62 +							this.spatialAggregatesResult.put((FunctionCall) expr, intersection);
   22.63 +						}
   22.64  						else if(function instanceof ExtentFunc)
   22.65  						{
   22.66  							//XXX possible issue with expressions like 
    23.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java	Sun Dec 15 15:45:55 2013 +0200
    23.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java	Fri May 23 13:37:11 2014 +0300
    23.3 @@ -49,6 +49,7 @@
    23.4  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.ConvexHullFunc;
    23.5  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.EnvelopeFunc;
    23.6  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.UnionFunc;
    23.7 +import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.IntersectionFunc;
    23.8  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.metric.AreaFunc;
    23.9  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.RelateFunc;
   23.10  import org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct.PeriodEndsFunc;
   23.11 @@ -924,7 +925,8 @@
   23.12  				&& !(function instanceof GeoSparqlConvexHullFunc)
   23.13  				&& !(function instanceof GeoSparqlEnvelopeFunc)
   23.14  				&& !(function instanceof Centroid)
   23.15 -				&& !(function instanceof UnionFunc && functionCall.getArgs().size()==1))
   23.16 +				&& !(function instanceof UnionFunc && functionCall.getArgs().size()==1)
   23.17 +				&& !(function instanceof IntersectionFunc && functionCall.getArgs().size()==1))
   23.18  		{
   23.19  			ValueExpr right = functionCall.getArgs().get(1);
   23.20  			if(right instanceof FunctionCall)
    24.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/model/GeneralDBPolyhedron.java	Sun Dec 15 15:45:55 2013 +0200
    24.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/model/GeneralDBPolyhedron.java	Fri May 23 13:37:11 2014 +0300
    24.3 @@ -111,16 +111,32 @@
    24.4  
    24.5  
    24.6  	public String stringValue() {
    24.7 -		return new String(this.polyhedronStringRep)+";http://www.opengis.net/def/crs/EPSG/0/"+this.getPolyhedron().getGeometry().getSRID();
    24.8 +		if(String.valueOf(datatype) == GeoConstants.WKT)
    24.9 +			return new String(this.polyhedronStringRep)+";http://www.opengis.net/def/crs/EPSG/0/"+this.getPolyhedron().getGeometry().getSRID();
   24.10 +		else
   24.11 +			return new String("<http://www.opengis.net/def/crs/EPSG/0/"+this.getPolyhedron().getGeometry().getSRID()+"> "+this.polyhedronStringRep);
   24.12  	}
   24.13  
   24.14  	@Override
   24.15  	public String toString() {
   24.16 -		return new String("\""+this.polyhedronStringRep+";http://www.opengis.net/def/crs/EPSG/0/"
   24.17 -				+this.getPolyhedron().getGeometry().getSRID()+"\"" + "^^<" + 
   24.18 -				((StrabonPolyhedron.EnableConstraintRepresentation)  ? 
   24.19 -						GeoConstants.stRDFSemiLinearPointset : GeoConstants.WKT)
   24.20 -						+">");
   24.21 +		if(String.valueOf(datatype) == GeoConstants.WKT)
   24.22 +		{
   24.23 +			return new String("\""+this.polyhedronStringRep+";http://www.opengis.net/def/crs/EPSG/0/"
   24.24 +					+this.getPolyhedron().getGeometry().getSRID()+"\"" + "^^<" +
   24.25 +					((StrabonPolyhedron.EnableConstraintRepresentation)  ?
   24.26 +							GeoConstants.stRDFSemiLinearPointset : String.valueOf(datatype))
   24.27 +							+">");
   24.28 +		}
   24.29 +		else if(String.valueOf(datatype) == GeoConstants.WKTLITERAL)
   24.30 +		{
   24.31 +			return new String("\""+"<"+"http://www.opengis.net/def/crs/EPSG/0/"+this.getPolyhedron().getGeometry().getSRID()+"> "+this.polyhedronStringRep
   24.32 +					+"\"" + "^^<" +
   24.33 +					((StrabonPolyhedron.EnableConstraintRepresentation)  ?
   24.34 +							GeoConstants.stRDFSemiLinearPointset : String.valueOf(datatype))
   24.35 +							+">");
   24.36 +		}
   24.37 +		//must not reach this place
   24.38 +		return null;
   24.39  	}
   24.40  
   24.41  	@Override
    25.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/AggregateOptimizer.java	Sun Dec 15 15:45:55 2013 +0200
    25.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/AggregateOptimizer.java	Fri May 23 13:37:11 2014 +0300
    25.3 @@ -20,6 +20,7 @@
    25.4  import org.openrdf.query.algebra.evaluation.function.Function;
    25.5  import org.openrdf.query.algebra.evaluation.function.FunctionRegistry;
    25.6  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.aggregate.ExtentFunc;
    25.7 +import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.IntersectionFunc;
    25.8  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.UnionFunc;
    25.9  import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase;
   25.10  /**
   25.11 @@ -64,15 +65,17 @@
   25.12  		if(expr instanceof FunctionCall)
   25.13  		{
   25.14  			Function function = FunctionRegistry.getInstance().get(((FunctionCall) expr).getURI());
   25.15 -			if((!(function instanceof UnionFunc) || !(((FunctionCall) expr).getArgs().size()==1))&&!(function instanceof ExtentFunc))
   25.16 +			if((!(function instanceof UnionFunc) || !(((FunctionCall) expr).getArgs().size()==1))
   25.17 +					&& (!(function instanceof IntersectionFunc) || !(((FunctionCall) expr).getArgs().size()==1))
   25.18 +					&&!(function instanceof ExtentFunc))
   25.19  			{
   25.20  				//Recursively check arguments
   25.21 -				boolean unionPresent = false;
   25.22 +				boolean aggregatePresent = false;
   25.23  				for(int i = 0 ; i< ((FunctionCall) expr).getArgs().size(); i++)
   25.24  				{
   25.25 -					unionPresent = unionPresent || aggregateInQuery(((FunctionCall) expr).getArgs().get(i));
   25.26 +					aggregatePresent = aggregatePresent || aggregateInQuery(((FunctionCall) expr).getArgs().get(i));
   25.27  				}
   25.28 -				return unionPresent;
   25.29 +				return aggregatePresent;
   25.30  			}
   25.31  			else
   25.32  				return true;
    26.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBSelectQueryOptimizer.java	Sun Dec 15 15:45:55 2013 +0200
    26.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBSelectQueryOptimizer.java	Fri May 23 13:37:11 2014 +0300
    26.3 @@ -71,6 +71,7 @@
    26.4  import org.openrdf.query.algebra.evaluation.function.spatial.SpatialRelationshipFunc;
    26.5  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.aggregate.ExtentFunc;
    26.6  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.BufferFunc;
    26.7 +import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.IntersectionFunc;
    26.8  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.TransformFunc;
    26.9  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.UnionFunc;
   26.10  import org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct.PeriodEndsFunc;
   26.11 @@ -1449,7 +1450,7 @@
   26.12  
   26.13  	/**
   26.14  	 * Function used recursively to specify whether the function call present in the select clause contains an aggregate
   26.15 -	 * of the form strdf:union(?aggrValue). 
   26.16 +	 * of the form strdf:union(?aggrValue) or strdf:intersection(?aggrValue). 
   26.17  	 * @param expr 
   26.18  	 * @return true if no aggregate is present, false otherwise.
   26.19  	 */
   26.20 @@ -1458,19 +1459,22 @@
   26.21  		if(expr instanceof FunctionCall)
   26.22  		{
   26.23  			Function function = FunctionRegistry.getInstance().get(((FunctionCall) expr).getURI());
   26.24 -			if((!(function instanceof UnionFunc) || !(((FunctionCall) expr).getArgs().size()==1))&&!(function instanceof ExtentFunc) && !(function instanceof PeriodPrecedingFunc)
   26.25 -					&& !(function instanceof PeriodSucceedingFunc))
   26.26 +			if((!(function instanceof UnionFunc) || !(((FunctionCall) expr).getArgs().size()==1))
   26.27 +					&&(!(function instanceof IntersectionFunc) || !(((FunctionCall) expr).getArgs().size()==1))
   26.28 +                                        && !(function instanceof PeriodPrecedingFunc)  
   26.29 +                                        && !(function instanceof PeriodSucceedingFunc)
   26.30 +					&&!(function instanceof ExtentFunc))
   26.31  			{
   26.32  				//Recursively check arguments
   26.33 -				boolean unionPresent = false;
   26.34 +				boolean aggregatePresent = false;
   26.35  				for(int i = 0 ; i< ((FunctionCall) expr).getArgs().size(); i++)
   26.36  				{
   26.37  					//ValueExpr tmp = ((FunctionCall) expr).getArgs().get(i);
   26.38  					//containsAggregateUnion = containsAggregateUnion || evaluateInDB(tmp);
   26.39  					//					noUnionPresent = noUnionPresent ^ evaluateInJava(((FunctionCall) expr).getArgs().get(i));
   26.40 -					unionPresent = unionPresent || evaluateInJava(((FunctionCall) expr).getArgs().get(i));
   26.41 +					aggregatePresent = aggregatePresent || evaluateInJava(((FunctionCall) expr).getArgs().get(i));
   26.42  				}
   26.43 -				return unionPresent;
   26.44 +				return aggregatePresent;
   26.45  			}
   26.46  			else
   26.47  			{
   26.48 @@ -1987,6 +1991,7 @@
   26.49  				Function function = FunctionRegistry.getInstance().get(((FunctionCall) expr).getURI());
   26.50  				//Aggregate Function
   26.51  				if(((function instanceof UnionFunc) && (((FunctionCall) expr).getArgs().size()==1))
   26.52 +						|| ((function instanceof IntersectionFunc) && (((FunctionCall) expr).getArgs().size()==1))
   26.53  						|| (function instanceof ExtentFunc))
   26.54  				{
   26.55  					GroupElem groupElem = new GroupElem("havingCondition"+(havingID++)+"-aggregateInside-", new Avg(expr));
    27.1 --- a/pom.xml	Sun Dec 15 15:45:55 2013 +0200
    27.2 +++ b/pom.xml	Fri May 23 13:37:11 2014 +0300
    27.3 @@ -96,14 +96,14 @@
    27.4  		</developer>
    27.5  		<developer>
    27.6  			<id>psmeros</id>
    27.7 -			<name>Panagiotis Smeros</name>
    27.8 +			<name>Panayiotis Smeros</name>
    27.9  			<email>psmeros@di.uoa.gr</email>
   27.10  			<url>http://users.uoa.gr/~psmeros/</url>
   27.11  			<organization>Management of Data, Information and Knowledge Group, Dept. of Informatics and Telecommunications, School of Sciences, National and Kapodistrian University of Athens</organization>
   27.12  			<organizationUrl>http://www.madgik.di.uoa.gr/</organizationUrl>
   27.13  			<timezone>+2</timezone>
   27.14  			<properties>
   27.15 -				<picUrl>http://users.uoa.gr/~psmeros/images/me%20and%20plastic%20yiayia.JPG</picUrl>
   27.16 +				<picUrl>http://users.uoa.gr/~psmeros/images/psmeros.jpg</picUrl>
   27.17  			</properties>
   27.18  		</developer>
   27.19  		<developer>
    28.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Sun Dec 15 15:45:55 2013 +0200
    28.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Fri May 23 13:37:11 2014 +0300
    28.3 @@ -1500,6 +1500,7 @@
    28.4  					else if (tmp instanceof GeneralDBStringValue) //Constant!!
    28.5  					{
    28.6  						sridNeeded  = false;
    28.7 +						sridExpr = String.valueOf(WKTHelper.getSRID(((GeneralDBStringValue) tmp).getValue()));
    28.8  						break;
    28.9  					}
   28.10  
   28.11 @@ -1539,12 +1540,15 @@
   28.12  			}
   28.13  
   28.14  			//SRID Support
   28.15 -			if(expr instanceof GeneralDBSqlSpatialConstructBinary && expr.getParentNode() == null)
   28.16 -			{
   28.17 -				filter.appendComma();
   28.18 -				//filter.append(((GeneralDBSqlSpatialConstructBinary)expr).getSrid());
   28.19 -				filter.append(sridExpr);
   28.20 -				filter.closeBracket();
   28.21 +			if(sridNeeded)
   28.22 +			{	
   28.23 +				if(expr instanceof GeneralDBSqlSpatialConstructBinary && expr.getParentNode() == null && sridNeeded)
   28.24 +				{
   28.25 +					filter.appendComma();
   28.26 +					//filter.append(((GeneralDBSqlSpatialConstructBinary)expr).getSrid());
   28.27 +					filter.append(sridExpr);
   28.28 +					filter.closeBracket();
   28.29 +				}
   28.30  			}
   28.31  
   28.32  			filter.appendComma();
   28.33 @@ -1946,6 +1950,7 @@
   28.34  					else if (tmp instanceof GeneralDBStringValue) //Constant!!
   28.35  					{
   28.36  						sridNeeded  = false;
   28.37 +						sridExpr = String.valueOf(WKTHelper.getSRID(((GeneralDBStringValue) tmp).getValue()));
   28.38  						break;
   28.39  					}
   28.40  
   28.41 @@ -2073,12 +2078,15 @@
   28.42  
   28.43  			filter.closeBracket();
   28.44  			//SRID Support
   28.45 -			if(expr instanceof GeneralDBSqlSpatialConstructBinary && expr.getParentNode() == null)
   28.46 -			{
   28.47 -				filter.appendComma();
   28.48 -				//filter.append(((GeneralDBSqlSpatialConstructBinary)expr).getSrid());
   28.49 -				filter.append(sridExpr);
   28.50 -				filter.closeBracket();
   28.51 +			if(sridNeeded)
   28.52 +			{	
   28.53 +				if(expr instanceof GeneralDBSqlSpatialConstructBinary && expr.getParentNode() == null)
   28.54 +				{
   28.55 +					filter.appendComma();
   28.56 +					//filter.append(((GeneralDBSqlSpatialConstructBinary)expr).getSrid());
   28.57 +					filter.append(sridExpr);
   28.58 +					filter.closeBracket();
   28.59 +				}
   28.60  			}
   28.61  			///
   28.62  		}
   28.63 @@ -2339,6 +2347,7 @@
   28.64  					else if (tmp instanceof GeneralDBStringValue) //Constant!!
   28.65  					{
   28.66  						sridNeeded  = false;
   28.67 +						sridExpr = String.valueOf(WKTHelper.getSRID(((GeneralDBStringValue) tmp).getValue()));
   28.68  						break;
   28.69  					}
   28.70  				}
   28.71 @@ -2493,14 +2502,17 @@
   28.72  			}
   28.73  			
   28.74  			if(units.equals(OGCConstants.OGCmetre) && !((expr.getRightArg() instanceof GeneralDBDoubleValue) && (((GeneralDBDoubleValue)expr.getRightArg()).getValue().equals(0.0))))
   28.75 -				filter.closeBracket(); //close Geometry
   28.76 +			filter.closeBracket(); //close Geometry
   28.77  			filter.closeBracket();
   28.78  			//SRID Support
   28.79 -			if(expr instanceof GeneralDBSqlSpatialConstructTriple && expr.getParentNode() == null)
   28.80 -			{
   28.81 -				filter.appendComma();
   28.82 -				filter.append(sridExpr);
   28.83 -				filter.closeBracket();
   28.84 +			if(sridNeeded)
   28.85 +			{	
   28.86 +				if(expr instanceof GeneralDBSqlSpatialConstructTriple && expr.getParentNode() == null)
   28.87 +				{
   28.88 +					filter.appendComma();
   28.89 +					filter.append(sridExpr);
   28.90 +					filter.closeBracket();
   28.91 +				}
   28.92  			}
   28.93  			///
   28.94  		}
   28.95 @@ -2586,6 +2598,7 @@
   28.96  					else if (tmp instanceof GeneralDBStringValue) //Constant!!
   28.97  					{
   28.98  						sridNeeded  = false;
   28.99 +						sridExpr = String.valueOf(WKTHelper.getSRID(((GeneralDBStringValue) tmp).getValue()));
  28.100  						break;
  28.101  					}
  28.102  
  28.103 @@ -2659,17 +2672,18 @@
  28.104  
  28.105  		filter.closeBracket();
  28.106  		//Used to explicitly include SRID
  28.107 +		
  28.108  		if(expr instanceof GeneralDBSqlSpatialConstructUnary && expr.getParentNode() == null)
  28.109  		{
  28.110  			filter.appendComma();
  28.111  			filter.append(sridExpr);
  28.112  		}
  28.113 -			}
  28.114 +		
  28.115 +	}
  28.116  
  28.117  	//Used in all the generaldb boolean spatial functions of the form ST_Function(?GEO1,?GEO2) 
  28.118 -	protected void appendGeneralDBSpatialFunctionTriple(TripleGeneralDBOperator expr, GeneralDBSqlExprBuilder filter, SpatialFunctionsPostGIS func)
  28.119 -			throws UnsupportedRdbmsOperatorException
  28.120 -			{
  28.121 +	protected void appendGeneralDBSpatialFunctionTriple(TripleGeneralDBOperator expr, GeneralDBSqlExprBuilder filter, SpatialFunctionsPostGIS func) throws UnsupportedRdbmsOperatorException
  28.122 +	{
  28.123  		filter.openBracket();
  28.124  
  28.125  		boolean check1a = expr.getLeftArg().getClass().getCanonicalName().equals("org.openrdf.sail.generaldb.algebra.GeneralDBSqlNull");
    29.1 --- a/resultio-spatial/sparqlhtml/src/main/java/org/openrdf/query/resultio/sparqlhtml/stSPARQLResultsHTMLWriter.java	Sun Dec 15 15:45:55 2013 +0200
    29.2 +++ b/resultio-spatial/sparqlhtml/src/main/java/org/openrdf/query/resultio/sparqlhtml/stSPARQLResultsHTMLWriter.java	Fri May 23 13:37:11 2014 +0300
    29.3 @@ -110,6 +110,12 @@
    29.4  		try {
    29.5  			StringBuilder value = new StringBuilder();
    29.6  			Value boundValue = null;
    29.7 +			String href;
    29.8 +			
    29.9 +			// if set to FALSE, urls link to web. if set to TRUE, urls are described //
   29.10 +			boolean linkURL = false; 
   29.11 +			///////////////////////////////////////////////////////////////////////////
   29.12 +			
   29.13  			
   29.14  			xmlWriter.startTag(TABLE_ROW_TAG);
   29.15  			for (String bindingName : bindingNames) {
   29.16 @@ -130,7 +136,8 @@
   29.17  						xmlWriter.startTag(TABLE_DATA_TAG);
   29.18  						
   29.19  						// select all the triples that contain the boundValue  
   29.20 -						String query= "select * " +
   29.21 +						if (linkURL){
   29.22 +							String query= "select * " +
   29.23  								"where " +
   29.24  								"{ " +
   29.25  								  "?subject ?predicate ?object . "+
   29.26 @@ -138,8 +145,11 @@
   29.27  								         "(?predicate = <"+ boundValue.toString()+ ">)  || "+
   29.28  								         "(?object = <"+ boundValue.toString()+ ">)) " +  
   29.29  								"}";
   29.30 -						
   29.31 -						String href = "Browse?view=HTML&query="+URLEncoder.encode(query, "UTF-8")+"&format=HTML&resource="+URLEncoder.encode(boundValue.toString(), "UTF-8");						
   29.32 +							href = "Browse?view=HTML&query="+URLEncoder.encode(query, "UTF-8")+"&format=HTML&resource="+URLEncoder.encode(boundValue.toString(), "UTF-8");						
   29.33 +						}
   29.34 +						else{							
   29.35 +							href = boundValue.toString();
   29.36 +						}
   29.37  						xmlWriter.setAttribute(LINK_REF, href);
   29.38  						xmlWriter.startTag(LINK);							
   29.39  						xmlWriter.text(boundValue.toString());					
    30.1 --- a/resultio-spatial/sparqlxml/pom.xml	Sun Dec 15 15:45:55 2013 +0200
    30.2 +++ b/resultio-spatial/sparqlxml/pom.xml	Fri May 23 13:37:11 2014 +0300
    30.3 @@ -20,6 +20,10 @@
    30.4  		</dependency>
    30.5  		<dependency>
    30.6  			<groupId>org.openrdf.sesame</groupId>
    30.7 +			<artifactId>sesame-sail-generaldb</artifactId>
    30.8 +		</dependency>
    30.9 +		<dependency>
   30.10 +			<groupId>org.openrdf.sesame</groupId>
   30.11  			<artifactId>sesame-queryresultio-sparqlxml</artifactId>
   30.12  		</dependency>
   30.13                  <dependency> <!-- TO BE REMOVED -->
    31.1 --- a/resultio-spatial/sparqlxml/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsXMLWriter.java	Sun Dec 15 15:45:55 2013 +0200
    31.2 +++ b/resultio-spatial/sparqlxml/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsXMLWriter.java	Fri May 23 13:37:11 2014 +0300
    31.3 @@ -37,6 +37,8 @@
    31.4  import org.openrdf.query.resultio.TupleQueryResultFormat;
    31.5  import org.openrdf.query.resultio.TupleQueryResultWriter;
    31.6  import org.openrdf.query.resultio.stSPARQLQueryResultFormat;
    31.7 +import org.openrdf.sail.generaldb.model.GeneralDBPolyhedron;
    31.8 +
    31.9  
   31.10  import eu.earthobservatory.constants.GeoConstants;
   31.11  
   31.12 @@ -158,7 +160,8 @@
   31.13  		else { // spatial literal
   31.14  			// else if (value instanceof RdbmsPolyhedron)
   31.15  			URI datatype = new URIImpl(GeoConstants.WKT);
   31.16 -			Literal literal = new LiteralImpl(value.stringValue(), datatype);
   31.17 +			GeneralDBPolyhedron dbpolyhedron = (GeneralDBPolyhedron) value;
   31.18 +			Literal literal = new LiteralImpl(value.stringValue(), dbpolyhedron.getDatatype());
   31.19  			writeLiteral(literal);
   31.20  		}
   31.21  	}
    32.1 --- a/resultio-spatial/text/src/main/java/org/openrdf/query/resultio/text/stSPARQLResultsTSVWriter.java	Sun Dec 15 15:45:55 2013 +0200
    32.2 +++ b/resultio-spatial/text/src/main/java/org/openrdf/query/resultio/text/stSPARQLResultsTSVWriter.java	Fri May 23 13:37:11 2014 +0300
    32.3 @@ -22,6 +22,8 @@
    32.4  import org.openrdf.query.resultio.text.tsv.SPARQLResultsTSVWriter;
    32.5  import org.openrdf.sail.generaldb.model.GeneralDBPolyhedron;
    32.6  
    32.7 +import eu.earthobservatory.constants.GeoConstants;
    32.8 +
    32.9  /**
   32.10   * @author Charalampos Nikolaou <charnik@di.uoa.gr>
   32.11   * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr> (extensions for the temporal case)
   32.12 @@ -41,7 +43,10 @@
   32.13  			// catch the spatial case and create a new literal
   32.14  			// constructing a new literal is the only way if we want to reuse the {@link #writeValue(Value)} method
   32.15  			GeneralDBPolyhedron dbpolyhedron = (GeneralDBPolyhedron) val;
   32.16 -			val = new LiteralImpl(dbpolyhedron.getPolyhedronStringRep()+";http://www.opengis.net/def/crs/EPSG/0/"+dbpolyhedron.getPolyhedron().getGeometry().getSRID(), dbpolyhedron.getDatatype());
   32.17 +			if(String.valueOf(dbpolyhedron.getDatatype()) == GeoConstants.WKT)
   32.18 +				val = new LiteralImpl(dbpolyhedron.getPolyhedronStringRep()+";http://www.opengis.net/def/crs/EPSG/0/"+dbpolyhedron.getPolyhedron().getGeometry().getSRID(), dbpolyhedron.getDatatype());
   32.19 +			else
   32.20 +				val = new LiteralImpl("<http://www.opengis.net/def/crs/EPSG/0/"+dbpolyhedron.getPolyhedron().getGeometry().getSRID()+"> "+dbpolyhedron.getPolyhedronStringRep(),dbpolyhedron.getDatatype());
   32.21  		}
   32.22  		else if(val instanceof StrabonTemporalElement){
   32.23  			//creating a temporal literal, which is either a period or an instant
    33.1 --- a/runtime/pom.xml	Sun Dec 15 15:45:55 2013 +0200
    33.2 +++ b/runtime/pom.xml	Fri May 23 13:37:11 2014 +0300
    33.3 @@ -216,6 +216,12 @@
    33.4  		<dependency>
    33.5  			<groupId>info.aduna.commons</groupId>
    33.6  			<artifactId>aduna-commons-net-http-server-embedded</artifactId>
    33.7 +			<exclusions>
    33.8 +				<exclusion>
    33.9 +					<artifactId>jsp-2.1</artifactId>
   33.10 +					<groupId>org.mortbay.jetty</groupId>
   33.11 +				</exclusion>
   33.12 +			</exclusions>
   33.13  		</dependency>
   33.14  
   33.15  		<!-- Apache Commons -->
    34.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Sun Dec 15 15:45:55 2013 +0200
    34.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Fri May 23 13:37:11 2014 +0300
    34.3 @@ -95,7 +95,11 @@
    34.4  			
    34.5  		}
    34.6  
    34.7 +		long start = System.currentTimeMillis();
    34.8  		initiate(databaseName, user, password, port, serverName);
    34.9 +		long end = System.currentTimeMillis();
   34.10 +		
   34.11 +		logger.info("[Strabon] Initialization took {} ms.", (end - start));
   34.12  	}
   34.13  
   34.14  
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDegreesTest.rq	Fri May 23 13:37:11 2014 +0300
    35.3 @@ -0,0 +1,6 @@
    35.4 +select (geof:buffer(?g, 1, ogc:degree) as ?buffer)
    35.5 +where
    35.6 +{
    35.7 +	?x geo:hasGeometry ?geom .
    35.8 +	?geom geo:asWKT ?g.
    35.9 +}
   35.10 \ No newline at end of file
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDegreesTest.srx	Fri May 23 13:37:11 2014 +0300
    36.3 @@ -0,0 +1,48 @@
    36.4 +<?xml version='1.0' encoding='UTF-8'?>
    36.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
    36.6 +	<head>
    36.7 +		<variable name='buffer'/>
    36.8 +	</head>
    36.9 +	<results>
   36.10 +		<result>
   36.11 +			<binding name='buffer'>
   36.12 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((-111319.49079327231 -0.0000000007081155, -111319.49079327231 0.9999999994774795, -109180.5179920264 21718.39727593167, -102845.79911348295 42601.44158500647, -92558.77385160125 61847.7646607793, -78714.76681815831 78717.76512783514, -61845.79543964266 92563.02285962063, -42600.12482590362 102851.2563084728, -21717.355305532114 109186.85060744215, 0 111326.14301871415, 0.9999999999775806 111326.14301871415, 21718.35530553209 109186.85060744215, 42601.1248259036 102851.2563084728, 61846.795439642636 92563.02285962063, 78715.7668181583 78717.76512783514, 92559.77385160122 61847.7646607793, 102846.79911348294 42601.44158500647, 109181.51799202638 21718.39727593167, 111320.49079327229 0.9999999994774795, 111320.49079327229 -0.0000000007081155, 109181.51799202638 -21717.39727013562, 102846.79911348294 -42600.44156270125, 92559.77385160122 -61846.76461376663, 78715.7668181583 -78716.76505167512, 61846.795439642636 -92562.02275431334, 42601.1248259036 -102850.2561784551, 21718.35530553209 -109185.85046091139, 0.9999999999775806 -111325.14286638597, 0 -111325.14286638597, -21717.355305532114 -109185.85046091139, -42600.12482590362 -102850.2561784551, -61845.79543964266 -92562.02275431334, -78714.76681815831 -78716.76505167512, -92558.77385159841 -61846.76461376663, -102845.79911348295 -42600.441562702676, -109180.5179920264 -21717.39727013704, -111319.49079327231 -0.0000000007081155))</literal>
   36.13 +			</binding>
   36.14 +		</result>
   36.15 +		<result>
   36.16 +			<binding name='buffer'>
   36.17 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((-111319.49079327231 -0.0000000007081155, -111319.49079327231 1.9999999993709712, -109180.5179920264 21719.39728173002, -102845.79911348295 42602.44160731312, -92558.77385160125 61848.7647077953, -78714.76681815831 78718.76520399722, -61845.79543964266 92564.02296492962, -42600.12482590362 102852.25643849418, -21717.355305532114 109187.85075397529, 0 111327.14317104667, 1.9999999999551612 111327.14317104667, 21719.35530553207 109187.85075397529, 42602.12482590358 102852.25643849418, 61847.795439642614 92564.02296492962, 78716.76681815827 78718.76520399722, 92560.7738516012 61848.7647077953, 102847.7991134829 42602.44160731312, 109182.51799202636 21719.39728173002, 111321.49079327227 1.9999999993709712, 111321.49079327227 -0.0000000007081155, 109182.51799202636 -21717.39727013562, 102847.7991134829 -42600.44156270125, 92560.7738516012 -61846.76461376663, 78716.76681815827 -78716.76505167512, 61847.795439642614 -92562.02275431334, 42602.12482590358 -102850.2561784551, 21719.35530553207 -109185.85046091139, 1.9999999999551612 -111325.14286638597, 0 -111325.14286638597, -21717.355305532114 -109185.85046091139, -42600.12482590362 -102850.2561784551, -61845.79543964266 -92562.02275431334, -78714.76681815831 -78716.76505167512, -92558.77385159841 -61846.76461376663, -102845.79911348295 -42600.441562702676, -109180.5179920264 -21717.39727013704, -111319.49079327231 -0.0000000007081155))</literal>
   36.18 +			</binding>
   36.19 +		</result>
   36.20 +		<result>
   36.21 +			<binding name='buffer'>
   36.22 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((-111318.49079327233 0.9999999994774795, -111318.49079327233 1.9999999993709712, -109179.51799202642 21719.39728173002, -102844.79911348298 42602.44160731312, -92557.77385160128 61848.7647077953, -78713.76681815834 78718.76520399722, -61844.79543964268 92564.02296492962, -42599.124825903644 102852.25643849418, -21716.35530553214 109187.85075397529, 0.9999999999775806 111327.14317104667, 2.999999999932742 111327.14317104667, 21720.355305532048 109187.85075397529, 42603.12482590356 102852.25643849418, 61848.79543964259 92564.02296492962, 78717.76681815826 78718.76520399722, 92561.77385160117 61848.7647077953, 102848.79911348289 42602.44160731312, 109183.51799202633 21719.39728173002, 111322.49079327224 1.9999999993709712, 111322.49079327224 0.9999999994774795, 109183.51799202633 -21716.397264339004, 102848.79911348289 -42599.44154039624, 92561.77385160117 -61845.76456675433, 78717.76681815826 -78715.76497551735, 61848.79543964259 -92561.02264900785, 42603.12482590356 -102849.25604843823, 21720.355305532048 -109184.85031438306, 2.999999999932742 -111324.14271405865, 0.9999999999775806 -111324.14271405865, -21716.35530553214 -109184.85031438306, -42599.124825903644 -102849.25604843823, -61844.79543964268 -92561.02264900785, -78713.76681815834 -78715.76497551735, -92557.77385159844 -61845.76456675433, -102844.79911348298 -42599.44154039766, -109179.51799202642 -21716.397264339717, -111318.49079327233 0.9999999994774795))</literal>
   36.23 +			</binding>
   36.24 +		</result>
   36.25 +		<result>
   36.26 +			<binding name='buffer'>
   36.27 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((-111316.49079327237 0.9999999994774795, -111316.49079327237 1.9999999993709712, -109177.51799202646 21719.39728173002, -102842.79911348302 42602.44160731312, -92555.77385160132 61848.7647077953, -78711.76681815839 78718.76520399722, -61842.79543964272 92564.02296492962, -42597.12482590369 102852.25643849418, -21714.355305532183 109187.85075397529, 2.999999999932742 111327.14317104667, 3.9999999999103224 111327.14317104667, 21721.355305532026 109187.85075397529, 42604.124825903535 102852.25643849418, 61849.79543964257 92564.02296492962, 78718.76681815823 78718.76520399722, 92562.77385160116 61848.7647077953, 102849.79911348286 42602.44160731312, 109184.5179920263 21719.39728173002, 111323.49079327221 1.9999999993709712, 111323.49079327221 0.9999999994774795, 109184.5179920263 -21716.397264339004, 102849.79911348286 -42599.44154039624, 92562.77385160116 -61845.76456675433, 78718.76681815823 -78715.76497551735, 61849.79543964257 -92561.02264900785, 42604.124825903535 -102849.25604843823, 21721.355305532026 -109184.85031438306, 3.9999999999103224 -111324.14271405865, 2.999999999932742 -111324.14271405865, -21714.355305532183 -109184.85031438306, -42597.12482590369 -102849.25604843823, -61842.79543964272 -92561.02264900785, -78711.76681815555 -78715.76497551735, -92555.77385159848 -61845.76456675433, -102842.79911348302 -42599.44154039766, -109177.51799202646 -21716.397264339717, -111316.49079327237 0.9999999994774795))</literal>
   36.28 +			</binding>
   36.29 +		</result>
   36.30 +		<result>
   36.31 +			<binding name='buffer'>
   36.32 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((-111316.49079327237 0.9999999994774795, -111316.49079327237 1.9999999993709712, -109177.51799202646 21719.39728173002, -102842.79911348302 42602.44160731312, -92555.77385160132 61848.7647077953, -78711.76681815839 78718.76520399722, -61842.79543964272 92564.02296492962, -42597.12482590369 102852.25643849418, -21714.355305532183 109187.85075397529, 2.999999999932742 111327.14317104667, 3.9999999999103224 111327.14317104667, 21721.355305532026 109187.85075397529, 42604.124825903535 102852.25643849418, 61849.79543964257 92564.02296492962, 78718.76681815823 78718.76520399722, 92562.77385160116 61848.7647077953, 102849.79911348286 42602.44160731312, 109184.5179920263 21719.39728173002, 111323.49079327221 1.9999999993709712, 111323.49079327221 0.9999999994774795, 109184.5179920263 -21716.397264339004, 102849.79911348286 -42599.44154039624, 92562.77385160116 -61845.76456675433, 78718.76681815823 -78715.76497551735, 61849.79543964257 -92561.02264900785, 42604.124825903535 -102849.25604843823, 21721.355305532026 -109184.85031438306, 3.9999999999103224 -111324.14271405865, 2.999999999932742 -111324.14271405865, -21714.355305532183 -109184.85031438306, -42597.12482590369 -102849.25604843823, -61842.79543964272 -92561.02264900785, -78711.76681815555 -78715.76497551735, -92555.77385159848 -61845.76456675433, -102842.79911348302 -42599.44154039766, -109177.51799202646 -21716.397264339717, -111316.49079327237 0.9999999994774795))</literal>
   36.33 +			</binding>
   36.34 +		</result>
   36.35 +		<result>
   36.36 +			<binding name='buffer'>
   36.37 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((99571.1794533233 49784.095233765314, 107370.32057019752 29402.523047645867, 111043.43419928358 7891.331633639709, 110449.36464372445 -13923.030097627636, 105610.94166338131 -35202.492608737426, 96714.1031399717 -55129.489996122364, 84100.74958854054 -72938.31391010896, 68255.60511242234 -87944.51401695433, 49787.58972777618 -99571.22368602054, 29406.41890885074 -107371.3915985718, 7895.329620324772 -111045.04371917108, -13919.019040003313 -110450.88460588455, -35198.313886741154 -105611.76745125338, -55124.80355249933 -96713.80910711788, -72932.72421432048 -84099.18637554247, -87937.7274679757 -68252.90771551307, -99563.17945332348 -49784.095233765554, -99564.17945332346 -49782.095172843314, -107363.32057019768 -29400.523026397652, -111036.43419928374 -7889.331632109998, -110442.36464372459 13925.030102392711, -105603.94166338147 35204.49263920068, -96707.10313997185 55131.49007083525, -84093.74958854068 72940.31404088806, -68248.6051124225 87946.51420708228, -49780.589727776336 99573.22392974293, -29399.4189088509 107373.39188197645, -7888.329620324928 111047.04402230024, 13926.019040003157 110452.88490577831, 35205.313886741 105613.76772544422, 55131.80355249917 96715.80933705314, 72939.72421432033 84101.18654940644, 87944.72746797555 68254.90783002945, 99570.17945332333 49786.095294692954, 99571.1794533233 49784.095233765314))</literal>
   36.38 +			</binding>
   36.39 +		</result>
   36.40 +		<result>
   36.41 +			<binding name='buffer'>
   36.42 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((111320.49079327229 0.9999999994774795, 109181.51799202638 -21716.397264339004, 102846.79911348294 -42599.44154039624, 92559.77385160122 -61845.76456675433, 78715.7668181583 -78715.76497551735, 61846.795439642636 -92561.02264900785, 42601.1248259036 -102849.25604843823, 21718.35530553209 -109184.85031438306, 0.9999999999775806 -111324.14271405865, -21716.35530553214 -109184.85031438306, -42599.124825903644 -102849.25604843823, -61844.79543964268 -92561.02264900785, -78713.76681815834 -78715.76497551735, -92557.77385159844 -61845.76456675433, -102844.79911348298 -42599.44154039624, -109179.51799202642 -21716.397264339717, -111318.49079327233 0.9999999994774795, -109179.51799202642 21718.39727593167, -102844.79911348298 42601.44158500647, -92557.77385160128 61847.7646607793, -78713.76681815834 78717.76512783514, -61844.79543964268 92563.02285962063, -42599.124825903644 102851.2563084728, -21716.35530553214 109186.85060744215, 0.9999999999775806 111326.14301871415, 21718.35530553209 109186.85060744351, 42601.1248259036 102851.2563084728, 61846.795439642636 92563.02285962063, 78715.7668181583 78717.76512783514, 92559.7738515984 61847.7646607793, 102846.79911348294 42601.44158500647, 109181.51799202638 21718.397275933083, 111320.49079327229 0.9999999994774795))</literal>
   36.43 +			</binding>
   36.44 +		</result>
   36.45 +		<result>
   36.46 +			<binding name='buffer'>
   36.47 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((-111317.39079327292 1.0999999994410274, -111317.39079327292 1.9000000007720514, -109178.41799202701 21719.297281149902, -102843.69911348357 42602.34160508346, -92556.67385159903 61848.66470309359, -78712.6668181561 78718.66519638135, -61843.69543964327 92563.92295439992, -42598.024825904235 102852.1564254931, -21715.255305529896 109187.7507393229, 2.099999999386427 111327.04315581366, 2.900000000501476 111327.04315581366, 21720.255305529783 109187.7507393229, 42603.024825904125 102852.1564254931, 61848.69543964316 92563.92295439992, 78717.666818156 78718.66519638135, 92561.67385159891 61848.66470309359, 102848.69911348345 42602.34160508346, 109183.4179920269 21719.297281149902, 111322.39079327282 1.9000000007720514, 111322.39079327282 1.0999999994410274, 109183.4179920269 -21716.297263759512, 102848.69911348345 -42599.34153816638, 92561.67385159891 -61845.66456205315, 78717.666818156 -78715.66496790186, 61848.69543964316 -92560.92263847838, 42603.024825904125 -102849.15603543755, 21720.255305529783 -109184.750299731, 2.900000000501476 -111324.04269882677, 2.099999999386427 -111324.04269882677, -21715.255305529896 -109184.750299731, -42598.024825904235 -102849.15603543755, -61843.69543964327 -92560.92263847838, -78712.6668181561 -78715.66496790186, -92556.67385159903 -61845.66456205315, -102843.69911348357 -42599.3415381678, -109178.41799202419 -21716.29726376093, -111317.39079327292 1.0999999994410274))</literal>
   36.48 +			</binding>
   36.49 +		</result>
   36.50 +	</results>
   36.51 +</sparql>
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDistanceTest.rq	Fri May 23 13:37:11 2014 +0300
    37.3 @@ -0,0 +1,9 @@
    37.4 +select (geof:buffer(?g1, geof:distance(?g1, ?g2, ogc:degree), ogc:degree) as ?buffer)
    37.5 +where
    37.6 +{
    37.7 +	ex:A geo:hasGeometry ?geom1 .
    37.8 +	?geom1 geo:asWKT ?g1.
    37.9 +	
   37.10 +	ex:G geo:hasGeometry ?geom2 .
   37.11 +	?geom2 geo:asWKT ?g2.
   37.12 +}
   37.13 \ No newline at end of file
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDistanceTest.srx	Fri May 23 13:37:11 2014 +0300
    38.3 @@ -0,0 +1,15 @@
    38.4 +<?xml version='1.0' encoding='UTF-8'?>
    38.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
    38.6 +	<head>
    38.7 +		<variable name='buffer'/>
    38.8 +	</head>
    38.9 +	<results>
   38.10 +		<result>
   38.11 +			<binding name='buffer'>
   38.12 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((0 -0.0000000007081155, 0 0.9999999994774795, 0.9999999999775806 0.9999999994774795, 0.9999999999775806 -0.0000000007081155, 0 -0.0000000007081155))</literal>
   38.13 +			</binding>
   38.14 +		</result>
   38.15 +	</results>
   38.16 +</sparql>
   38.17 +
   38.18 +
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferMetresTest.rq	Fri May 23 13:37:11 2014 +0300
    39.3 @@ -0,0 +1,6 @@
    39.4 +select (geof:buffer(?g, 1, ogc:metre) as ?buffer)
    39.5 +where
    39.6 +{
    39.7 +	?x geo:hasGeometry ?geom .
    39.8 +	?geom geo:asWKT ?g.
    39.9 +}
   39.10 \ No newline at end of file
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferMetresTest.srx	Fri May 23 13:37:11 2014 +0300
    40.3 @@ -0,0 +1,48 @@
    40.4 +<?xml version='1.0' encoding='UTF-8'?>
    40.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
    40.6 +	<head>
    40.7 +		<variable name='buffer'/>
    40.8 +	</head>
    40.9 +	<results>
   40.10 +		<result>
   40.11 +			<binding name='buffer'>
   40.12 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((-0.9990081738166161 0.0000000042486927, -0.9990081738166161 0.9999999952287875, -0.9798122883145344 1.1962126302901517, -0.9229623124999344 1.3848849246898498, -0.8306429666620074 1.5587663054501864, -0.7064020253620464 1.7111746129273868, -0.5550139995434042 1.836252877299558, -0.3822966468222901 1.9291944153368505, -0.1948873967788809 1.9864275306074628, 0.000011717894552 2.0057527898363583, 1.0000117178721326 2.005752798333741, 1.1949108325455655 1.9864275433535372, 1.3823200854214366 1.9291944294991554, 1.5550374438074743 1.836252894294324, 1.7064254724585783 1.7111746299221529, 1.830666419423463 1.5587663224449533, 1.9229857709263136 1.3848849388521558, 1.9798357467409136 1.1962126430362277, 1.9990316350754571 1.0000000037261716, 1.9990316350754571 -0.0000000049568082, 1.9798357467409136 -0.1962126435362148, 1.9229857709263136 -0.3848849393871292, 1.830666419423463 -0.5587663235673946, 1.7064254724585783 -0.7111746307609169, 1.5550374438074743 -0.8362528955212613, 1.3823200854214366 -0.929194429953204, 1.1949108325455655 -0.9864275444782631, 1.0000117178721326 -1.005752800027154, 0.000011717894552 -1.0057527915297673, -0.1948873967788809 -0.9864275317321829, -0.3822966468222901 -0.9291944157908929, -0.5550139995434042 -0.8362528785264882, -0.7064020253620464 -0.7111746137661441, -0.8306429666620074 -0.5587663065726222, -0.9229623124999344 -0.3848849252248193, -0.9798122883145344 -0.1962126307901362, -0.9990081738166161 0.0000000042486927))</literal>
   40.13 +			</binding>
   40.14 +		</result>
   40.15 +		<result>
   40.16 +			<binding name='buffer'>
   40.17 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((-0.9990081738166161 0.0000000084973855, -0.9990081738166161 1.9999999908735884, -0.9798122883145344 2.196212627744941, -0.9229623153323963 2.3848849223043818, -0.8306429666620074 2.5587663041272326, -0.7064020253620464 2.711174611784923, -0.5550139995434042 2.8362528777900806, -0.3822966468222901 2.9291944154177822, -0.1948873967788809 2.986427530212449, 0.000011717894552 3.005752790660113, 2.000011717849713 3.0057528076548756, 2.194910835355608 2.9864275500396724, 2.382320088231479 2.9291944380774666, 2.5550374466175167 2.836252901865995, 2.7064254781010826 2.7111746372770686, 2.830666425065967 2.5587663296193788, 2.922985776568818 2.384884944964068, 2.979835752383418 2.196212647572167, 2.999031643550423 2.000000007868354, 2.999031643550423 -0.0000000092055009, 2.979835752383418 -0.1962126477849076, 2.922985776568818 -0.3848849450520532, 2.830666425065967 -0.5587663306485497, 2.7064254781010826 -0.7111746378420722, 2.5550374466175167 -0.8362529026024169, 2.382320088231479 -0.9291944384505907, 2.194910835355608 -0.9864275515594186, 2.000011717849713 -1.0057528085245409, 0.000011717894552 -1.0057527915297673, -0.1948873967788809 -0.9864275317321829, -0.3822966468222901 -0.9291944157908929, -0.5550139995434042 -0.8362528785264882, -0.7064020253620464 -0.7111746123499131, -0.8306429666620074 -0.5587663051563913, -0.9229623153323963 -0.3848849223923573, -0.9798122883145344 -0.1962126279576742, -0.9990081738166161 0.0000000084973855))</literal>
   40.18 +			</binding>
   40.19 +		</result>
   40.20 +		<result>
   40.21 +			<binding name='buffer'>
   40.22 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((0.000991817663579 1.0000000037261716, 0.000991817663579 1.9999999951222798, 0.0201877059981226 2.196212631993632, 0.0770376789802607 2.3848849279693036, 0.1693570276506495 2.5587663112083843, 0.2935979689506105 2.7111746188660746, 0.4449859976017145 2.836252884871232, 0.6177033503228286 2.9291944224989335, 0.8051126031986997 2.9864275387098305, 1.0000117178721326 3.005752799157494, 3.000011717827294 3.0057528161522575, 3.1949108353331885 2.986427558537054, 3.3823200910415214 2.929194445158618, 3.555037452260021 2.8362529089471464, 3.706425483743587 2.7111746429419896, 3.8306664307084715 2.5587663324518393, 3.922985785043784 2.3848849463802986, 3.9798357636908457 2.1962126461559364, 3.9990316520253892 2.0000000036196623, 3.9990316520253892 0.9999999952287875, 3.9798357636908457 0.8037873527150411, 3.922985785043784 0.6151150538719149, 3.8306664307084715 0.4412336672128966, 3.706425483743587 0.2888253562982981, 3.555037452260021 0.1637470899049591, 3.3823200910415214 0.070805554466369, 3.1949108353331885 0.0135724404172515, 3.000011717827294 -0.0057528170585263, 1.0000117178721326 -0.0057528000637554, 0.8051126031986997 0.0135724602444842, 0.6177033503228286 0.0708055771260633, 0.4449859976017145 0.1637471139808839, 0.2935979689506105 0.2888253803742225, 0.1693570276506495 0.4412336884563588, 0.0770376789802607 0.615115072282915, 0.0201877059981226 0.8037873668773485, 0.000991817663579 1.0000000037261716))</literal>
   40.23 +			</binding>
   40.24 +		</result>
   40.25 +		<result>
   40.26 +			<binding name='buffer'>
   40.27 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((2.0009918006239693 1.0000000037261716, 2.0009918006239693 1.9999999951222798, 2.020187688958513 2.1962126362423238, 2.077037661940651 2.384884933634225, 2.1693570134435016 2.5587663197057666, 2.2935979575759244 2.7111746316121472, 2.4449859862270285 2.8362528990335347, 2.617703344613066 2.9291944380774666, 2.805112600321399 2.9864275557045934, 3.000011717827294 3.0057528161522575, 4.000011717804874 3.005752824649639, 4.194910838143231 2.9864275670344353, 4.382320093851564 2.929194452239769, 4.555037455070064 2.836252916028298, 4.706425489386091 2.7111746486069106, 4.830666439183437 2.5587663367005304, 4.92298579351875 2.384884949212759, 4.97983576933335 2.196212647572167, 4.999031660500355 2.0000000036196623, 4.999031660500355 0.9999999952287875, 4.97983576933335 0.8037873512988103, 4.92298579351875 0.6151150510394534, 4.830666439183437 0.4412336629642042, 4.706425489386091 0.2888253506333747, 4.555037455070064 0.1637470828238047, 4.382320093851564 0.0708055473852146, 4.194910838143231 0.0135724319198661, 4.000011717804874 -0.0057528255559118, 3.000011717827294 -0.0057528170585263, 2.8051125974889373 0.0135724432497134, 2.617703344613066 0.0708055615475235, 2.4449859862270285 0.1637470998185752, 2.2935979575759244 0.2888253676281449, 2.1693570134435016 0.441233679958974, 2.077037661940651 0.615115066617992, 2.020187688958513 0.8037873626286562, 2.0009918006239693 1.0000000037261716))</literal>
   40.28 +			</binding>
   40.29 +		</result>
   40.30 +		<result>
   40.31 +			<binding name='buffer'>
   40.32 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((2.0009918006239693 1.0000000037261716, 2.0009918006239693 1.9999999951222798, 2.020187688958513 2.1962126362423238, 2.077037661940651 2.384884933634225, 2.1693570134435016 2.5587663197057666, 2.2935979575759244 2.7111746316121472, 2.4449859862270285 2.8362528990335347, 2.617703344613066 2.9291944380774666, 2.805112600321399 2.9864275557045934, 3.000011717827294 3.0057528161522575, 4.000011717804874 3.005752824649639, 4.194910838143231 2.9864275670344353, 4.382320093851564 2.929194452239769, 4.555037455070064 2.836252916028298, 4.706425489386091 2.7111746486069106, 4.830666439183437 2.5587663367005304, 4.92298579351875 2.384884949212759, 4.97983576933335 2.196212647572167, 4.999031660500355 2.0000000036196623, 4.999031660500355 0.9999999952287875, 4.97983576933335 0.8037873512988103, 4.92298579351875 0.6151150510394534, 4.830666439183437 0.4412336629642042, 4.706425489386091 0.2888253506333747, 4.555037455070064 0.1637470828238047, 4.382320093851564 0.0708055473852146, 4.194910838143231 0.0135724319198661, 4.000011717804874 -0.0057528255559118, 3.000011717827294 -0.0057528170585263, 2.8051125974889373 0.0135724432497134, 2.617703344613066 0.0708055615475235, 2.4449859862270285 0.1637470998185752, 2.2935979575759244 0.2888253676281449, 2.1693570134435016 0.441233679958974, 2.077037661940651 0.615115066617992, 2.020187688958513 0.8037873626286562, 2.0009918006239693 1.0000000037261716))</literal>
   40.33 +			</binding>
   40.34 +		</result>
   40.35 +		<result>
   40.36 +			<binding name='buffer'>
   40.37 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((4.892356290662825 0.4522064960767662, 4.962840667011444 0.2682564216646194, 4.996324064926611 0.0739974018390475, 4.991519739490134 -0.1231052973699739, 4.9486123133959445 -0.3154771269815041, 4.86925070146047 -0.495725347890648, 4.756484720127086 -0.6569231212775386, 4.614647908520599 -0.7928757071754876, 4.4491909711948034 -0.8983585240191035, 4.266472326078234 -0.9693179273504574, 4.07351375365782 -1.003026984213504, 3.8777305370113853 -0.9981902766065905, 3.6866465189809543 -0.9549936778710609, 3.5076049503077904 -0.8750972077887265, 3.347486297126129 -0.7615712411396766, 3.2124438306522203 -0.6187785219475874, 3.107667156276771 -0.4522064898997295, 2.1076671704614993 1.5477934983172499, 2.037182796945342 1.7317435698161605, 2.0036993961977134 1.9260025830548837, 2.0085037188017285 2.123105276297947, 2.051411139230994 2.3154771024624923, 2.1307727455015453 2.4957253211107155, 2.2435387183375437 2.6569230941281, 2.3853755271115693 2.7928756815524096, 2.550832458772441 2.8983585024963183, 2.733551095391625 2.9693179095337885, 2.9265096678120393 3.0030269723109986, 3.122292881626012 2.998190271278887, 3.313376899656443 2.9549936794894767, 3.4924184711620687 2.8750972134820656, 3.652537127176192 2.7615712534974763, 3.7875795993150243 2.6187785363401255, 3.8923562765229356 2.4522065080179463, 4.892356290662825 0.4522064960767662))</literal>
   40.38 +			</binding>
   40.39 +		</result>
   40.40 +		<result>
   40.41 +			<binding name='buffer'>
   40.42 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((1.9990316350754571 1.0000000079748637, 1.9798357495733754 0.8037873682935792, 1.9229857737587754 0.6151150708666843, 1.8306664250883866 0.4412336856238972, 1.7064254809559638 0.2888253761255299, 1.5550374523048598 0.1637471097321913, 1.382320093918822 0.0708055728773707, 1.194910841042951 0.0135724588282533, 1.000011726369518 -0.0057528000637554, 0.8051126116960852 0.0135724588282533, 0.6177033588202141 0.0708055728773707, 0.4449860032666382 0.1637471083159604, 0.293597977447996 0.2888253718768374, 0.1693570333155732 0.441233679958974, 0.0770376818127225 0.6151150623692996, 0.0201877059981226 0.8037873541312718, 0.000991817663579 0.9999999909800954, 0.0201877031656608 1.1962126274576905, 0.0770376761477989 1.3848849232736193, 0.1693570248181877 1.5587663054501864, 0.2935979661181487 1.711174614343617, 0.4449859919367909 1.8362528815482495, 0.617703344657905 1.929194419585542, 0.8051125947013142 1.9864275376886154, 1.0000117093747471 2.005752798333741, 1.1949108268806419 1.9864275447697675, 1.382320079756513 1.9291944323316164, 1.5550374381425507 1.8362528985430158, 1.7064254696261165 1.7111746341708447, 1.8306664165910012 1.5587663266936451, 1.9229857680938518 1.3848849445170783, 1.9798357467409136 1.1962126472849197, 1.9990316350754571 1.0000000079748637))</literal>
   40.43 +			</binding>
   40.44 +		</result>
   40.45 +		<result>
   40.46 +			<binding name='buffer'>
   40.47 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/3857&gt; POLYGON ((1.1009918085750399 1.1000000022734888, 1.1009918085750399 1.8999999979395905, 1.1201876940771216 2.0962126350548136, 1.1770376698917215 2.284884932572364, 1.2693570185621104 2.458766317121424, 1.3935979626945332 2.6111746257524264, 1.5449859913456372 2.7362528937186306, 1.7177033468992131 2.8291944313872914, 1.9051125997750842 2.886427549911751, 2.100011717280979 2.9057528092461773, 2.900011718396028 2.9057528149110983, 3.094910835901923 2.8864275598253633, 3.2823200916102557 2.829194444133364, 3.4550374499962935 2.7362529078809334, 3.606425484312321 2.61117464133096, 3.7306664312772058 2.4587663312837273, 3.8229857856125182 2.2848849453184377, 3.879835761427118 2.096212644968426, 3.8990316497616617 1.9000000036045124, 3.8990316497616617 1.099999996608566, 3.879835761427118 0.90378735433869, 3.8229857856125182 0.7151150542049814, 3.7306664312772058 0.5412336674397112, 3.606425484312321 0.3888253574984246, 3.4550374499962935 0.2637470916499018, 3.2823200916102557 0.1708055548360394, 3.094910835901923 0.113572438851793, 2.900011718396028 0.0942471838033537, 2.100011717280979 0.0942471894682772, 1.9051125997750842 0.1135724487654092, 1.7177033468992131 0.1708055675821173, 1.5449859913456372 0.2637471058122103, 1.3935979626945332 0.3888253730769637, 1.2693570185621104 0.5412336816020191, 1.1770376698917215 0.7151150669510582, 1.1201876969095834 0.903787364252305, 1.1009918085750399 1.1000000022734888))</literal>
   40.48 +			</binding>
   40.49 +		</result>
   40.50 +	</results>
   40.51 +</sparql>
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferWithConstantTest.rq	Fri May 23 13:37:11 2014 +0300
    41.3 @@ -0,0 +1,6 @@
    41.4 +select (geof:buffer("<http://www.opengis.net/def/crs/EPSG/0/2100> POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))"^^<http://strdf.di.uoa.gr/ontology#WktLiteral>, 1, ogc:degree) as ?buffer)
    41.5 +where
    41.6 +{
    41.7 +	ex:A geo:hasGeometry ?geom .
    41.8 +	?geom geo:asWKT ?g.
    41.9 +}
   41.10 \ No newline at end of file
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferWithConstantTest.srx	Fri May 23 13:37:11 2014 +0300
    42.3 @@ -0,0 +1,13 @@
    42.4 +<?xml version='1.0' encoding='UTF-8'?>
    42.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
    42.6 +	<head>
    42.7 +		<variable name='buffer'/>
    42.8 +	</head>
    42.9 +	<results>
   42.10 +		<result>
   42.11 +			<binding name='buffer'>
   42.12 +				<literal datatype='http://www.opengis.net/ont/geosparql#wktLiteral'>&lt;http://www.opengis.net/def/crs/EPSG/0/4326&gt; POLYGON ((18.51248908676886 0.0022304072306898, 18.512489086768802 0.0022394268391313, 18.531703805007 0.1973297483274672, 18.5886095513394 0.3849228584614706, 18.681019469862246 0.5578096592705463, 18.80538229925464 0.7093462080002653, 18.956918845758608 0.8337090401047385, 19.129805644913805 0.9261189617217735, 19.317398754029355 0.983024711411565, 19.512489075173807 1.0022394331413353, 19.51249803440009 1.0022394331414393, 19.7075883572879 0.9830247156776696, 19.89518146887027 0.9261189695835728, 20.0680682710241 0.833709050783125, 20.219604820854016 0.7093462206556026, 20.343967653693618 0.5578096730514313, 20.436377575588256 0.3849228725514822, 20.493283325039744 0.1973297619875636, 20.512498045995084 0.002239439443644, 20.51249804599514 0.0022304198350916, 20.493283327453618 -0.1928599031781553, 20.436377580234563 -0.3804530146601173, 20.34396766031032 -0.5533398164745945, 20.21960482911171 -0.7048763657236403, 20.06806828054155 -0.8292391977494786, 19.895181479231532 -0.9216491186174952, 19.707588368060215 -0.9785548668606079, 19.512498045151858 -0.9977695864671131, 19.512489085925576 -0.9977695864671056, 19.317398764801673 -0.9785548668800716, 19.12980565527507 -0.9216491193392968, 18.956918855276065 -0.8292391997898305, 18.805382307512332 -0.7048763695836736, 18.681019476478948 -0.5533398224988286, 18.588609555985705 -0.3804530230042807, 18.531703807420875 -0.1928599137883199, 18.51248908676886 0.0022304072306898))</literal>
   42.13 +			</binding>
   42.14 +		</result>
   42.15 +	</results>
   42.16 +</sparql>
    43.1 --- a/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/AggregateFunctionsTest.nt	Sun Dec 15 15:45:55 2013 +0200
    43.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/AggregateFunctionsTest.nt	Fri May 23 13:37:11 2014 +0300
    43.3 @@ -1,2 +1,4 @@
    43.4  <http://example.org#A> <http://example.org#hasGeometry> "Polygon((0 0, 1 0, 1 1, 0 1, 0 0))"^^<http://strdf.di.uoa.gr/ontology#WKT>.
    43.5 -<http://example.org#B> <http://example.org#hasGeometry> "Polygon((0 0, 2 0, 2 2, 0 2 , 0 0))"^^<http://strdf.di.uoa.gr/ontology#WKT>.
    43.6 \ No newline at end of file
    43.7 +<http://example.org#B> <http://example.org#hasGeometry> "Polygon((0 0, 2 0, 2 2, 0 2 , 0 0))"^^<http://strdf.di.uoa.gr/ontology#WKT>.
    43.8 +<http://example.org#ExA> <http://example.org#consistsOf> <http://example.org#A> .
    43.9 +<http://example.org#ExA> <http://example.org#consistsOf> <http://example.org#B> .
   43.10 \ No newline at end of file
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/ExtentGroupByTest.rq	Fri May 23 13:37:11 2014 +0300
    44.3 @@ -0,0 +1,7 @@
    44.4 +select (strdf:extent(?g) as ?extent)
    44.5 +where
    44.6 +{
    44.7 +	?x ex:consistsOf ?y .
    44.8 +	?y ex:hasGeometry ?g .
    44.9 +}
   44.10 +group by ?x
   44.11 \ No newline at end of file
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/ExtentGroupByTest.srx	Fri May 23 13:37:11 2014 +0300
    45.3 @@ -0,0 +1,13 @@
    45.4 +<?xml version='1.0' encoding='UTF-8'?>
    45.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
    45.6 +	<head>
    45.7 +		<variable name='extent'/>
    45.8 +	</head>
    45.9 +	<results>
   45.10 +		<result>
   45.11 +			<binding name='extent'>
   45.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>POLYGON ((0 0, 0 2, 2 2, 2 0, 0 0));http://www.opengis.net/def/crs/EPSG/0/4326</literal>
   45.13 +			</binding>
   45.14 +		</result>
   45.15 +	</results>
   45.16 +</sparql>
   45.17 \ No newline at end of file
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionGroupByTest.rq	Fri May 23 13:37:11 2014 +0300
    46.3 @@ -0,0 +1,7 @@
    46.4 +select (strdf:intersection(?g) as ?intersection)
    46.5 +where
    46.6 +{
    46.7 +	?x ex:consistsOf ?y .
    46.8 +	?y ex:hasGeometry ?g .
    46.9 +}
   46.10 +group by ?x
   46.11 \ No newline at end of file
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionGroupByTest.srx	Fri May 23 13:37:11 2014 +0300
    47.3 @@ -0,0 +1,13 @@
    47.4 +<?xml version='1.0' encoding='UTF-8'?>
    47.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
    47.6 +	<head>
    47.7 +		<variable name='intersection'/>
    47.8 +	</head>
    47.9 +	<results>
   47.10 +		<result>
   47.11 +			<binding name='intersection'>
   47.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>POLYGON ((1 0, 0 0, 0 1, 1 1, 1 0));http://www.opengis.net/def/crs/EPSG/0/4326</literal>
   47.13 +			</binding>
   47.14 +		</result>
   47.15 +	</results>
   47.16 +</sparql>
   47.17 \ No newline at end of file
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionTest.rq	Fri May 23 13:37:11 2014 +0300
    48.3 @@ -0,0 +1,5 @@
    48.4 +select (strdf:intersection(?g) as ?intersection)
    48.5 +where
    48.6 +{
    48.7 +	?x ex:hasGeometry ?g.
    48.8 +}
    48.9 \ No newline at end of file
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionTest.srx	Fri May 23 13:37:11 2014 +0300
    49.3 @@ -0,0 +1,13 @@
    49.4 +<?xml version='1.0' encoding='UTF-8'?>
    49.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
    49.6 +	<head>
    49.7 +		<variable name='intersection'/>
    49.8 +	</head>
    49.9 +	<results>
   49.10 +		<result>
   49.11 +			<binding name='intersection'>
   49.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>POLYGON ((1 0, 0 0, 0 1, 1 1, 1 0));http://www.opengis.net/def/crs/EPSG/0/4326</literal>
   49.13 +			</binding>
   49.14 +		</result>
   49.15 +	</results>
   49.16 +</sparql>
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/UnionGroupByTest.rq	Fri May 23 13:37:11 2014 +0300
    50.3 @@ -0,0 +1,7 @@
    50.4 +select (strdf:union(?g) as ?union)
    50.5 +where
    50.6 +{
    50.7 +	?x ex:consistsOf ?y .
    50.8 +	?y ex:hasGeometry ?g .
    50.9 +}
   50.10 +group by ?x
   50.11 \ No newline at end of file
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/UnionGroupByTest.srx	Fri May 23 13:37:11 2014 +0300
    51.3 @@ -0,0 +1,13 @@
    51.4 +<?xml version='1.0' encoding='UTF-8'?>
    51.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
    51.6 +	<head>
    51.7 +		<variable name='union'/>
    51.8 +	</head>
    51.9 +	<results>
   51.10 +		<result>
   51.11 +			<binding name='union'>
   51.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>POLYGON ((1 0, 0 0, 0 1, 0 2, 2 2, 2 0, 1 0));http://www.opengis.net/def/crs/EPSG/0/4326</literal>
   51.13 +			</binding>
   51.14 +		</result>
   51.15 +	</results>
   51.16 +</sparql>
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BoundaryWithConstantTest.rq	Fri May 23 13:37:11 2014 +0300
    52.3 @@ -0,0 +1,5 @@
    52.4 +select (strdf:boundary("POLYGON((0 0, 1 0, 1 1, 0 1, 0 0));http://www.opengis.net/def/crs/EPSG/0/2100"^^<http://strdf.di.uoa.gr/ontology#WKT>) as ?boundary)
    52.5 +where
    52.6 +{
    52.7 +ex:A ex:hasGeometry ?g.
    52.8 +}
    52.9 \ No newline at end of file
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BoundaryWithConstantTest.srx	Fri May 23 13:37:11 2014 +0300
    53.3 @@ -0,0 +1,13 @@
    53.4 +<?xml version='1.0' encoding='UTF-8'?>
    53.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
    53.6 +	<head>
    53.7 +		<variable name='boundary'/>
    53.8 +	</head>
    53.9 +	<results>
   53.10 +		<result>
   53.11 +			<binding name='boundary'>
   53.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>LINESTRING (0 0, 1 0, 1 1, 0 1, 0 0);http://www.opengis.net/def/crs/EPSG/0/2100</literal>
   53.13 +			</binding>
   53.14 +		</result>
   53.15 +	</results>
   53.16 +</sparql>
   53.17 \ No newline at end of file
    54.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.2 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BufferWithConstantTest.rq	Fri May 23 13:37:11 2014 +0300
    54.3 @@ -0,0 +1,5 @@
    54.4 +select (strdf:buffer("POLYGON((0 0, 1 0, 1 1, 0 1, 0 0));http://www.opengis.net/def/crs/EPSG/0/2100"^^<http://strdf.di.uoa.gr/ontology#WKT>, 1, ogc:degree) as ?buffer)
    54.5 +where
    54.6 +{
    54.7 +ex:A ex:hasGeometry ?g.
    54.8 +}
    54.9 \ No newline at end of file
    55.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.2 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BufferWithConstantTest.srx	Fri May 23 13:37:11 2014 +0300
    55.3 @@ -0,0 +1,13 @@
    55.4 +<?xml version='1.0' encoding='UTF-8'?>
    55.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
    55.6 +	<head>
    55.7 +		<variable name='buffer'/>
    55.8 +	</head>
    55.9 +	<results>
   55.10 +		<result>
   55.11 +			<binding name='buffer'>
   55.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>POLYGON ((18.51248908676886 0.0022304072306898, 18.512489086768802 0.0022394268391313, 18.531703805007 0.1973297483274672, 18.5886095513394 0.3849228584614706, 18.681019469862246 0.5578096592705463, 18.80538229925464 0.7093462080002653, 18.956918845758608 0.8337090401047385, 19.129805644913805 0.9261189617217735, 19.317398754029355 0.983024711411565, 19.512489075173807 1.0022394331413353, 19.51249803440009 1.0022394331414393, 19.7075883572879 0.9830247156776696, 19.89518146887027 0.9261189695835728, 20.0680682710241 0.833709050783125, 20.219604820854016 0.7093462206556026, 20.343967653693618 0.5578096730514313, 20.436377575588256 0.3849228725514822, 20.493283325039744 0.1973297619875636, 20.512498045995084 0.002239439443644, 20.51249804599514 0.0022304198350916, 20.493283327453618 -0.1928599031781553, 20.436377580234563 -0.3804530146601173, 20.34396766031032 -0.5533398164745945, 20.21960482911171 -0.7048763657236403, 20.06806828054155 -0.8292391977494786, 19.895181479231532 -0.9216491186174952, 19.707588368060215 -0.9785548668606079, 19.512498045151858 -0.9977695864671131, 19.512489085925576 -0.9977695864671056, 19.317398764801673 -0.9785548668800716, 19.12980565527507 -0.9216491193392968, 18.956918855276065 -0.8292391997898305, 18.805382307512332 -0.7048763695836736, 18.681019476478948 -0.5533398224988286, 18.588609555985705 -0.3804530230042807, 18.531703807420875 -0.1928599137883199, 18.51248908676886 0.0022304072306898));http://www.opengis.net/def/crs/EPSG/0/2100</literal>
   55.13 +			</binding>
   55.14 +		</result>
   55.15 +	</results>
   55.16 +</sparql>
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/UnionWithConstantTest.rq	Fri May 23 13:37:11 2014 +0300
    56.3 @@ -0,0 +1,5 @@
    56.4 +select (strdf:union("POLYGON((0 0, 1 0, 1 1, 0 1, 0 0));http://www.opengis.net/def/crs/EPSG/0/2100"^^<http://strdf.di.uoa.gr/ontology#WKT>, "POLYGON((1 0, 2 0, 2 1, 1 2, 1 0));http://www.opengis.net/def/crs/EPSG/0/2100"^^<http://strdf.di.uoa.gr/ontology#WKT>) as ?buffer)
    56.5 +where
    56.6 +{
    56.7 +ex:A ex:hasGeometry ?g.
    56.8 +}
    56.9 \ No newline at end of file
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/UnionWithConstantTest.srx	Fri May 23 13:37:11 2014 +0300
    57.3 @@ -0,0 +1,13 @@
    57.4 +<?xml version='1.0' encoding='UTF-8'?>
    57.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
    57.6 +	<head>
    57.7 +		<variable name='buffer'/>
    57.8 +	</head>
    57.9 +	<results>
   57.10 +		<result>
   57.11 +			<binding name='buffer'>
   57.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>POLYGON ((1 0, 0 0, 0 1, 1 1, 1 2, 2 1, 2 0, 1 0));http://www.opengis.net/def/crs/EPSG/0/2100</literal>
   57.13 +			</binding>
   57.14 +		</result>
   57.15 +	</results>
   57.16 +</sparql>
   57.17 \ No newline at end of file