# HG changeset patch # User Panayiotis Smeros # Date 1400841431 -10800 # Node ID 4dff2f1163d8bf3f2815a7eae66e422164dcccf7 # Parent 404eacc0f0be439157df46728eae523d8a2392ca# Parent e5abd174045f309bfad19d6a8f2b7252455b143c Merge with default branch. diff -r 404eacc0f0be -r 4dff2f1163d8 .hgtags --- a/.hgtags Sun Dec 15 15:45:55 2013 +0200 +++ b/.hgtags Fri May 23 13:37:11 2014 +0300 @@ -17,6 +17,7 @@ 97afadc6d589b318924ca774659418c055fdf3a0 v3.2.6 b3e0d7415823df2e814aa6fa45aa13374a81e706 v3.2.7 389213ce7843a9c490be447400c1a5c46d44cc96 v3.2.8 +92b90ac06d39f8fcf76de046f22bb64526d5ff28 v3.2.9 0ed49ee3eb94c6bfc122254342e86bfd097c1200 v3.2.9-temporals 0ed49ee3eb94c6bfc122254342e86bfd097c1200 v3.2.9-temporals 0000000000000000000000000000000000000000 v3.2.9-temporals diff -r 404eacc0f0be -r 4dff2f1163d8 ChangeLog --- a/ChangeLog Sun Dec 15 15:45:55 2013 +0200 +++ b/ChangeLog Fri May 23 13:37:11 2014 +0300 @@ -1,12 +1,40 @@ * Fixed a bug that occured when storing quads from endpoint. -Sun Oct 20 20:23:14 2013 Pyravlos Team + * Version 3.2.10 released. + + * Various changes in the interface and behavior of Strabon Endpoint: + - Revised the logos and the sample queries. + - Results query limit is set to zero (unlimited). + - Users can now store RDF data that is present in a file on the + client side (the file is uploaded to the server). + - Credentials are now required for uploading files or executing + UPDATE queries, unless Strabon Endpoint runs locally (localhost). + - When viewing the results of queries in HTML, any URI is now an + active link to itself. Previously, that URI was being DESCRIBEd + and one was being transferred to a page viewing the result of the + DESCRIBE query. + - The DESCRIBE functionality can now be accessed through the menu bar. + + * Fixed a bug where strdf:intersection function did not work as an + aggregate when used without 'GROUP BY'. + (bug #46 https://bug.strabon.di.uoa.gr/ticket/46) + +Sat Oct 19 23:37:23 2013 Pyravlos Team * Version 3.2.9 released. * Added support for the following google chart types: PieChart, AreaChart and ColumnChart to strabon endpoint. + * Added Timemap as new results format in Strabon endpoint. This + option displays results in a map and a timeline on the same time, + using the Timemap js library (http://code.google.com/p/timemap/). + The KMLWriter has been extended for that purpose, by transforming + dateTime values that are included in the result set into the respective + TimeStamp KML primitive (https://developers.google.com/kml/documentation/time). + In the "temporals" branch, the values of the strdf:period datatype + are converted into the respective KML TimeSpan primitive. + * Added extension function which is mapped to the ST_Centroid(geometry) extension function of PostGIS. See also: . @@ -46,6 +74,11 @@ geo:wktLiteral. (bug #33: http://bug.strabon.di.uoa.gr/ticket/33) + * Endpoint Client now supports querying of Virtuoso and Parliament endpoints. + + * Endpoint Client now supports store and update operations, but only + for Strabon Endpoints. + *Modified the NQUADSTranslator so that the rewritten triples are immediately flushed to the database once they are created. @@ -84,6 +117,29 @@ (https://portal.opengeospatial.org/files/?artifact_id=47664, pg. 53) have been implemented. + * Changed the definition and implementation of strdf:distance function, by + adopting the definition of GeoSPARQL. + (bug #23: http://bug.strabon.di.uoa.gr/ticket/23) + + * Changed the definition and implementation of strdf:buffer function, by + adopting the definition of GeoSPARQL. + (bug #35: http://bug.strabon.di.uoa.gr/ticket/35) + + * Added geof:distance and geof:buffer functions, which have the same definition + with strdf:distance and strdf:buffer respectively. + (bug #32: http://bug.strabon.di.uoa.gr/ticket/32) + + * Added a download button when performing describe and construct queries at the + endpoint. + (bug #38: http://bug.strabon.di.uoa.gr/ticket/38) + + * Fixed a bug, where XMLWriter and TSVWriter did not return geometries with the + SRID. + (bug #47: http://bug.strabon.di.uoa.gr/ticket/47) + + * Fixed a bug where the GeoSPARQL construct functions did not return the datatype + geo:wktLiteral datatype but strdf:WKT. + Tue Mar 26 13:28:26 2013 Pyravlos Team * Version 3.2.8 released. diff -r 404eacc0f0be -r 4dff2f1163d8 README --- a/README Sun Dec 15 15:45:55 2013 +0200 +++ b/README Fri May 23 13:37:11 2014 +0300 @@ -448,13 +448,13 @@ The system Strabon has been developed by the following members of our team: * Manos Karpathiotakis -* Kostis Kyzirakos +* Kostis Kyzirakos * Manolis Koubarakis * Giorgos Garbis * Konstantina Bereta * Charalampos Nikolaou * Stella Gianakopoulou -* Panagiotis Smeros +* Panayiotis Smeros * Kallirroi Dogani @@ -481,6 +481,31 @@ Known Issues ============ +* Strabon depends on a version of Sesame OpenRDF that is not hosted at the central + repository of Maven. These artifacts resided on the Maven repository of Aduna + which is not maintained any more. For this reason, you can use a mirror repository + hosted by Ontotext. To configure maven to use the Ontotext mirror for the Aduna + repository, you append to your settings file ${user.home}/.m2/settings.xml) the + following: + + +... +... + + + aduna-mirror + Aduna Maven Repository - Mirror + http://maven.ontotext.com/content/repositories/aduna/ + aduna-opensource.releases + + +... +... + + * By default, Tomcat uses ISO-8859-1 character encoding when decoding URLs received from a browser. This can cause problems when encoding is UTF-8, and you are using international characters. In order to fix this, edit conf/server.xml and find the diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint-client/pom.xml --- a/endpoint-client/pom.xml Sun Dec 15 15:45:55 2013 +0200 +++ b/endpoint-client/pom.xml Fri May 23 13:37:11 2014 +0300 @@ -137,7 +137,7 @@ org.apache.maven.plugins maven-shade-plugin - 2.0 + 2.2 - false + true @@ -65,9 +65,16 @@ - 1000 + 0 + + + true + + + + @@ -77,8 +84,9 @@ PREFIX geonames: PREFIX clc: PREFIX gag: -PREFIX noa: -PREFIX dlr: +PREFIX geo: +PREFIX geof: +PREFIX geor: PREFIX strdf: PREFIX rdf: PREFIX rdfs: @@ -97,236 +105,20 @@ Query - KML + HTML - [ΝΟΑ] Select all hotspots of 2012 before any refinement + Find all triples in the dataset. - -PREFIX rdf: -PREFIX rdfs: -PREFIX strdf: -PREFIX xsd: -PREFIX gag: - -SELECT ?h (strdf:transform(?hGeo, ) AS ?geo) ?conf ?municipality + - map_local - - - - Query - - KML - - [ΝΟΑ] Select all hotspots of 2012 after refinement operation 'delete in sea' - - -PREFIX rdf: -PREFIX strdf: -PREFIX xsd: -PREFIX gag: - -INSERT {?h noa:isDiscarded "1"^^xsd:int ; - noa:refinedBy noa:seaInconsistency . -} -WHERE { -?h noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; - noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ; - noa:isDerivedFromSensor "SENSOR"^^xsd:string . - OPTIONAL { - ?h gag:hasMunicipality ?municipalit . - } - FILTER(!bound(?municipality)) . -} ]]> - - - - map_local - - - - Query - - KML - - [ΝΟΑ] Select all hotspots of 2012 after refinement operation 'delete in inconsistent areas' - - -PREFIX strdf: -PREFIX xsd: - -SELECT ?h (strdf:transform(?hGeo, ) AS ?geo) ("Corine Land Cover inconsistency" as ?refinement) -WHERE { - ?h noa:hasGeometry ?hGeo ; - noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; - noa:refinedBy noa:clcInconsistency . -} ]]> - - - - map_local - - - - Query - - KML - - [ΝΟΑ] Select all hotspots of 2012 after refinement operation 'refine in coast' - - -PREFIX strdf: -PREFIX xsd: - -SELECT ?h (strdf:transform(?hGeo, ) AS ?geo) ("Corine Land Cover inconsistency" as ?refinement) -WHERE { - ?h noa:hasGeometry ?hGeo ; - noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; - noa:refinedBy noa:clcInconsistency . -} ]]> - - - - map_local - - - - Query - - KML - - [ΝΟΑ] Select all hotspots of 2012 after refinement operation 'refine according to time persistence' - - -PREFIX strdf: -PREFIX xsd: - -SELECT ?h (strdf:transform(?hGeo, ) AS ?geo) ("Temporal persistence" as ?refinement) -WHERE { - ?h noa:hasGeometry ?hGeo ; - noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; - noa:refinedBy noa:temporalPersistence . -} ]]> - - - - map_local - - - - Query - - KML - - [NOA] Select all that have been refined by a refinement operation - - -PREFIX strdf: -PREFIX xsd: - -SELECT (strdf:transform(?hGeo, ) AS ?geo) (GROUP_CONCAT(?refinement; separator=", ") AS ?refinements) -WHERE { - ?h noa:hasGeometry ?hGeo ; - noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; - noa:refinedBy ?refinement . -} -GROUP BY ?geo ]]> - - - - map_local - - - - Enrich available information - - - - Query - - HTML - - [NOA + GAG]Connect each hotspot with the municipality where it is located - - -PREFIX rdf: -PREFIX rdfs: -PREFIX strdf: -PREFIX gag: -PREFIX xsd: - -INSERT { ?h gag:hasMunicipality ?muni } -WHERE { -SELECT ?h (SAMPLE(?mLabel) AS ?muni) - WHERE { - ?h rdf:type noa:Hotspot ; - noa:hasGeometry ?hGeo ; - noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string ; - noa:producedFromProcessingChain "DynamicThresholds"^^xsd:string ; - noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime. - ?m rdf:type gag:Dhmos ; - rdfs:label ?mLabel ; - gag:hasGeometry ?mGeo . - FILTER(strdf:intersects(?hGeo, ?mGeo)) . - } - GROUP BY ?h -}]]> - - - - - - - - - Increase accuracy with respect to underlying area - - - - Query - - HTML - - [NOA+GAG] Delete all hotspots that fall in the sea - - -PREFIX rdf: -PREFIX strdf: -PREFIX xsd: -PREFIX gag: - -INSERT {?h noa:isDiscarded "1"^^xsd:int ; - noa:refinedBy noa:seaInconsistency . -} -WHERE { -?h noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; - noa:producedFromProcessingChain "DynamicThresholds"^^xsd:string ; - noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string . - OPTIONAL { - ?h gag:hasMunicipality ?municipality . - } - FILTER(!bound(?municipality)) . -} - ]]> - - - - plain + Plain @@ -334,151 +126,116 @@ HTML - [NOA+Coastline] Delete the part of polygons that fall in the sea + Select all distinct subjects that appear in the dataset. - -PREFIX rdf: -PREFIX strdf: -PREFIX xsd: -PREFIX gag: - - -INSERT { ?h noa:isDiscarded "1"^^xsd:int . - ?valid rdf:type noa:Hotspot ; - noa:hasConfidence ?conf ; - noa:hasGeometry ?dif ; - gag:hasMunicipality ?municipality ; - noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; - noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string ; - noa:hasConfirmation noa:unknown ; - noa:producedFromProcessingChain "DynamicThresholds"^^xsd:string ; - noa:isProducedBy noa:noa ; - noa:isDerivedFromSatellite "METEOSAT8"^^xsd:string ; - noa:refinedBy noa:coastlineRefinement ; - noa:refinedBy ?refined . + +]]> - + Plain - + Query HTML - [NOA+CLC] Delete all hotspots that intersect with inconsistent areas + Select all distinct predicates that appear in the dataset. - -PREFIX rdf: -PREFIX strdf: -PREFIX xsd: -PREFIX clc: - -INSERT {?h noa:isDiscarded "1"^^xsd:int ; - noa:refinedBy noa:clcInconsistency . -} -WHERE { - SELECT ?h WHERE - { - ?h noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; - noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ; - noa:isDerivedFromSensor "SENSOR"^^xsd:string ; - noa:hasGeometry ?hGeo. - ?a rdf:type clc:ExcludeArea; - clc:hasGeometry ?aGeo. - FILTER(strdf:mbbIntersects(?hGeo,?aGeo)). - } - GROUP BY ?h ?hGeo - HAVING strdf:contains(strdf:union(?aGeo),?hGeo) -}]]> + - plain + Plain + - - Increase accuracy with respect to time persistence - - Query HTML - [NOA] Add virtual hotspots accoring to time persistence of actually detected hotspots + Select all distinct objets that appear in the dataset. - -PREFIX rdf: -PREFIX strdf: -PREFIX xsd: -PREFIX gag: - -INSERT {?newHotspot rdf:type noa:Hotspot ; - noa:hasConfidence ?hConfidence ; - noa:hasGeometry ?hGeometry1 ; - noa:hasAcquisitionTime "TIMESTAMP"^^xsd:dateTime ; - noa:isDerivedFromSensor "MSG1_RSS"^^xsd:string ; - noa:hasConfirmation noa:unknown ; - noa:producedFromProcessingChain "DynamicThresholds-TimePersistence"^^xsd:string ; - noa:isProducedBy noa:noa ; - gag:hasMunicipality ?hMunicipality1 ; - noa:isDerivedFromSatellite "METEOSAT8"^^xsd:string ; - noa:refinedBy noa:temporalPersistence ; - noa:refinedBy ?refined . + 0.0) -}]]> +]]> - plain + Plain + + + Query + + HTML + + Find all distinct classes of the dataset. + + + +SELECT DISTINCT (?o AS ?class) +WHERE { + ?s rdf:type ?o +} +]]> + + + + Plain + + + + + Query + + HTML + + Find the number of triples that appear in the dataset. + + + + + + Plain + + + + Query + + HTML + + Present the first ten triples of the dataset. + + + + + + Plain + @@ -507,7 +264,7 @@ Configuration - ChangeConnection + connection.jsp diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/WebContent/WEB-INF/connection.properties --- a/endpoint/WebContent/WEB-INF/connection.properties Sun Dec 15 15:45:55 2013 +0200 +++ b/endpoint/WebContent/WEB-INF/connection.properties Fri May 23 13:37:11 2014 +0300 @@ -1,6 +1,6 @@ hostname=localhost port=5432 dbengine=postgis -password=p1r3as -dbname=npd +password=postgres +dbname=endpoint username=postgres diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/WebContent/connection.jsp --- a/endpoint/WebContent/connection.jsp Sun Dec 15 15:45:55 2013 +0200 +++ b/endpoint/WebContent/connection.jsp Fri May 23 13:37:11 2014 +0300 @@ -32,19 +32,41 @@ ul#icons li {margin: 1px; position: relative; padding: 1px 0; cursor: pointer; float: left; list-style: none;} ul#icons span.ui-icon {float: left; margin: 0 1px;} - TELEIOS: Strabon Endpoint + Strabon Endpoint - +
"/> "/> "/> - +
+ <% if (request.getAttribute("error") != null) {%> + + + + <%}%> + + <%if (request.getAttribute("info") != null) { %> + + + + <%}%> + + + @@ -78,6 +100,7 @@
+

<%=request.getAttribute("error") %>

+
+

<%=request.getAttribute("info") %>

+
+
+ You must be logged in to change configuration, or run in localhost. +
+
Database Name: "/>
+





diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/WebContent/describe.jsp --- a/endpoint/WebContent/describe.jsp Sun Dec 15 15:45:55 2013 +0200 +++ b/endpoint/WebContent/describe.jsp Fri May 23 13:37:11 2014 +0300 @@ -80,13 +80,13 @@ ul#icons span.ui-icon {float: left; margin: 0 1px;} - TELEIOS: Strabon Endpoint + Strabon Endpoint - +
@@ -208,12 +208,13 @@ + + +
<% if (request.getAttribute("response") != null) {%> - <%=request.getAttribute("response") %> +
<%=request.getAttribute("response") %>
<%}%> - - \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/WebContent/header.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/endpoint/WebContent/header.html Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,37 @@ + + + + + + + + + + + +
+ + + + + + +
  +
+
+

On this page you can execute stSPARQL queries against the Strabon backend. + + + +The acquired data are then annotated using the stRDF model and can be queried using the stSPARQL query language. + +On the left sidebar, some example stSPARQL queries to aquire information on the dataset, are provided. + +

+
diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/WebContent/images/uoa_logo.png Binary file endpoint/WebContent/images/uoa_logo.png has changed diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/WebContent/query.jsp --- a/endpoint/WebContent/query.jsp Sun Dec 15 15:45:55 2013 +0200 +++ b/endpoint/WebContent/query.jsp Fri May 23 13:37:11 2014 +0300 @@ -172,10 +172,10 @@ var map; // create map <%if(request.getAttribute("handle").toString().contains("timemap")){ %> - map = tm.getNativeMap(); - map.setOptions(myOptions); + map = tm.getNativeMap(); + map.setOptions(myOptions); <%} else {%> - var map = new google.maps.Map(document.getElementById("map"), myOptions); + var map = new google.maps.Map(document.getElementById("map"), myOptions); <%}%> <% if (request.getAttribute("pathToKML") == null) {%> // center at Brahames @@ -185,7 +185,7 @@ addListener(map); - <%if ("map_local".equals(request.getAttribute("handle")) || ("timemap_local".equals(request.getAttribute("handle")))) {%> + <%if ("map_local".equals(request.getAttribute("handle"))) {%> // display using geoxml3 var myParser = new geoXML3.parser({map: map}); myParser.parse(kml); @@ -195,7 +195,7 @@ <%}%> <%if (("map".equals(request.getAttribute("handle"))) || ("map_local".equals(request.getAttribute("handle"))) - || ("timemap".equals(request.getAttribute("handle"))) || ("timemap_local".equals(request.getAttribute("handle")))) {%> + || ("timemap".equals(request.getAttribute("handle")))) {%> $('html, body').animate({ scrollTop: $("#divResultsStart").offset().top }, 1500); @@ -306,7 +306,7 @@ - + - TELEIOS: Strabon Endpoint + Strabon Endpoint - +
@@ -159,7 +159,7 @@
- You must be logged in to store. + You must be logged in to store, or run in localhost.
diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/WebContent/teleios-header.html --- a/endpoint/WebContent/teleios-header.html Sun Dec 15 15:45:55 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - - - - - - - - - - - -
- - - - - - -
  -
-
-

On this page you can execute stSPARQL queries against the Strabon backend. -The dataset is based on the following ontologies: -Corine Land Cover, -Greek Administrative Geography (Kallikratis), -Linked Geodata, and -Geonames. -We also use the DLR and NOA ontology we developed for the -in the context of the European FP7 project TELEIOS. - - - -The acquired data are then annotated using the stRDF model and can be queried using the stSPARQL query language. - -On the left sidebar, some example stSPARQL queries are provided. - -

-
diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/pom.xml --- a/endpoint/pom.xml Sun Dec 15 15:45:55 2013 +0200 +++ b/endpoint/pom.xml Fri May 23 13:37:11 2014 +0300 @@ -191,7 +191,7 @@ connection.jsp connection.jsp browse.jsp - teleios-header.html + header.html diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/ConnectionBean.java --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/ConnectionBean.java Sun Dec 15 15:45:55 2013 +0200 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/ConnectionBean.java Fri May 23 13:37:11 2014 +0300 @@ -14,6 +14,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.net.InetAddress; import java.util.Properties; import javax.servlet.RequestDispatcher; @@ -59,6 +60,22 @@ */ private ServletContext context; + //Check for localHost. Works with ipV4 and ipV6 + public static boolean isLocalClient(HttpServletRequest request) { + HttpServletRequest testRequest = request; + try { + InetAddress remote = InetAddress.getByName(testRequest.getRemoteAddr()); + if (remote.isLoopbackAddress()) { + return true; + } + InetAddress localHost = InetAddress.getLocalHost(); + String localAddress = localHost.getHostAddress(); + String remoteAddress = remote.getHostAddress(); + return (remoteAddress != null && remoteAddress.equalsIgnoreCase(localAddress)); + } catch (Exception e) { } + return false; + } + @Override public void init(ServletConfig servletConfig) throws ServletException { super.init(servletConfig); @@ -85,63 +102,83 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher dispatcher; - // set new connection details - strabonWrapper.setConnectionDetails(request.getParameter("dbname"), - request.getParameter("username"), - request.getParameter("password"), - request.getParameter("port"), - request.getParameter("hostname"), - request.getParameter("dbengine")); + //Authorization + boolean authorized; - // pass the query, format, and the handle that had been issued to the dispatcher - request.setAttribute("query", request.getAttribute("query")); - request.setAttribute("format", request.getAttribute("format")); - request.setAttribute("handle", request.getAttribute("handle")); + if(!isLocalClient(request)) { + Authenticate authenticate = new Authenticate(); + String authorization = request.getHeader("Authorization"); + + authorized = authenticate.authenticateUser(authorization, context); + } + else + authorized = true; + + if (!authorized) { + // not allowed, so report he's unauthorized + response.setHeader("WWW-Authenticate", "BASIC realm=\"Please login\""); + response.sendError(HttpServletResponse.SC_UNAUTHORIZED); + } + else { + // set new connection details + strabonWrapper.setConnectionDetails(request.getParameter("dbname"), + request.getParameter("username"), + request.getParameter("password"), + request.getParameter("port"), + request.getParameter("hostname"), + request.getParameter("dbengine")); + + // pass the query, format, and the handle that had been issued to the dispatcher + request.setAttribute("query", request.getAttribute("query")); + request.setAttribute("format", request.getAttribute("format")); + request.setAttribute("handle", request.getAttribute("handle")); - if (logger.isInfoEnabled()) { - logger.info("[StrabonEndpoint.ConnectionBean] Establishing connection with database using new connection details."); - } - - // establish connection - if (strabonWrapper.init()) { // successfully connected, go to query.jsp - if (logger.isInfoEnabled()) { - logger.info("[StrabonEndpoint.ConnectionBean] Connection with database established."); - logger.info("[StrabonEndpoint.ConnectionBean] Saving new connection details in {}.", CONNECTION_PROPERTIES_FILE); - } + if (logger.isInfoEnabled()) { + logger.info("[StrabonEndpoint.ConnectionBean] Establishing connection with database using new connection details."); + } + + // establish connection + if (strabonWrapper.init()) { // successfully connected, go to query.jsp + if (logger.isInfoEnabled()) { + logger.info("[StrabonEndpoint.ConnectionBean] Connection with database established."); + logger.info("[StrabonEndpoint.ConnectionBean] Saving new connection details in {}.", CONNECTION_PROPERTIES_FILE); + } + + // save the new connection details + saveNewConnectionDetails(request.getParameter("dbname"), + request.getParameter("username"), + request.getParameter("password"), + request.getParameter("port"), + request.getParameter("hostname"), + request.getParameter("dbengine")); + + if (logger.isInfoEnabled()) { + logger.info("[StrabonEndpoint.ConnectionBean] New connection details succesfully saved."); + } + + // go to query.jsp + dispatcher = request.getRequestDispatcher("/query.jsp"); + + } else { // try again + if (logger.isInfoEnabled()) { + logger.info("[StrabonEndpoint.ConnectionBean] Cannot establish connection with database."); + } + + // pass the current details of the connection + request.setAttribute("dbname", request.getParameter("dbname")); + request.setAttribute("username", request.getParameter("username")); + request.setAttribute("password", request.getParameter("password")); + request.setAttribute("port", request.getParameter("port")); + request.setAttribute("hostname", request.getParameter("hostname")); + request.setAttribute("dbengine", request.getParameter("dbengine")); + + dispatcher = request.getRequestDispatcher("/connection.jsp"); + + } + + dispatcher.forward(request, response); + } - // save the new connection details - saveNewConnectionDetails(request.getParameter("dbname"), - request.getParameter("username"), - request.getParameter("password"), - request.getParameter("port"), - request.getParameter("hostname"), - request.getParameter("dbengine")); - - if (logger.isInfoEnabled()) { - logger.info("[StrabonEndpoint.ConnectionBean] New connection details succesfully saved."); - } - - // go to query.jsp - dispatcher = request.getRequestDispatcher("/query.jsp"); - - } else { // try again - if (logger.isInfoEnabled()) { - logger.info("[StrabonEndpoint.ConnectionBean] Cannot establish connection with database."); - } - - // pass the current details of the connection - request.setAttribute("dbname", request.getParameter("dbname")); - request.setAttribute("username", request.getParameter("username")); - request.setAttribute("password", request.getParameter("password")); - request.setAttribute("port", request.getParameter("port")); - request.setAttribute("hostname", request.getParameter("hostname")); - request.setAttribute("dbengine", request.getParameter("dbengine")); - - dispatcher = request.getRequestDispatcher("/connection.jsp"); - - } - - dispatcher.forward(request, response); } private void saveNewConnectionDetails(String dbname, String username, String password, diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java Sun Dec 15 15:45:55 2013 +0200 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java Fri May 23 13:37:11 2014 +0300 @@ -267,8 +267,7 @@ out.flush(); - } else if (("map".equals(handle) || "map_local".equals(handle) || - "timemap".equals(handle) || "timemap_local".equals(handle) ) && + } else if (("map".equals(handle) || "map_local".equals(handle) || "timemap".equals(handle)) && (queryResultFormat == stSPARQLQueryResultFormat.KML || queryResultFormat == stSPARQLQueryResultFormat.KMZ) ) { // show map (only valid for KML/KMZ) diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StoreBean.java --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StoreBean.java Sun Dec 15 15:45:55 2013 +0200 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StoreBean.java Fri May 23 13:37:11 2014 +0300 @@ -11,6 +11,7 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; +import java.net.InetAddress; import java.net.MalformedURLException; import java.net.URLDecoder; import java.util.Map; @@ -65,7 +66,23 @@ * The context of the servlet */ private ServletContext context; - + + //Check for localHost. Works with ipV4 and ipV6 + public static boolean isLocalClient(HttpServletRequest request) { + HttpServletRequest testRequest = request; + try { + InetAddress remote = InetAddress.getByName(testRequest.getRemoteAddr()); + if (remote.isLoopbackAddress()) { + return true; + } + InetAddress localHost = InetAddress.getLocalHost(); + String localAddress = localHost.getHostAddress(); + String remoteAddress = remote.getHostAddress(); + return (remoteAddress != null && remoteAddress.equalsIgnoreCase(localAddress)); + } catch (Exception e) { } + return false; + } + @Override public void init(ServletConfig servletConfig) throws ServletException { super.init(servletConfig); @@ -95,7 +112,7 @@ boolean authorized; - if(!request.getLocalAddr().equals("127.0.0.1")) { + if(!isLocalClient(request)) { Authenticate authenticate = new Authenticate(); String authorization = request.getHeader("Authorization"); diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java Sun Dec 15 15:45:55 2013 +0200 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/StrabonBeanWrapper.java Fri May 23 13:37:11 2014 +0300 @@ -61,6 +61,7 @@ private String password; private String dbBackend; private int maxLimit; + private boolean loadFromFile; private String prefixes; private Strabon strabon = null; @@ -72,7 +73,7 @@ public StrabonBeanWrapper(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable, String dbBackend, - int maxLimit, String prefixes, List> args) { + int maxLimit, boolean loadFromFile,String prefixes, List> args) { this.serverName = serverName; this.port = port; this.databaseName = databaseName; @@ -80,7 +81,8 @@ this.password = password; this.checkForLockTable = checkForLockTable; this.dbBackend = dbBackend; - this.maxLimit = maxLimit; + this.maxLimit = maxLimit; + this.loadFromFile = loadFromFile; this.prefixes = prefixes; this.entries = new ArrayList(args.size()); @@ -358,10 +360,11 @@ if (url) { URL source = new URL(src); - if (source.getProtocol().equalsIgnoreCase(FILE_PROTOCOL)) { + if (source.getProtocol().equalsIgnoreCase(FILE_PROTOCOL) && !loadFromFile) { // it would be a security issue if we read from the server's filesystem throw new IllegalArgumentException("The protocol of the URL should be one of http or ftp."); } + } strabon.storeInRepo(src, null, context, format, inference); diff -r 404eacc0f0be -r 4dff2f1163d8 endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/UpdateBean.java --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/UpdateBean.java Sun Dec 15 15:45:55 2013 +0200 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/UpdateBean.java Fri May 23 13:37:11 2014 +0300 @@ -10,6 +10,7 @@ package eu.earthobservatory.org.StrabonEndpoint; import java.io.IOException; +import java.net.InetAddress; import java.net.URLDecoder; import javax.servlet.RequestDispatcher; @@ -38,6 +39,22 @@ private StrabonBeanWrapper strabonWrapper; + //Check for localHost. Works with ipV4 and ipV6 + public static boolean isLocalClient(HttpServletRequest request) { + HttpServletRequest testRequest = request; + try { + InetAddress remote = InetAddress.getByName(testRequest.getRemoteAddr()); + if (remote.isLoopbackAddress()) { + return true; + } + InetAddress localHost = InetAddress.getLocalHost(); + String localAddress = localHost.getHostAddress(); + String remoteAddress = remote.getHostAddress(); + return (remoteAddress != null && remoteAddress.equalsIgnoreCase(localAddress)); + } catch (Exception e) { } + return false; + } + public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @@ -59,7 +76,7 @@ request.setCharacterEncoding("UTF-8"); ServletContext context = getServletContext(); - if(!request.getLocalAddr().equals("127.0.0.1")) { + if(!isLocalClient(request)) { Authenticate authenticate = new Authenticate(); String authorization = request.getHeader("Authorization"); diff -r 404eacc0f0be -r 4dff2f1163d8 evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/AbstractWKT.java --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/AbstractWKT.java Sun Dec 15 15:45:55 2013 +0200 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/AbstractWKT.java Fri May 23 13:37:11 2014 +0300 @@ -24,6 +24,7 @@ * might not be valid. * * @author Charalampos Nikolaou + * @author Panayiotis Smeros */ public class AbstractWKT { @@ -94,7 +95,7 @@ public AbstractWKT(String literalValue) { datatype = null; - if (literalValue.indexOf(WKTHelper.STRDF_SRID_DELIM) > 0) { // strdf:WKT + if (literalValue.lastIndexOf(WKTHelper.STRDF_SRID_DELIM) > 0) { // strdf:WKT datatype = GeoConstants.WKT; isstRDFWKT = true; diff -r 404eacc0f0be -r 4dff2f1163d8 evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/WKTHelper.java --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/WKTHelper.java Sun Dec 15 15:45:55 2013 +0200 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/WKTHelper.java Fri May 23 13:37:11 2014 +0300 @@ -18,6 +18,7 @@ /** * * @author Charalampos Nikolaou + * @author Panayiotis Smeros * */ public class WKTHelper { @@ -37,7 +38,7 @@ public static String getWithoutSRID(String wkt) { if (wkt == null) return wkt; - int pos = wkt.indexOf(STRDF_SRID_DELIM); + int pos = wkt.lastIndexOf(STRDF_SRID_DELIM); if (pos != -1) { return wkt.substring(0, pos); @@ -59,7 +60,7 @@ if (wkt == null) return srid; - int pos = wkt.indexOf(STRDF_SRID_DELIM); + int pos = wkt.lastIndexOf(STRDF_SRID_DELIM); if (pos != -1) { try { srid = Integer.parseInt(wkt.substring(wkt.lastIndexOf(CUT_DELIM) + 1).replace(URI_ENDING, "")); diff -r 404eacc0f0be -r 4dff2f1163d8 evaluation/src/main/java/org/openrdf/query/algebra/evaluation/iterator/StSPARQLGroupIterator.java --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/iterator/StSPARQLGroupIterator.java Sun Dec 15 15:45:55 2013 +0200 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/iterator/StSPARQLGroupIterator.java Fri May 23 13:37:11 2014 +0300 @@ -449,9 +449,17 @@ } else if(function instanceof IntersectionFunc) { - leftArg = (StrabonPolyhedron) evaluateConstruct(((FunctionCall) expr).getArgs().get(0),prototype); - rightArg = (StrabonPolyhedron) evaluateConstruct(((FunctionCall) expr).getArgs().get(1),prototype); - return StrabonPolyhedron.intersection(leftArg, rightArg); + if(((FunctionCall) expr).getArgs().size()==1) + { + //Aggregate!!! => Value ready in spatialAggregatesResults + return new StrabonPolyhedron(spatialAggregatesResult.get(expr)); + } + else + { + leftArg = (StrabonPolyhedron) evaluateConstruct(((FunctionCall) expr).getArgs().get(0),prototype); + rightArg = (StrabonPolyhedron) evaluateConstruct(((FunctionCall) expr).getArgs().get(1),prototype); + return StrabonPolyhedron.intersection(leftArg, rightArg); + } } else if(function instanceof DifferenceFunc) { @@ -510,13 +518,14 @@ computeAggregateFunctions(fc, bindingSet); } - //Currently: Either Union OR Extent + //Currently: Either Union OR Extent OR Intersection private void computeAggregateFunctions(ValueExpr expr, BindingSet bindingSet) { if(expr instanceof FunctionCall) { Function function = FunctionRegistry.getInstance().get(((FunctionCall) expr).getURI()); boolean condition = ((!(function instanceof UnionFunc) || !(((FunctionCall) expr).getArgs().size()==1)) + && (!(function instanceof IntersectionFunc) || !(((FunctionCall) expr).getArgs().size()==1)) &&!(function instanceof ExtentFunc)); if(condition) { @@ -574,6 +583,10 @@ { this.spatialAggregatesResult.put((FunctionCall) expr, poly.getGeometry()); } + else if(function instanceof IntersectionFunc) + { + this.spatialAggregatesResult.put((FunctionCall) expr, poly.getGeometry()); + } else if(function instanceof ExtentFunc) { Geometry env = poly.getGeometry().getEnvelope(); @@ -593,6 +606,15 @@ united.setSRID(poly.getGeometry().getSRID()); this.spatialAggregatesResult.put((FunctionCall) expr, united); } + else if(function instanceof IntersectionFunc) + { + //XXX possible issue with expressions like + // ?x hasGeom sth^^4326 + // ?x hasGeom sthElse^^2100 + Geometry intersection = aggr.intersection(poly.getGeometry()); + intersection.setSRID(poly.getGeometry().getSRID()); + this.spatialAggregatesResult.put((FunctionCall) expr, intersection); + } else if(function instanceof ExtentFunc) { //XXX possible issue with expressions like diff -r 404eacc0f0be -r 4dff2f1163d8 generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java Sun Dec 15 15:45:55 2013 +0200 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java Fri May 23 13:37:11 2014 +0300 @@ -49,6 +49,7 @@ import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.ConvexHullFunc; import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.EnvelopeFunc; import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.UnionFunc; +import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.IntersectionFunc; import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.metric.AreaFunc; import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.relation.RelateFunc; import org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct.PeriodEndsFunc; @@ -924,7 +925,8 @@ && !(function instanceof GeoSparqlConvexHullFunc) && !(function instanceof GeoSparqlEnvelopeFunc) && !(function instanceof Centroid) - && !(function instanceof UnionFunc && functionCall.getArgs().size()==1)) + && !(function instanceof UnionFunc && functionCall.getArgs().size()==1) + && !(function instanceof IntersectionFunc && functionCall.getArgs().size()==1)) { ValueExpr right = functionCall.getArgs().get(1); if(right instanceof FunctionCall) diff -r 404eacc0f0be -r 4dff2f1163d8 generaldb/src/main/java/org/openrdf/sail/generaldb/model/GeneralDBPolyhedron.java --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/model/GeneralDBPolyhedron.java Sun Dec 15 15:45:55 2013 +0200 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/model/GeneralDBPolyhedron.java Fri May 23 13:37:11 2014 +0300 @@ -111,16 +111,32 @@ public String stringValue() { - return new String(this.polyhedronStringRep)+";http://www.opengis.net/def/crs/EPSG/0/"+this.getPolyhedron().getGeometry().getSRID(); + if(String.valueOf(datatype) == GeoConstants.WKT) + return new String(this.polyhedronStringRep)+";http://www.opengis.net/def/crs/EPSG/0/"+this.getPolyhedron().getGeometry().getSRID(); + else + return new String(" "+this.polyhedronStringRep); } @Override public String toString() { - return new String("\""+this.polyhedronStringRep+";http://www.opengis.net/def/crs/EPSG/0/" - +this.getPolyhedron().getGeometry().getSRID()+"\"" + "^^<" + - ((StrabonPolyhedron.EnableConstraintRepresentation) ? - GeoConstants.stRDFSemiLinearPointset : GeoConstants.WKT) - +">"); + if(String.valueOf(datatype) == GeoConstants.WKT) + { + return new String("\""+this.polyhedronStringRep+";http://www.opengis.net/def/crs/EPSG/0/" + +this.getPolyhedron().getGeometry().getSRID()+"\"" + "^^<" + + ((StrabonPolyhedron.EnableConstraintRepresentation) ? + GeoConstants.stRDFSemiLinearPointset : String.valueOf(datatype)) + +">"); + } + else if(String.valueOf(datatype) == GeoConstants.WKTLITERAL) + { + return new String("\""+"<"+"http://www.opengis.net/def/crs/EPSG/0/"+this.getPolyhedron().getGeometry().getSRID()+"> "+this.polyhedronStringRep + +"\"" + "^^<" + + ((StrabonPolyhedron.EnableConstraintRepresentation) ? + GeoConstants.stRDFSemiLinearPointset : String.valueOf(datatype)) + +">"); + } + //must not reach this place + return null; } @Override diff -r 404eacc0f0be -r 4dff2f1163d8 generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/AggregateOptimizer.java --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/AggregateOptimizer.java Sun Dec 15 15:45:55 2013 +0200 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/AggregateOptimizer.java Fri May 23 13:37:11 2014 +0300 @@ -20,6 +20,7 @@ import org.openrdf.query.algebra.evaluation.function.Function; import org.openrdf.query.algebra.evaluation.function.FunctionRegistry; import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.aggregate.ExtentFunc; +import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.IntersectionFunc; import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.UnionFunc; import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase; /** @@ -64,15 +65,17 @@ if(expr instanceof FunctionCall) { Function function = FunctionRegistry.getInstance().get(((FunctionCall) expr).getURI()); - if((!(function instanceof UnionFunc) || !(((FunctionCall) expr).getArgs().size()==1))&&!(function instanceof ExtentFunc)) + if((!(function instanceof UnionFunc) || !(((FunctionCall) expr).getArgs().size()==1)) + && (!(function instanceof IntersectionFunc) || !(((FunctionCall) expr).getArgs().size()==1)) + &&!(function instanceof ExtentFunc)) { //Recursively check arguments - boolean unionPresent = false; + boolean aggregatePresent = false; for(int i = 0 ; i< ((FunctionCall) expr).getArgs().size(); i++) { - unionPresent = unionPresent || aggregateInQuery(((FunctionCall) expr).getArgs().get(i)); + aggregatePresent = aggregatePresent || aggregateInQuery(((FunctionCall) expr).getArgs().get(i)); } - return unionPresent; + return aggregatePresent; } else return true; diff -r 404eacc0f0be -r 4dff2f1163d8 generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBSelectQueryOptimizer.java --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBSelectQueryOptimizer.java Sun Dec 15 15:45:55 2013 +0200 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBSelectQueryOptimizer.java Fri May 23 13:37:11 2014 +0300 @@ -71,6 +71,7 @@ import org.openrdf.query.algebra.evaluation.function.spatial.SpatialRelationshipFunc; import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.aggregate.ExtentFunc; import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.BufferFunc; +import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.IntersectionFunc; import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.TransformFunc; import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.UnionFunc; import org.openrdf.query.algebra.evaluation.function.temporal.stsparql.construct.PeriodEndsFunc; @@ -1449,7 +1450,7 @@ /** * Function used recursively to specify whether the function call present in the select clause contains an aggregate - * of the form strdf:union(?aggrValue). + * of the form strdf:union(?aggrValue) or strdf:intersection(?aggrValue). * @param expr * @return true if no aggregate is present, false otherwise. */ @@ -1458,19 +1459,22 @@ if(expr instanceof FunctionCall) { Function function = FunctionRegistry.getInstance().get(((FunctionCall) expr).getURI()); - if((!(function instanceof UnionFunc) || !(((FunctionCall) expr).getArgs().size()==1))&&!(function instanceof ExtentFunc) && !(function instanceof PeriodPrecedingFunc) - && !(function instanceof PeriodSucceedingFunc)) + if((!(function instanceof UnionFunc) || !(((FunctionCall) expr).getArgs().size()==1)) + &&(!(function instanceof IntersectionFunc) || !(((FunctionCall) expr).getArgs().size()==1)) + && !(function instanceof PeriodPrecedingFunc) + && !(function instanceof PeriodSucceedingFunc) + &&!(function instanceof ExtentFunc)) { //Recursively check arguments - boolean unionPresent = false; + boolean aggregatePresent = false; for(int i = 0 ; i< ((FunctionCall) expr).getArgs().size(); i++) { //ValueExpr tmp = ((FunctionCall) expr).getArgs().get(i); //containsAggregateUnion = containsAggregateUnion || evaluateInDB(tmp); // noUnionPresent = noUnionPresent ^ evaluateInJava(((FunctionCall) expr).getArgs().get(i)); - unionPresent = unionPresent || evaluateInJava(((FunctionCall) expr).getArgs().get(i)); + aggregatePresent = aggregatePresent || evaluateInJava(((FunctionCall) expr).getArgs().get(i)); } - return unionPresent; + return aggregatePresent; } else { @@ -1987,6 +1991,7 @@ Function function = FunctionRegistry.getInstance().get(((FunctionCall) expr).getURI()); //Aggregate Function if(((function instanceof UnionFunc) && (((FunctionCall) expr).getArgs().size()==1)) + || ((function instanceof IntersectionFunc) && (((FunctionCall) expr).getArgs().size()==1)) || (function instanceof ExtentFunc)) { GroupElem groupElem = new GroupElem("havingCondition"+(havingID++)+"-aggregateInside-", new Avg(expr)); diff -r 404eacc0f0be -r 4dff2f1163d8 pom.xml --- a/pom.xml Sun Dec 15 15:45:55 2013 +0200 +++ b/pom.xml Fri May 23 13:37:11 2014 +0300 @@ -96,14 +96,14 @@ psmeros - Panagiotis Smeros + Panayiotis Smeros psmeros@di.uoa.gr http://users.uoa.gr/~psmeros/ Management of Data, Information and Knowledge Group, Dept. of Informatics and Telecommunications, School of Sciences, National and Kapodistrian University of Athens http://www.madgik.di.uoa.gr/ +2 - http://users.uoa.gr/~psmeros/images/me%20and%20plastic%20yiayia.JPG + http://users.uoa.gr/~psmeros/images/psmeros.jpg diff -r 404eacc0f0be -r 4dff2f1163d8 postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java Sun Dec 15 15:45:55 2013 +0200 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java Fri May 23 13:37:11 2014 +0300 @@ -1500,6 +1500,7 @@ else if (tmp instanceof GeneralDBStringValue) //Constant!! { sridNeeded = false; + sridExpr = String.valueOf(WKTHelper.getSRID(((GeneralDBStringValue) tmp).getValue())); break; } @@ -1539,12 +1540,15 @@ } //SRID Support - if(expr instanceof GeneralDBSqlSpatialConstructBinary && expr.getParentNode() == null) - { - filter.appendComma(); - //filter.append(((GeneralDBSqlSpatialConstructBinary)expr).getSrid()); - filter.append(sridExpr); - filter.closeBracket(); + if(sridNeeded) + { + if(expr instanceof GeneralDBSqlSpatialConstructBinary && expr.getParentNode() == null && sridNeeded) + { + filter.appendComma(); + //filter.append(((GeneralDBSqlSpatialConstructBinary)expr).getSrid()); + filter.append(sridExpr); + filter.closeBracket(); + } } filter.appendComma(); @@ -1946,6 +1950,7 @@ else if (tmp instanceof GeneralDBStringValue) //Constant!! { sridNeeded = false; + sridExpr = String.valueOf(WKTHelper.getSRID(((GeneralDBStringValue) tmp).getValue())); break; } @@ -2073,12 +2078,15 @@ filter.closeBracket(); //SRID Support - if(expr instanceof GeneralDBSqlSpatialConstructBinary && expr.getParentNode() == null) - { - filter.appendComma(); - //filter.append(((GeneralDBSqlSpatialConstructBinary)expr).getSrid()); - filter.append(sridExpr); - filter.closeBracket(); + if(sridNeeded) + { + if(expr instanceof GeneralDBSqlSpatialConstructBinary && expr.getParentNode() == null) + { + filter.appendComma(); + //filter.append(((GeneralDBSqlSpatialConstructBinary)expr).getSrid()); + filter.append(sridExpr); + filter.closeBracket(); + } } /// } @@ -2339,6 +2347,7 @@ else if (tmp instanceof GeneralDBStringValue) //Constant!! { sridNeeded = false; + sridExpr = String.valueOf(WKTHelper.getSRID(((GeneralDBStringValue) tmp).getValue())); break; } } @@ -2493,14 +2502,17 @@ } if(units.equals(OGCConstants.OGCmetre) && !((expr.getRightArg() instanceof GeneralDBDoubleValue) && (((GeneralDBDoubleValue)expr.getRightArg()).getValue().equals(0.0)))) - filter.closeBracket(); //close Geometry + filter.closeBracket(); //close Geometry filter.closeBracket(); //SRID Support - if(expr instanceof GeneralDBSqlSpatialConstructTriple && expr.getParentNode() == null) - { - filter.appendComma(); - filter.append(sridExpr); - filter.closeBracket(); + if(sridNeeded) + { + if(expr instanceof GeneralDBSqlSpatialConstructTriple && expr.getParentNode() == null) + { + filter.appendComma(); + filter.append(sridExpr); + filter.closeBracket(); + } } /// } @@ -2586,6 +2598,7 @@ else if (tmp instanceof GeneralDBStringValue) //Constant!! { sridNeeded = false; + sridExpr = String.valueOf(WKTHelper.getSRID(((GeneralDBStringValue) tmp).getValue())); break; } @@ -2659,17 +2672,18 @@ filter.closeBracket(); //Used to explicitly include SRID + if(expr instanceof GeneralDBSqlSpatialConstructUnary && expr.getParentNode() == null) { filter.appendComma(); filter.append(sridExpr); } - } + + } //Used in all the generaldb boolean spatial functions of the form ST_Function(?GEO1,?GEO2) - protected void appendGeneralDBSpatialFunctionTriple(TripleGeneralDBOperator expr, GeneralDBSqlExprBuilder filter, SpatialFunctionsPostGIS func) - throws UnsupportedRdbmsOperatorException - { + protected void appendGeneralDBSpatialFunctionTriple(TripleGeneralDBOperator expr, GeneralDBSqlExprBuilder filter, SpatialFunctionsPostGIS func) throws UnsupportedRdbmsOperatorException + { filter.openBracket(); boolean check1a = expr.getLeftArg().getClass().getCanonicalName().equals("org.openrdf.sail.generaldb.algebra.GeneralDBSqlNull"); diff -r 404eacc0f0be -r 4dff2f1163d8 resultio-spatial/sparqlhtml/src/main/java/org/openrdf/query/resultio/sparqlhtml/stSPARQLResultsHTMLWriter.java --- a/resultio-spatial/sparqlhtml/src/main/java/org/openrdf/query/resultio/sparqlhtml/stSPARQLResultsHTMLWriter.java Sun Dec 15 15:45:55 2013 +0200 +++ b/resultio-spatial/sparqlhtml/src/main/java/org/openrdf/query/resultio/sparqlhtml/stSPARQLResultsHTMLWriter.java Fri May 23 13:37:11 2014 +0300 @@ -110,6 +110,12 @@ try { StringBuilder value = new StringBuilder(); Value boundValue = null; + String href; + + // if set to FALSE, urls link to web. if set to TRUE, urls are described // + boolean linkURL = false; + /////////////////////////////////////////////////////////////////////////// + xmlWriter.startTag(TABLE_ROW_TAG); for (String bindingName : bindingNames) { @@ -130,7 +136,8 @@ xmlWriter.startTag(TABLE_DATA_TAG); // select all the triples that contain the boundValue - String query= "select * " + + if (linkURL){ + String query= "select * " + "where " + "{ " + "?subject ?predicate ?object . "+ @@ -138,8 +145,11 @@ "(?predicate = <"+ boundValue.toString()+ ">) || "+ "(?object = <"+ boundValue.toString()+ ">)) " + "}"; - - String href = "Browse?view=HTML&query="+URLEncoder.encode(query, "UTF-8")+"&format=HTML&resource="+URLEncoder.encode(boundValue.toString(), "UTF-8"); + href = "Browse?view=HTML&query="+URLEncoder.encode(query, "UTF-8")+"&format=HTML&resource="+URLEncoder.encode(boundValue.toString(), "UTF-8"); + } + else{ + href = boundValue.toString(); + } xmlWriter.setAttribute(LINK_REF, href); xmlWriter.startTag(LINK); xmlWriter.text(boundValue.toString()); diff -r 404eacc0f0be -r 4dff2f1163d8 resultio-spatial/sparqlxml/pom.xml --- a/resultio-spatial/sparqlxml/pom.xml Sun Dec 15 15:45:55 2013 +0200 +++ b/resultio-spatial/sparqlxml/pom.xml Fri May 23 13:37:11 2014 +0300 @@ -20,6 +20,10 @@ org.openrdf.sesame + sesame-sail-generaldb + + + org.openrdf.sesame sesame-queryresultio-sparqlxml diff -r 404eacc0f0be -r 4dff2f1163d8 resultio-spatial/sparqlxml/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsXMLWriter.java --- a/resultio-spatial/sparqlxml/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsXMLWriter.java Sun Dec 15 15:45:55 2013 +0200 +++ b/resultio-spatial/sparqlxml/src/main/java/org/openrdf/query/resultio/sparqlxml/stSPARQLResultsXMLWriter.java Fri May 23 13:37:11 2014 +0300 @@ -37,6 +37,8 @@ import org.openrdf.query.resultio.TupleQueryResultFormat; import org.openrdf.query.resultio.TupleQueryResultWriter; import org.openrdf.query.resultio.stSPARQLQueryResultFormat; +import org.openrdf.sail.generaldb.model.GeneralDBPolyhedron; + import eu.earthobservatory.constants.GeoConstants; @@ -158,7 +160,8 @@ else { // spatial literal // else if (value instanceof RdbmsPolyhedron) URI datatype = new URIImpl(GeoConstants.WKT); - Literal literal = new LiteralImpl(value.stringValue(), datatype); + GeneralDBPolyhedron dbpolyhedron = (GeneralDBPolyhedron) value; + Literal literal = new LiteralImpl(value.stringValue(), dbpolyhedron.getDatatype()); writeLiteral(literal); } } diff -r 404eacc0f0be -r 4dff2f1163d8 resultio-spatial/text/src/main/java/org/openrdf/query/resultio/text/stSPARQLResultsTSVWriter.java --- a/resultio-spatial/text/src/main/java/org/openrdf/query/resultio/text/stSPARQLResultsTSVWriter.java Sun Dec 15 15:45:55 2013 +0200 +++ b/resultio-spatial/text/src/main/java/org/openrdf/query/resultio/text/stSPARQLResultsTSVWriter.java Fri May 23 13:37:11 2014 +0300 @@ -22,6 +22,8 @@ import org.openrdf.query.resultio.text.tsv.SPARQLResultsTSVWriter; import org.openrdf.sail.generaldb.model.GeneralDBPolyhedron; +import eu.earthobservatory.constants.GeoConstants; + /** * @author Charalampos Nikolaou * @author Konstantina Bereta (extensions for the temporal case) @@ -41,7 +43,10 @@ // catch the spatial case and create a new literal // constructing a new literal is the only way if we want to reuse the {@link #writeValue(Value)} method GeneralDBPolyhedron dbpolyhedron = (GeneralDBPolyhedron) val; - val = new LiteralImpl(dbpolyhedron.getPolyhedronStringRep()+";http://www.opengis.net/def/crs/EPSG/0/"+dbpolyhedron.getPolyhedron().getGeometry().getSRID(), dbpolyhedron.getDatatype()); + if(String.valueOf(dbpolyhedron.getDatatype()) == GeoConstants.WKT) + val = new LiteralImpl(dbpolyhedron.getPolyhedronStringRep()+";http://www.opengis.net/def/crs/EPSG/0/"+dbpolyhedron.getPolyhedron().getGeometry().getSRID(), dbpolyhedron.getDatatype()); + else + val = new LiteralImpl(" "+dbpolyhedron.getPolyhedronStringRep(),dbpolyhedron.getDatatype()); } else if(val instanceof StrabonTemporalElement){ //creating a temporal literal, which is either a period or an instant diff -r 404eacc0f0be -r 4dff2f1163d8 runtime/pom.xml --- a/runtime/pom.xml Sun Dec 15 15:45:55 2013 +0200 +++ b/runtime/pom.xml Fri May 23 13:37:11 2014 +0300 @@ -216,6 +216,12 @@ info.aduna.commons aduna-commons-net-http-server-embedded + + + jsp-2.1 + org.mortbay.jetty + + diff -r 404eacc0f0be -r 4dff2f1163d8 runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java Sun Dec 15 15:45:55 2013 +0200 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java Fri May 23 13:37:11 2014 +0300 @@ -95,7 +95,11 @@ } + long start = System.currentTimeMillis(); initiate(databaseName, user, password, port, serverName); + long end = System.currentTimeMillis(); + + logger.info("[Strabon] Initialization took {} ms.", (end - start)); } diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDegreesTest.rq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDegreesTest.rq Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,6 @@ +select (geof:buffer(?g, 1, ogc:degree) as ?buffer) +where +{ + ?x geo:hasGeometry ?geom . + ?geom geo:asWKT ?g. +} \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDegreesTest.srx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDegreesTest.srx Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,48 @@ + + + + + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDistanceTest.rq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDistanceTest.rq Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,9 @@ +select (geof:buffer(?g1, geof:distance(?g1, ?g2, ogc:degree), ogc:degree) as ?buffer) +where +{ + ex:A geo:hasGeometry ?geom1 . + ?geom1 geo:asWKT ?g1. + + ex:G geo:hasGeometry ?geom2 . + ?geom2 geo:asWKT ?g2. +} \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDistanceTest.srx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferDistanceTest.srx Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,15 @@ + + + + + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> POLYGON ((0 -0.0000000007081155, 0 0.9999999994774795, 0.9999999999775806 0.9999999994774795, 0.9999999999775806 -0.0000000007081155, 0 -0.0000000007081155)) + + + + + + diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferMetresTest.rq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferMetresTest.rq Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,6 @@ +select (geof:buffer(?g, 1, ogc:metre) as ?buffer) +where +{ + ?x geo:hasGeometry ?geom . + ?geom geo:asWKT ?g. +} \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferMetresTest.srx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferMetresTest.srx Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,48 @@ + + + + + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + + <http://www.opengis.net/def/crs/EPSG/0/3857> 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)) + + + + diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferWithConstantTest.rq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferWithConstantTest.rq Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,6 @@ +select (geof:buffer(" POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))"^^, 1, ogc:degree) as ?buffer) +where +{ + ex:A geo:hasGeometry ?geom . + ?geom geo:asWKT ?g. +} \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferWithConstantTest.srx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/geoSPARQL/QueryFunctionsTest/BufferWithConstantTest.srx Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,13 @@ + + + + + + + + + <http://www.opengis.net/def/crs/EPSG/0/4326> 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)) + + + + diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/AggregateFunctionsTest.nt --- a/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/AggregateFunctionsTest.nt Sun Dec 15 15:45:55 2013 +0200 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/AggregateFunctionsTest.nt Fri May 23 13:37:11 2014 +0300 @@ -1,2 +1,4 @@ "Polygon((0 0, 1 0, 1 1, 0 1, 0 0))"^^. - "Polygon((0 0, 2 0, 2 2, 0 2 , 0 0))"^^. \ No newline at end of file + "Polygon((0 0, 2 0, 2 2, 0 2 , 0 0))"^^. + . + . \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/ExtentGroupByTest.rq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/ExtentGroupByTest.rq Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,7 @@ +select (strdf:extent(?g) as ?extent) +where +{ + ?x ex:consistsOf ?y . + ?y ex:hasGeometry ?g . +} +group by ?x \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/ExtentGroupByTest.srx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/ExtentGroupByTest.srx Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,13 @@ + + + + + + + + + POLYGON ((0 0, 0 2, 2 2, 2 0, 0 0));http://www.opengis.net/def/crs/EPSG/0/4326 + + + + \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionGroupByTest.rq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionGroupByTest.rq Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,7 @@ +select (strdf:intersection(?g) as ?intersection) +where +{ + ?x ex:consistsOf ?y . + ?y ex:hasGeometry ?g . +} +group by ?x \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionGroupByTest.srx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionGroupByTest.srx Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,13 @@ + + + + + + + + + POLYGON ((1 0, 0 0, 0 1, 1 1, 1 0));http://www.opengis.net/def/crs/EPSG/0/4326 + + + + \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionTest.rq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionTest.rq Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,5 @@ +select (strdf:intersection(?g) as ?intersection) +where +{ + ?x ex:hasGeometry ?g. +} \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionTest.srx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/IntersectionTest.srx Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,13 @@ + + + + + + + + + POLYGON ((1 0, 0 0, 0 1, 1 1, 1 0));http://www.opengis.net/def/crs/EPSG/0/4326 + + + + diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/UnionGroupByTest.rq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/UnionGroupByTest.rq Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,7 @@ +select (strdf:union(?g) as ?union) +where +{ + ?x ex:consistsOf ?y . + ?y ex:hasGeometry ?g . +} +group by ?x \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/UnionGroupByTest.srx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/UnionGroupByTest.srx Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,13 @@ + + + + + + + + + POLYGON ((1 0, 0 0, 0 1, 0 2, 2 2, 2 0, 1 0));http://www.opengis.net/def/crs/EPSG/0/4326 + + + + diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BoundaryWithConstantTest.rq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BoundaryWithConstantTest.rq Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,5 @@ +select (strdf:boundary("POLYGON((0 0, 1 0, 1 1, 0 1, 0 0));http://www.opengis.net/def/crs/EPSG/0/2100"^^) as ?boundary) +where +{ +ex:A ex:hasGeometry ?g. +} \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BoundaryWithConstantTest.srx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BoundaryWithConstantTest.srx Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,13 @@ + + + + + + + + + LINESTRING (0 0, 1 0, 1 1, 0 1, 0 0);http://www.opengis.net/def/crs/EPSG/0/2100 + + + + \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BufferWithConstantTest.rq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BufferWithConstantTest.rq Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,5 @@ +select (strdf:buffer("POLYGON((0 0, 1 0, 1 1, 0 1, 0 0));http://www.opengis.net/def/crs/EPSG/0/2100"^^, 1, ogc:degree) as ?buffer) +where +{ +ex:A ex:hasGeometry ?g. +} \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BufferWithConstantTest.srx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/BufferWithConstantTest.srx Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,13 @@ + + + + + + + + + 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 + + + + diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/UnionWithConstantTest.rq --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/UnionWithConstantTest.rq Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,5 @@ +select (strdf:union("POLYGON((0 0, 1 0, 1 1, 0 1, 0 0));http://www.opengis.net/def/crs/EPSG/0/2100"^^, "POLYGON((1 0, 2 0, 2 1, 1 2, 1 0));http://www.opengis.net/def/crs/EPSG/0/2100"^^) as ?buffer) +where +{ +ex:A ex:hasGeometry ?g. +} \ No newline at end of file diff -r 404eacc0f0be -r 4dff2f1163d8 testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/UnionWithConstantTest.srx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testsuite/src/test/resources/stSPARQL/SpatialAnalysisFunctionsTest/UnionWithConstantTest.srx Fri May 23 13:37:11 2014 +0300 @@ -0,0 +1,13 @@ + + + + + + + + + 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 + + + + \ No newline at end of file