Strabon
changeset 1509:c47780f6d3a1
Removed tests from strabon-runtime project.
author | Panayiotis Smeros <psmeros@di.uoa.gr> |
---|---|
date | Tue Apr 28 22:05:36 2015 +0300 (2015-04-28) |
parents | 9298aa0b7856 |
children | 4b2c4f8cb7fa |
files | runtime/src/test/java/eu/earthobservatory/runtime/generaldb/AggregateTests.java runtime/src/test/java/eu/earthobservatory/runtime/generaldb/GeneralTests.java runtime/src/test/java/eu/earthobservatory/runtime/generaldb/HavingTests.java runtime/src/test/java/eu/earthobservatory/runtime/generaldb/JoinTests.java runtime/src/test/java/eu/earthobservatory/runtime/generaldb/MeaningfulAggregateTests.java runtime/src/test/java/eu/earthobservatory/runtime/generaldb/NOATests.java runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SPARQL11Tests.java runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SimpleTests.java runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SpatialTests.java runtime/src/test/java/eu/earthobservatory/runtime/generaldb/TransformTests.java runtime/src/test/java/eu/earthobservatory/runtime/monetdb/AggregateTests.java runtime/src/test/java/eu/earthobservatory/runtime/monetdb/GeneralTests.java runtime/src/test/java/eu/earthobservatory/runtime/monetdb/HavingTests.java runtime/src/test/java/eu/earthobservatory/runtime/monetdb/JoinTests.java runtime/src/test/java/eu/earthobservatory/runtime/monetdb/MeaningfulAggregateTests.java runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SimpleTests.java runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SpatialTests.java runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TemplateTests.java runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TransformTests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/AggregateTests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/AllTests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/GeneralTests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/HavingTests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/JoinTests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/MeaningfulAggregateTests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/SPARQL11Tests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/SimpleTests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/SpatialTests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/TemplateTests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/TransformTests.java runtime/src/test/resources/aggregate-tests-srid.nt runtime/src/test/resources/cco2.nt runtime/src/test/resources/databases.properties runtime/src/test/resources/group-tests-srid.nt runtime/src/test/resources/having-tests-srid.nt runtime/src/test/resources/join-tests-srid.nt runtime/src/test/resources/join-tests.nt runtime/src/test/resources/more-tests-srid.nt runtime/src/test/resources/more-tests.nt runtime/src/test/resources/simple-tests.nt runtime/src/test/resources/sparql11-tests.nt runtime/src/test/resources/spatial-tests-srid.nt |
line diff
1.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/AggregateTests.java Wed Mar 18 14:03:01 2015 +0200 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,143 +0,0 @@ 1.4 -/** 1.5 - * This Source Code Form is subject to the terms of the Mozilla Public 1.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.8 - * 1.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 1.10 - * 1.11 - * http://www.strabon.di.uoa.gr/ 1.12 - */ 1.13 -package eu.earthobservatory.runtime.generaldb; 1.14 - 1.15 -import java.io.IOException; 1.16 - 1.17 -import org.junit.Test; 1.18 -import org.openrdf.query.MalformedQueryException; 1.19 -import org.openrdf.query.QueryEvaluationException; 1.20 -import org.openrdf.query.TupleQueryResultHandlerException; 1.21 - 1.22 -public class AggregateTests { 1.23 - public static Strabon strabon; 1.24 - 1.25 - 1.26 - protected static String jdbcDriver= "org.postgresql.Driver"; 1.27 - protected static String serverName = "localhost"; 1.28 - protected static String username = "postgres"; 1.29 - protected static String password = "postgres"; 1.30 - protected static Integer port = 5432; 1.31 - protected static java.sql.Connection conn = null; 1.32 - protected static String databaseName = null; 1.33 - 1.34 - 1.35 - 1.36 - 1.37 - 1.38 - String prefixes = 1.39 - "PREFIX lgdo:<http://linkedgeodata.org/ontology/> "+ 1.40 - "PREFIX geo:<http://www.w3.org/2003/01/geo/wgs84_pos#> "+ 1.41 - "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> "+ 1.42 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "; 1.43 - 1.44 - String queryGroupBy1 = 1.45 - prefixes+ 1.46 - "SELECT (?placegeo AS ?xxx) (AVG(?placegeo) AS ?av) (strdf:union(?placegeo) AS ?united) "+ 1.47 - "WHERE { "+ 1.48 - "?place "+ 1.49 - "rdfs:label ?placename ; "+ 1.50 - "geo:geometry ?placegeo ; "+ 1.51 - "a ?type. "+ 1.52 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 1.53 - "} "+ 1.54 - "GROUP BY ?placegeo (STR(?place) AS ?str) strdf:union(?placegeo,?placegeo) "+ 1.55 - "HAVING (AVG(?str) < 1) "+ 1.56 - "ORDER BY ?placegeo strdf:union(?placegeo,?placegeo) "+ 1.57 - ""; 1.58 - 1.59 - String queryGroupBy2 = 1.60 - prefixes+ 1.61 - "SELECT (strdf:union(strdf:intersection(?placegeo,?placegeo2)) AS ?united) "+ 1.62 - "WHERE { "+ 1.63 - "?place "+ 1.64 - "rdfs:label ?placename ; "+ 1.65 - "geo:geometry ?placegeo ; "+ 1.66 - "geo:geometry ?placegeo2 ; "+ 1.67 - "a ?type. "+ 1.68 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 1.69 - "} "+ 1.70 - "GROUP BY ?placegeo ?placegeo2"; 1.71 - 1.72 - String queryGroupBy3 = 1.73 - prefixes+ 1.74 - "SELECT (strdf:union(strdf:intersection(?placegeo,?placegeo2)) AS ?united) "+ 1.75 - "WHERE { "+ 1.76 - "?place "+ 1.77 - "rdfs:label ?placename ; "+ 1.78 - "geo:geometry ?placegeo ; "+ 1.79 - "geo:geometry ?placegeo2 ; "+ 1.80 - "a ?type. "+ 1.81 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 1.82 - "} "+ 1.83 - "GROUP BY ?placegeo ?placegeo2"; 1.84 - 1.85 - 1.86 - String queryOrder1 = 1.87 - prefixes+ 1.88 - "SELECT ?placegeo ?place (strdf:union(?placegeo) AS ?koko) (strdf:union(?placegeo,?placegeo) AS ?kiki) "+ 1.89 - "WHERE { "+ 1.90 - "?place "+ 1.91 - "rdfs:label ?placename ; "+ 1.92 - "geo:geometry ?placegeo ; "+ 1.93 - "a ?type. "+ 1.94 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 1.95 - "} "+ 1.96 - "ORDER BY strdf:union(?placegeo,?placegeo) ?placegeo ?place"; 1.97 - 1.98 - 1.99 - String queryOrder2 = 1.100 - prefixes+ 1.101 - "SELECT (?place AS ?xx) (strdf:union(?placegeo,?placegeo) AS ?koko) ?place "+ 1.102 - "WHERE { "+ 1.103 - "?place "+ 1.104 - "rdfs:label ?placename ; "+ 1.105 - "geo:geometry ?placegeo ; "+ 1.106 - "a ?type. "+ 1.107 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 1.108 - "} "+ 1.109 - "ORDER BY ?placegeo "; 1.110 - 1.111 - 1.112 - 1.113 - @Test 1.114 - public void testQueryGroupBy1() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 1.115 - { 1.116 - strabon.query(queryGroupBy1,strabon.getSailRepoConnection()); 1.117 - } 1.118 - 1.119 - @Test 1.120 - public void testQueryGroupBy2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 1.121 - { 1.122 - strabon.query(queryGroupBy2,strabon.getSailRepoConnection()); 1.123 - 1.124 - } 1.125 - 1.126 - @Test 1.127 - public void testQueryGroupBy3() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 1.128 - { 1.129 - strabon.query(queryGroupBy3,strabon.getSailRepoConnection()); 1.130 - 1.131 - } 1.132 - 1.133 - @Test 1.134 - public void testQueryOrder1() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 1.135 - { 1.136 - strabon.query(queryOrder1,strabon.getSailRepoConnection()); 1.137 - 1.138 - } 1.139 - 1.140 - @Test 1.141 - public void testQueryOrder2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 1.142 - { 1.143 - strabon.query(queryOrder2,strabon.getSailRepoConnection()); 1.144 - 1.145 - } 1.146 -}
2.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/GeneralTests.java Wed Mar 18 14:03:01 2015 +0200 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,649 +0,0 @@ 2.4 -/** 2.5 - * This Source Code Form is subject to the terms of the Mozilla Public 2.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 2.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 2.8 - * 2.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 2.10 - * 2.11 - * http://www.strabon.di.uoa.gr/ 2.12 - */ 2.13 -package eu.earthobservatory.runtime.generaldb; 2.14 - 2.15 -import java.io.IOException; 2.16 - 2.17 -import org.junit.Test; 2.18 -import org.openrdf.query.MalformedQueryException; 2.19 -import org.openrdf.query.QueryEvaluationException; 2.20 -import org.openrdf.query.TupleQueryResultHandlerException; 2.21 - 2.22 -abstract public class GeneralTests { 2.23 - public static Strabon strabon; 2.24 - 2.25 - 2.26 - protected static String jdbcDriver= "org.postgresql.Driver"; 2.27 - protected static String serverName = "localhost"; 2.28 - protected static String username = "postgres"; 2.29 - protected static String password = "postgres"; 2.30 - protected static Integer port = 5432; 2.31 - protected static java.sql.Connection conn = null; 2.32 - protected static String databaseName = null; 2.33 - 2.34 - // @BeforeClass 2.35 - // public static void initialize() throws SQLException, ClassNotFoundException 2.36 - // { 2.37 - // strabon = new Strabon("cco2","postgres","p1r3as", 5432, "localhost", true); 2.38 - // 2.39 - // } 2.40 - 2.41 - 2.42 - 2.43 - 2.44 - 2.45 - 2.46 - protected String prefixes = 2.47 - "PREFIX lgdo:<http://linkedgeodata.org/ontology/> "+ 2.48 - "PREFIX geo:<http://www.w3.org/2003/01/geo/wgs84_pos#> "+ 2.49 - "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> "+ 2.50 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 2.51 - "PREFIX geonames:<http://www.geonames.org/ontology/>"; 2.52 - 2.53 - protected String query1 = 2.54 - prefixes+ 2.55 - "SELECT ?place ?placegeo "+ 2.56 - "WHERE { "+ 2.57 - "?place "+ 2.58 - "rdfs:label ?placename ; "+ 2.59 - "geo:geometry ?placegeo ; "+ 2.60 - "a ?type. "+ 2.61 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)) "+ 2.62 - "}"; 2.63 - 2.64 - protected String query2 = 2.65 - prefixes+ 2.66 - "SELECT ?place (?placegeo AS ?tt1) (strdf:union(?placegeo,?placegeo) AS ?constr) "+ 2.67 - "WHERE { "+ 2.68 - "?place "+ 2.69 - " a ?type ; "+ 2.70 - " geo:geometry ?placegeo ; "+ 2.71 - " rdfs:label ?placename . "+ 2.72 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)) "+ 2.73 - "}"; 2.74 - 2.75 - protected String query3 = 2.76 - prefixes+ 2.77 - "SELECT ?place (?placegeo AS ?constr) "+ 2.78 - "WHERE { "+ 2.79 - "?place "+ 2.80 - " a ?type ; "+ 2.81 - " geo:geometry ?placegeo ; "+ 2.82 - " rdfs:label ?placename . "+ 2.83 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)) "+ 2.84 - "}"; 2.85 - 2.86 - protected String query4 = 2.87 - prefixes+ 2.88 - "SELECT ?place ?placegeo "+ 2.89 - "WHERE { "+ 2.90 - "?place "+ 2.91 - " a ?type ; "+ 2.92 - " geo:geometry ?placegeo ; "+ 2.93 - " rdfs:label ?placename . "+ 2.94 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo) " + 2.95 - "&& strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)) "+ 2.96 - "}"; 2.97 - 2.98 - protected String query5 = 2.99 - prefixes+ 2.100 - "SELECT ?place ?placegeo "+ 2.101 - "WHERE { "+ 2.102 - "?place "+ 2.103 - " a ?type ; "+ 2.104 - " geo:geometry ?placegeo ; "+ 2.105 - " rdfs:label ?placename . "+ 2.106 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)). "+ 2.107 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)). "+ 2.108 - "}"; 2.109 - 2.110 - protected String query6 = 2.111 - prefixes+ 2.112 - "SELECT (strdf:union(?placegeo,strdf:union(?placegeo,?placegeo)) AS ?constr1) " + 2.113 - "?place (?placegeo AS ?tt1) (strdf:union(?placegeo,?placegeo) AS ?constr2) "+ 2.114 - "WHERE { "+ 2.115 - "?place "+ 2.116 - " a ?type ; "+ 2.117 - " geo:geometry ?placegeo ; "+ 2.118 - " rdfs:label ?placename . "+ 2.119 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)) "+ 2.120 - "}"; 2.121 - 2.122 - protected String query7 = 2.123 - prefixes+ 2.124 - "SELECT ?place (?placegeo AS ?tt1) (strdf:union(?placegeo,?placegeo) AS ?constr) "+ 2.125 - "WHERE { "+ 2.126 - "?place "+ 2.127 - " a ?type ; "+ 2.128 - " geo:geometry ?placegeo ; "+ 2.129 - " rdfs:label ?placename . "+ 2.130 - "} "; 2.131 - 2.132 - protected String query8 = 2.133 - prefixes+ 2.134 - "SELECT ?place "+ 2.135 - "WHERE { "+ 2.136 - "?place "+ 2.137 - " a ?type ; "+ 2.138 - " geo:geometry ?placegeo ; "+ 2.139 - " rdfs:label ?placename . "+ 2.140 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 2.141 - "}"; 2.142 - 2.143 - protected String queryBufferVar = 2.144 - prefixes+ 2.145 - "SELECT ?place (?placegeo AS ?tt1) "+ 2.146 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 2.147 - "?place "+ 2.148 - " a ?type ; "+ 2.149 - " geo:geometry ?placegeo ; "+ 2.150 - " rdfs:label ?placename . "+ 2.151 - "FILTER(strdf:mbbIntersects(strdf:buffer(?placegeo,?ext),?placegeo)) "+ 2.152 - "}"; 2.153 - 2.154 - protected String queryBufferConst = 2.155 - prefixes+ 2.156 - "SELECT ?place (?placegeo AS ?tt1) "+ 2.157 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 2.158 - "?place "+ 2.159 - " a ?type ; "+ 2.160 - " geo:geometry ?placegeo ; "+ 2.161 - " rdfs:label ?placename . "+ 2.162 - "FILTER(strdf:mbbIntersects(strdf:buffer(?placegeo,2),?placegeo)) "+ 2.163 - "}"; 2.164 - 2.165 - protected String queryBufferConst2 = 2.166 - prefixes+ 2.167 - "SELECT ?place (?placegeo AS ?tt1) "+ 2.168 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 2.169 - "?place "+ 2.170 - " a ?type ; "+ 2.171 - " geo:geometry ?placegeo ; "+ 2.172 - " rdfs:label ?placename . "+ 2.173 - "FILTER(strdf:mbbIntersects(strdf:buffer(\"POINT(23.72873 37.97205)\"^^<http://strdf.di.uoa.gr/ontology#WKT>,0.0572),?placegeo)) "+ 2.174 - "}"; 2.175 - 2.176 - protected String queryBufferConstInSelect = 2.177 - prefixes+ 2.178 - "SELECT ?place (?placegeo AS ?tt1) (strdf:buffer(?placegeo,2.5) AS ?buf) "+ 2.179 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 2.180 - "?place "+ 2.181 - " a ?type ; "+ 2.182 - " geo:geometry ?placegeo ; "+ 2.183 - " rdfs:label ?placename . "+ 2.184 - "FILTER(strdf:mbbIntersects(strdf:buffer(?placegeo,2.5),?placegeo)) "+ 2.185 - "}"; 2.186 - 2.187 - 2.188 - protected String queryBufferSelectFilterA = 2.189 - prefixes+ 2.190 - "SELECT ?place (?placegeo AS ?tt1) (strdf:buffer(?placegeo,?ext) AS ?buf) "+ 2.191 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 2.192 - "?place "+ 2.193 - " a ?type ; "+ 2.194 - " geo:geometry ?placegeo ; "+ 2.195 - " rdfs:label ?placename . "+ 2.196 - "FILTER(strdf:mbbIntersects(strdf:buffer(?placegeo,2),?placegeo)) "+ 2.197 - "}"; 2.198 - 2.199 - protected String queryBufferSelectFilterB = 2.200 - prefixes+ 2.201 - "SELECT ?place (?placegeo AS ?tt1) (strdf:buffer(?placegeo,3) AS ?buf) "+ 2.202 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 2.203 - "?place "+ 2.204 - " a ?type ; "+ 2.205 - " geo:geometry ?placegeo ; "+ 2.206 - " rdfs:label ?placename . "+ 2.207 - "FILTER(strdf:mbbIntersects(strdf:buffer(?placegeo,?ext),?placegeo)) "+ 2.208 - "}"; 2.209 - 2.210 - protected String queryEnvelopeConvexHull = 2.211 - prefixes+ 2.212 - "SELECT ?place (?placegeo AS ?tt1) (strdf:envelope(?placegeo) AS ?constr) (strdf:convexHull(?placegeo) AS ?constr2) "+ 2.213 - "WHERE { "+ 2.214 - "?place "+ 2.215 - " a ?type ; "+ 2.216 - " geo:geometry ?placegeo ; "+ 2.217 - " rdfs:label ?placename . "+ 2.218 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,strdf:envelope(?placegeo)),?placegeo) && strdf:mbbIntersects(strdf:convexHull(?placegeo),?placegeo)) "+ 2.219 - "}"; 2.220 - 2.221 - protected String queryMetrics1 = 2.222 - prefixes+ 2.223 - "SELECT ?place ?placegeo ( strdf:area(?placegeo) AS ?area) "+ 2.224 - "( strdf:envelope(?placegeo) AS ?mbb) "+ 2.225 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 2.226 - "?place "+ 2.227 - " rdfs:label ?placename ; "+ 2.228 - " geo:geometry ?placegeo ; "+ 2.229 - " a ?type. "+ 2.230 - "FILTER(2*strdf:distance(?placegeo,?placegeo) + strdf:area(?placegeo) - 3 + ?ext "+ 2.231 - "< ?ext + 8 - strdf:distance(?placegeo,?placegeo)) "+ 2.232 - "}"; 2.233 - 2.234 - protected String queryMetricsLightOptimized = 2.235 - prefixes+ 2.236 - "SELECT ?place ?placegeo ( 33*strdf:area(?placegeo) + 114 AS ?area) ( strdf:envelope(?placegeo) AS ?mbb) "+ 2.237 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 2.238 - "?place "+ 2.239 - " rdfs:label ?placename ; "+ 2.240 - " geo:geometry ?placegeo ; "+ 2.241 - " a ?type. "+ 2.242 - "FILTER(2*strdf:distance(?placegeo,?placegeo) < 8) "+ 2.243 - "}"; 2.244 - 2.245 - //Metrics with only one var must not be optimized 2.246 - protected String queryMetricsAreaMustNotBeOptimized = 2.247 - prefixes+ 2.248 - "SELECT ?place ?placegeo ( 33*strdf:area(?placegeo) + 114 AS ?area) ( strdf:envelope(?placegeo) AS ?mbb) "+ 2.249 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 2.250 - "?place "+ 2.251 - " rdfs:label ?placename ; "+ 2.252 - " geo:geometry ?placegeo ; "+ 2.253 - " a ?type. "+ 2.254 - "FILTER(2*strdf:area(?placegeo) < 8) "+ 2.255 - "}"; 2.256 - 2.257 - protected String queryMetricsMathInSelect = 2.258 - prefixes+ 2.259 - "SELECT ?place ?placegeo ( 33*strdf:area(?placegeo) + 114 AS ?area) ( strdf:envelope(?placegeo) AS ?mbb) "+ 2.260 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 2.261 - "?place "+ 2.262 - " rdfs:label ?placename ; "+ 2.263 - " geo:geometry ?placegeo ; "+ 2.264 - " a ?type. "+ 2.265 - "FILTER(2*strdf:distance(?placegeo,?placegeo) + strdf:area(?placegeo) - 3 + ?ext " + 2.266 - "< ?ext + 8 - strdf:distance(?placegeo,?placegeo)) "+ 2.267 - "}"; 2.268 - 2.269 - protected String querySpatialPropertiesMonetDB = 2.270 - prefixes+ 2.271 - "SELECT ?place ?placegeo (strdf:dimension(?placegeo) + 2 AS ?dim) (strdf:srid(?placegeo) AS ?srid) "+ 2.272 - "WHERE { "+ 2.273 - "?place "+ 2.274 - " rdfs:label ?placename ; "+ 2.275 - " geo:geometry ?placegeo ; "+ 2.276 - " a ?type. "+ 2.277 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo) && strdf:isSimple(?placegeo) "+ 2.278 -// "&& strdf:dimension(?placegeo) - 1 < 3" + 2.279 - ") "+ 2.280 - "}"; 2.281 - 2.282 - protected String querySpatialPropertiesPostGIS = 2.283 - prefixes+ 2.284 - "SELECT ?place ?placegeo (strdf:dimension(?placegeo) + 2 AS ?dim) (strdf:srid(?placegeo) AS ?srid) "+ 2.285 - "WHERE { "+ 2.286 - "?place "+ 2.287 - " rdfs:label ?placename ; "+ 2.288 - " geo:geometry ?placegeo ; "+ 2.289 - " a ?type. "+ 2.290 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo) && strdf:isSimple(?placegeo) "+ 2.291 - "&& strdf:dimension(?placegeo) - 1 < 3) "+ 2.292 - "}"; 2.293 - 2.294 - protected String querySpatialPropertiesConstMonetDB = 2.295 - prefixes+ 2.296 - "SELECT ?place ?placegeo (strdf:srid(?placegeo) AS ?srid) (strdf:dimension(?placegeo) + 2 AS ?dim) "+ 2.297 - "WHERE { "+ 2.298 - "?place "+ 2.299 - " rdfs:label ?placename ; "+ 2.300 - " geo:geometry ?placegeo ; "+ 2.301 - " a ?type. "+ 2.302 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo) && strdf:isSimple(?placegeo) "+ 2.303 -// "&& strdf:dimension(\"POINT(0 0)\") - 1 < 3" + 2.304 - ") "+ 2.305 - "}"; 2.306 - 2.307 - protected String querySpatialPropertiesConstPostGIS = 2.308 - prefixes+ 2.309 - "SELECT ?place ?placegeo (strdf:srid(?placegeo) AS ?srid) (strdf:dimension(?placegeo) + 2 AS ?dim) "+ 2.310 - "WHERE { "+ 2.311 - "?place "+ 2.312 - " rdfs:label ?placename ; "+ 2.313 - " geo:geometry ?placegeo ; "+ 2.314 - " a ?type. "+ 2.315 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo) && strdf:isSimple(?placegeo) "+ 2.316 - "&& strdf:dimension(\"POINT(0 0)\") - 1 < 3) "+ 2.317 - "}"; 2.318 - 2.319 - protected String queryRelate = 2.320 - prefixes+ 2.321 - "SELECT ?place ?placegeo "+ 2.322 - "WHERE { "+ 2.323 - "?place "+ 2.324 - "rdfs:label ?placename ; "+ 2.325 - "geo:geometry ?placegeo ; "+ 2.326 - "a ?type. "+ 2.327 - "FILTER(strdf:relate(?placegeo,?placegeo,\"0FFFFF212\")) "+ 2.328 - "}"; 2.329 - 2.330 - // protected String queryThematicUnion = 2.331 - // prefixes+ 2.332 - // "SELECT ?place "+ 2.333 - // "WHERE { "+ 2.334 - // "?place "+ 2.335 - // "rdfs:label ?placename ; "+ 2.336 - // "geo:geometry ?placegeo. "+ 2.337 - // "{?place a lgdo:Pier . } " + 2.338 - // "UNION" + 2.339 - // "{?place a lgdo:Harbour . } }"; 2.340 - 2.341 - 2.342 - /** 2.343 - * The following three queries test potential bugs noticed during the evaluation process for www2012. 2.344 - * No issue seems to be present. 2.345 - */ 2.346 - protected String queryThematicUnion = 2.347 - prefixes+ 2.348 - "SELECT ?place2 ?placename "+ 2.349 - " WHERE { "+ 2.350 - " ?place2 rdfs:label ?placename. "+ 2.351 - " ?place2 strdf:hasGeometry ?placegeo. " + 2.352 - "{" + 2.353 - " ?place2 a <http://linkedgeodata.org/ontology#Harbour> ." + 2.354 - " } " + 2.355 - "UNION" + 2.356 - "{" + 2.357 - " ?place2 a <http://linkedgeodata.org/ontology#Pier> ." + 2.358 - " } " + 2.359 - "<http://www.geonames.org/ontology/Athens> strdf:hasGeometry ?ar . " + 2.360 - "FILTER(strdf:disjoint(?placegeo,?ar))" + 2.361 - "}"; 2.362 - 2.363 - protected String query6_real = prefixes+ 2.364 - "SELECT ?capital ?pierLabel "+ 2.365 - "WHERE "+ 2.366 - "{ "+ 2.367 - "?country a <http://dbpedia.org/resource/Country> . "+ 2.368 - "?country <http://dbpedia.org/property/capital> ?capital_label . "+ 2.369 - "?capital <http://www.w3.org/2000/01/rdf-schema#label> ?capital_label . "+ 2.370 - "?capitalGeoNames <http://www.w3.org/2002/07/owl#sameAs> ?capital . "+ 2.371 - "?capitalGeoNames strdf:hasGeometry ?capitalGeo . "+ 2.372 - "OPTIONAL "+ 2.373 - "{ "+ 2.374 - " ?pier a <http://linkedgeodata.org/ontology#Pier> . " + 2.375 - " ?pier rdfs:label ?pierLabel . "+ 2.376 - " ?pier strdf:hasGeometry ?pierGeo . "+ 2.377 - " FILTER(strdf:distance(?capitalGeo,?pierGeo) < 3.7) "+ 2.378 - "} "+ 2.379 - "} "; 2.380 - 2.381 - protected String query6_real_union = prefixes+ 2.382 - "SELECT ?capital ?pierLabel "+ 2.383 - "WHERE "+ 2.384 - "{ "+ 2.385 - "?country a <http://dbpedia.org/resource/Country> . "+ 2.386 - "?country <http://dbpedia.org/property/capital> ?capital_label . "+ 2.387 - "?capital <http://www.w3.org/2000/01/rdf-schema#label> ?capital_label . "+ 2.388 - "?capitalGeoNames <http://www.w3.org/2002/07/owl#sameAs> ?capital . "+ 2.389 - "?capitalGeoNames strdf:hasGeometry ?capitalGeo . "+ 2.390 - "OPTIONAL "+ 2.391 - "{ "+ 2.392 - " { " + 2.393 - "?pier a <http://linkedgeodata.org/ontology#Pier> . " + 2.394 - "}" + 2.395 - " UNION" + 2.396 - " { " + 2.397 - "?pier a <http://linkedgeodata.org/ontology#Harbour> . " + 2.398 - "}" + 2.399 - " ?pier rdfs:label ?pierLabel . "+ 2.400 - " ?pier strdf:hasGeometry ?pierGeo . "+ 2.401 - " FILTER(strdf:distance(?capitalGeo,?pierGeo) < 3.7) "+ 2.402 - "} "+ 2.403 - "} "; 2.404 - 2.405 - protected String queryNegation = prefixes+ 2.406 - "SELECT ?capital ?pier "+ 2.407 - "WHERE "+ 2.408 - "{ "+ 2.409 - " ?country a <http://dbpedia.org/resource/Country> . "+ 2.410 - " ?country <http://dbpedia.org/property/capital> ?capital_label . "+ 2.411 - " ?capital <http://www.w3.org/2000/01/rdf-schema#label> ?capital_label . "+ 2.412 - " ?capitalGeoNames <http://www.w3.org/2002/07/owl#sameAs> ?capital . "+ 2.413 - " ?capitalGeoNames strdf:hasGeometry ?capitalGeo . "+ 2.414 - "OPTIONAL "+ 2.415 - "{ "+ 2.416 - " ?pier a <http://linkedgeodata.org/ontology#Harbour> . " + 2.417 - " ?pier rdfs:label ?pierLabel . "+ 2.418 - " ?pier strdf:hasGeometry ?pierGeo . "+ 2.419 - " FILTER(strdf:distance(?capitalGeo,?pierGeo) < 3.7) "+ 2.420 - "} . " + 2.421 - "FILTER (!bound(?pier))" + 2.422 - "} "+ 2.423 - ""; 2.424 - 2.425 - //Representative of functionality. If I remove !bound, 3 more results appear 2.426 - protected String queryNegation2 = prefixes+ 2.427 - "SELECT ?s ?pier "+ 2.428 - "WHERE "+ 2.429 - "{ "+ 2.430 - " ?s strdf:hasGeometry ?geo1 . "+ 2.431 - "OPTIONAL "+ 2.432 - "{ "+ 2.433 - " ?pier a <http://linkedgeodata.org/ontology#Harbour> . " + 2.434 - " ?pier rdfs:label ?pierLabel . "+ 2.435 - " ?pier strdf:hasGeometry ?pierGeo . "+ 2.436 - " FILTER(strdf:distance(?geo1,?pierGeo) < 0.6) "+ 2.437 - "} . " + 2.438 - "FILTER (!bound(?pier))" + 2.439 - "} "+ 2.440 - ""; 2.441 - 2.442 - 2.443 - protected String queryNotExists = 2.444 - prefixes+ 2.445 - "SELECT ?capital ?pierLabel "+ 2.446 - "WHERE "+ 2.447 - "{ "+ 2.448 - "?country a <http://dbpedia.org/resource/Country> . "+ 2.449 - "?country <http://dbpedia.org/property/capital> ?capital_label . "+ 2.450 - "?capital <http://www.w3.org/2000/01/rdf-schema#label> ?capital_label . "+ 2.451 - "?capitalGeoNames <http://www.w3.org/2002/07/owl#sameAs> ?capital . "+ 2.452 - "?capitalGeoNames strdf:hasGeometry ?capitalGeo . "+ 2.453 - " ?pier a <http://linkedgeodata.org/ontology#Pier> . " + 2.454 - " ?pier rdfs:label ?pierLabel . "+ 2.455 - " ?pier strdf:hasGeometry ?pierGeo . "+ 2.456 -// " FILTER NOT EXISTS { ?pier rdfs:label \"Kikirikou\". " + 2.457 -// "FILTER(strdf:distance(?capitalGeo,?pierGeo) > 3.7) " + 2.458 - " FILTER NOT EXISTS { ?pier rdfs:label ?label2. FILTER(?label2 != ?pierLabel)" + 2.459 - "}"+ 2.460 - "} "; 2.461 - 2.462 - //TODO At some point I should also add a test where the 3rd argument of strdf:relate is a variable 2.463 - 2.464 - @Test 2.465 - public void testQuery1() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.466 - { 2.467 - strabon.query(query1,strabon.getSailRepoConnection()); 2.468 - 2.469 - } 2.470 - 2.471 - @Test 2.472 - public void testQuery2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.473 - { 2.474 - strabon.query(query2,strabon.getSailRepoConnection()); 2.475 - 2.476 - } 2.477 - 2.478 - @Test 2.479 - public void testQuery3() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.480 - { 2.481 - strabon.query(query3,strabon.getSailRepoConnection()); 2.482 - 2.483 - } 2.484 - 2.485 - @Test 2.486 - public void testQuery4() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.487 - { 2.488 - strabon.query(query4,strabon.getSailRepoConnection()); 2.489 - 2.490 - } 2.491 - 2.492 - @Test 2.493 - public void testQuery5() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.494 - { 2.495 - strabon.query(query5,strabon.getSailRepoConnection()); 2.496 - 2.497 - } 2.498 - 2.499 - @Test 2.500 - public void testQuery6() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.501 - { 2.502 - strabon.query(query6,strabon.getSailRepoConnection()); 2.503 - 2.504 - } 2.505 - 2.506 - @Test 2.507 - public void testQuery7() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.508 - { 2.509 - strabon.query(query7,strabon.getSailRepoConnection()); 2.510 - 2.511 - } 2.512 - 2.513 - @Test 2.514 - public void testQuery8() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.515 - { 2.516 - strabon.query(query8,strabon.getSailRepoConnection()); 2.517 - 2.518 - } 2.519 - 2.520 - @Test 2.521 - public void testQueryBufferVar() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.522 - { 2.523 - strabon.query(queryBufferVar,strabon.getSailRepoConnection()); 2.524 - 2.525 - } 2.526 - 2.527 - @Test 2.528 - public void testQueryBufferConst() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.529 - { 2.530 - strabon.query(queryBufferConst,strabon.getSailRepoConnection()); 2.531 - 2.532 - } 2.533 - 2.534 - @Test 2.535 - public void testQueryBufferConst2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.536 - { 2.537 - strabon.query(queryBufferConst2,strabon.getSailRepoConnection()); 2.538 - 2.539 - } 2.540 - 2.541 - @Test 2.542 - public void testQueryBufferConstInSelect() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.543 - { 2.544 - strabon.query(queryBufferConstInSelect,strabon.getSailRepoConnection()); 2.545 - 2.546 - } 2.547 - 2.548 - @Test 2.549 - public void testQueryBufferSelectFilterA() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.550 - { 2.551 - strabon.query(queryBufferSelectFilterA,strabon.getSailRepoConnection()); 2.552 - 2.553 - } 2.554 - 2.555 - @Test 2.556 - public void testQueryBufferSelectFilterB() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.557 - { 2.558 - strabon.query(queryBufferSelectFilterB,strabon.getSailRepoConnection()); 2.559 - 2.560 - } 2.561 - 2.562 - @Test 2.563 - public void testQueryEnvelopeConvexHull() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.564 - { 2.565 - strabon.query(queryBufferSelectFilterB,strabon.getSailRepoConnection()); 2.566 - 2.567 - } 2.568 - 2.569 - @Test 2.570 - public void testQueryMetrics1() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.571 - { 2.572 - strabon.query(queryMetrics1,strabon.getSailRepoConnection()); 2.573 - 2.574 - } 2.575 - 2.576 - @Test 2.577 - public void testQueryMetricsLightOptimized() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.578 - { 2.579 - strabon.query(queryMetricsLightOptimized,strabon.getSailRepoConnection()); 2.580 - 2.581 - } 2.582 - 2.583 - @Test 2.584 - public void testQueryMetricsAreaMustNotBeOptimized() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.585 - { 2.586 - strabon.query(queryMetricsLightOptimized,strabon.getSailRepoConnection()); 2.587 - 2.588 - } 2.589 - 2.590 - @Test 2.591 - public void testQueryMetricsMathInSelect() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.592 - { 2.593 - strabon.query(queryMetricsMathInSelect,strabon.getSailRepoConnection()); 2.594 - 2.595 - } 2.596 - 2.597 - @Test 2.598 - // MonetDB has not function Dimension 2.599 - abstract public void testQuerySpatialProperties() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException ; 2.600 - 2.601 - @Test 2.602 - // MonetDB has not function Dimension 2.603 - abstract public void testQuerySpatialPropertiesConst() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException ; 2.604 - 2.605 - @Test 2.606 - public void testQueryRelate() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.607 - { 2.608 - strabon.query(queryRelate,strabon.getSailRepoConnection()); 2.609 - 2.610 - } 2.611 - 2.612 - @Test 2.613 - public void testQueryThematicUnion() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.614 - { 2.615 - strabon.query(queryThematicUnion,strabon.getSailRepoConnection()); 2.616 - 2.617 - } 2.618 - 2.619 - @Test 2.620 - public void testQuery6_real() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.621 - { 2.622 - strabon.query(query6_real,strabon.getSailRepoConnection()); 2.623 - 2.624 - } 2.625 - 2.626 - @Test 2.627 - public void testQuery6_real_union() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.628 - { 2.629 - strabon.query(query6_real_union,strabon.getSailRepoConnection()); 2.630 - 2.631 - } 2.632 - @Test 2.633 - public void testQueryNegation() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.634 - { 2.635 - strabon.query(queryNegation,strabon.getSailRepoConnection()); 2.636 - 2.637 - } 2.638 - @Test 2.639 - public void testQueryNegation2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 2.640 - { 2.641 - strabon.query(queryNegation2,strabon.getSailRepoConnection()); 2.642 - 2.643 - } 2.644 - 2.645 -// @Test 2.646 -// public void testPrintDataset() throws MalformedQueryException 2.647 -// { 2.648 -// String query = "SELECT ?s ?p ?o WHERE { ?s ?p ?o }"; 2.649 -// strabon.query(query,strabon.getSailRepoConnection()); 2.650 -// 2.651 -// } 2.652 -}
3.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/HavingTests.java Wed Mar 18 14:03:01 2015 +0200 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,124 +0,0 @@ 3.4 -/** 3.5 - * This Source Code Form is subject to the terms of the Mozilla Public 3.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 3.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 3.8 - * 3.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 3.10 - * 3.11 - * http://www.strabon.di.uoa.gr/ 3.12 - */ 3.13 -package eu.earthobservatory.runtime.generaldb; 3.14 - 3.15 -import java.io.IOException; 3.16 - 3.17 -import org.junit.Test; 3.18 -import org.openrdf.query.MalformedQueryException; 3.19 -import org.openrdf.query.QueryEvaluationException; 3.20 -import org.openrdf.query.TupleQueryResultHandlerException; 3.21 - 3.22 -public class HavingTests { 3.23 - public static Strabon strabon; 3.24 - 3.25 - 3.26 - protected static String jdbcDriver= "org.postgresql.Driver"; 3.27 - protected static String serverName = "localhost"; 3.28 - protected static String username = "postgres"; 3.29 - protected static String password = "postgres"; 3.30 - protected static Integer port = 5432; 3.31 - protected static java.sql.Connection conn = null; 3.32 - protected static String databaseName = null; 3.33 - 3.34 - // @BeforeClass 3.35 - // public abstract static void initialize() throws SQLException, ClassNotFoundException 3.36 - // { 3.37 - // strabon = new Strabon("cco2","postgres","p1r3as", 5432, "localhost", true); 3.38 - // } 3.39 - 3.40 - 3.41 - 3.42 - String prefixes = 3.43 - " PREFIX noa:<http://www.earthobservatory.eu/ontologies/noaOntology.owl#>"+ 3.44 - " PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+ 3.45 - " PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "; 3.46 - 3.47 - 3.48 - 3.49 - 3.50 - String query1Having = prefixes + 3.51 - "SELECT ?burntArea ?baGeo "+ 3.52 - "WHERE { "+ 3.53 - "?burntArea a noa:BurntArea; "+ 3.54 - "strdf:hasGeometry ?baGeo. "+ 3.55 - "?urbanArea a noa:UrbanArea; "+ 3.56 - "strdf:hasGeometry ?uaGeo; "+ 3.57 - "FILTER(strdf:mbbIntersects(?baGeo,?uaGeo)). "+ 3.58 - "} "+ 3.59 - "GROUP BY ?burntArea ?baGeo "+ 3.60 - "HAVING (strdf:area(strdf:union(?uaGeo)) > 8) "; 3.61 - 3.62 - String query2HavingA = prefixes + 3.63 - "SELECT ?burntArea ?baGeo (strdf:extent(?uaGeo) AS ?totalMBB) "+ 3.64 - "WHERE { "+ 3.65 - "?burntArea a noa:BurntArea; "+ 3.66 - "strdf:hasGeometry ?baGeo. "+ 3.67 - "?urbanArea a noa:UrbanArea; "+ 3.68 - "strdf:hasGeometry ?uaGeo; "+ 3.69 - "FILTER(strdf:mbbIntersects(?baGeo,?uaGeo)). "+ 3.70 - "} "+ 3.71 - "GROUP BY ?burntArea ?baGeo "+ 3.72 - "HAVING (strdf:area(strdf:extent(?uaGeo)) > 8) "; 3.73 - 3.74 - String query2HavingB = prefixes + 3.75 - "SELECT ?burntArea ?baGeo (strdf:difference(strdf:extent(?uaGeo),strdf:union(?uaGeo)) AS ?MBBdiff) "+ 3.76 - "WHERE { "+ 3.77 - "?burntArea a noa:BurntArea; "+ 3.78 - "strdf:hasGeometry ?baGeo. "+ 3.79 - "?urbanArea a noa:UrbanArea; "+ 3.80 - "strdf:hasGeometry ?uaGeo; "+ 3.81 - "FILTER(strdf:mbbIntersects(?baGeo,?uaGeo)). "+ 3.82 - "} "+ 3.83 - "GROUP BY ?burntArea ?baGeo "+ 3.84 - "HAVING (strdf:area(strdf:extent(?uaGeo)) > 8) "; 3.85 - 3.86 - String query2HavingC = prefixes + 3.87 - "SELECT ?burntArea (strdf:extent(?uaGeo) AS ?totalMBB) "+ 3.88 - "WHERE { "+ 3.89 - "?burntArea a noa:BurntArea; "+ 3.90 - "strdf:hasGeometry ?baGeo. "+ 3.91 - "?urbanArea a noa:UrbanArea; "+ 3.92 - "strdf:hasGeometry ?uaGeo; "+ 3.93 - "FILTER(strdf:mbbIntersects(?baGeo,?uaGeo)). "+ 3.94 - "} "+ 3.95 - "GROUP BY ?burntArea "+ 3.96 - "HAVING (strdf:area(strdf:extent(?uaGeo)) < 8) "; 3.97 - 3.98 - @Test 3.99 - public void testQuery1Having() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 3.100 - { 3.101 - strabon.query(query1Having,strabon.getSailRepoConnection()); 3.102 - 3.103 - } 3.104 - 3.105 - @Test 3.106 - public void testQuery2HavingA() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 3.107 - { 3.108 - strabon.query(query2HavingA,strabon.getSailRepoConnection()); 3.109 - 3.110 - } 3.111 - 3.112 - @Test 3.113 - public void testQuery2HavingB() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 3.114 - { 3.115 - strabon.query(query2HavingB,strabon.getSailRepoConnection()); 3.116 - 3.117 - } 3.118 - 3.119 - @Test 3.120 - public void testQuery2HavingC() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 3.121 - { 3.122 - strabon.query(query2HavingC,strabon.getSailRepoConnection()); 3.123 - 3.124 - } 3.125 - 3.126 - 3.127 -}
4.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/JoinTests.java Wed Mar 18 14:03:01 2015 +0200 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,207 +0,0 @@ 4.4 -/** 4.5 - * This Source Code Form is subject to the terms of the Mozilla Public 4.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 4.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 4.8 - * 4.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 4.10 - * 4.11 - * http://www.strabon.di.uoa.gr/ 4.12 - */ 4.13 -package eu.earthobservatory.runtime.generaldb; 4.14 - 4.15 -import java.io.IOException; 4.16 - 4.17 -import org.junit.Test; 4.18 -import org.openrdf.query.MalformedQueryException; 4.19 -import org.openrdf.query.QueryEvaluationException; 4.20 -import org.openrdf.query.TupleQueryResultHandlerException; 4.21 - 4.22 -public class JoinTests { 4.23 - 4.24 - public static Strabon strabon; 4.25 - 4.26 - protected static String jdbcDriver= "org.postgresql.Driver"; 4.27 - protected static String serverName = "localhost"; 4.28 - protected static String username = "postgres"; 4.29 - protected static String password = "postgres"; 4.30 - protected static Integer port = 5432; 4.31 - protected static java.sql.Connection conn = null; 4.32 - protected static String databaseName = null; 4.33 - 4.34 - 4.35 -// @BeforeClass 4.36 -// public static void initialize() throws SQLException, ClassNotFoundException 4.37 -// { 4.38 -// strabon = new Strabon("join-tests","postgres","p1r3as", 5432, "localhost", true); 4.39 -// 4.40 -// } 4.41 - 4.42 - 4.43 - 4.44 - String query5a = 4.45 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 4.46 - "SELECT ?sensor ?place WHERE "+ 4.47 - "{"+ 4.48 - "?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 4.49 - "?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 4.50 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 4.51 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 4.52 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 4.53 - "?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 4.54 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 4.55 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 4.56 - "?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 4.57 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?areaGeo) && strdf:mbbIntersects(?sensorsGeo,?placeGeo)) . "+ 4.58 - "}"; 4.59 - 4.60 - String query5b = 4.61 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 4.62 - "SELECT ?sensor ?place WHERE "+ 4.63 - "{ "+ 4.64 - "?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 4.65 - "?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 4.66 - "?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 4.67 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 4.68 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 4.69 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 4.70 - "?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 4.71 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 4.72 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 4.73 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?areaGeo)) . "+ 4.74 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?placeGeo)). }"; 4.75 - 4.76 - String query5c = 4.77 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 4.78 - "SELECT ?sensor ?place WHERE "+ 4.79 - "{ "+ 4.80 - "?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 4.81 - "?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 4.82 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 4.83 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 4.84 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 4.85 - "?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 4.86 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 4.87 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 4.88 - "?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 4.89 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?areaGeo)) . "+ 4.90 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?placeGeo)). }"; 4.91 - 4.92 - String query9a = 4.93 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> " + 4.94 - "SELECT ?populatedArea ?sensor ?portArea " + 4.95 - "WHERE " + 4.96 - "{ " + 4.97 - "?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . " + 4.98 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . " + 4.99 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . " + 4.100 - " ?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . " + 4.101 - " ?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . " + 4.102 - " ?portArea <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasLandUse> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#portAreas> . " + 4.103 - " ?portArea a <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#Area> . " + 4.104 - " ?portArea <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeometry> ?seaGeo . " + 4.105 - " ?populatedArea <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/PopulatedPlace> . " + 4.106 - " ?populatedAreaGeoNames <http://www.w3.org/2002/07/owl#sameAs> ?populatedArea . " + 4.107 - " ?populatedAreaGeoNames <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . " + 4.108 - " FILTER( strdf:mbbIntersects(?areaGeo,?sensorsGeo) ) . " + 4.109 - " FILTER( strdf:mbbIntersects(?seaGeo,?sensorsGeo) ) . " + 4.110 - "}"; 4.111 - 4.112 - String query3way = 4.113 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 4.114 - "SELECT ?sensor ?place WHERE "+ 4.115 - "{ "+ 4.116 - "?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 4.117 - "?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 4.118 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 4.119 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 4.120 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 4.121 - "?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 4.122 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 4.123 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 4.124 - "?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 4.125 - "FILTER(strdf:mbbIntersects(?sensorsGeo,strdf:union(?areaGeo,?placeGeo)) " + 4.126 - "&& strdf:mbbIntersects(?sensorsGeo,?placeGeo) && ?place = ?spaceRegion) . "+ 4.127 - "}"; 4.128 - 4.129 - String query5_3filters = 4.130 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 4.131 - "SELECT ?sensor ?place WHERE "+ 4.132 - "{ "+ 4.133 - " ?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 4.134 - " ?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 4.135 - " ?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 4.136 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 4.137 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 4.138 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 4.139 - " ?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 4.140 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 4.141 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 4.142 - " FILTER(strdf:mbbIntersects(?sensorsGeo,?areaGeo)) . "+ 4.143 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?placeGeo)). "+ 4.144 - " FILTER(strdf:mbbIntersects(?areaGeo,?placeGeo)).}"; 4.145 - 4.146 - String query5_properties = 4.147 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 4.148 - "SELECT ?sensor ?place WHERE "+ 4.149 - "{ "+ 4.150 - " ?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 4.151 - " ?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 4.152 - " ?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 4.153 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 4.154 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 4.155 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 4.156 - " ?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 4.157 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 4.158 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 4.159 - " FILTER(strdf:mbbIntersects(?sensorsGeo,?areaGeo)) . "+ 4.160 - "FILTER(strdf:dimension(?sensorsGeo) = strdf:dimension(?placeGeo)). }"; 4.161 - 4.162 - @Test 4.163 - public void testQuery5a() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.164 - { 4.165 - strabon.query(query5a,strabon.getSailRepoConnection()); 4.166 - 4.167 - } 4.168 - 4.169 - @Test 4.170 - public void testQuery5b() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.171 - { 4.172 - strabon.query(query5b,strabon.getSailRepoConnection()); 4.173 - 4.174 - } 4.175 - 4.176 - @Test 4.177 - public void testQuery5c() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.178 - { 4.179 - strabon.query(query5c,strabon.getSailRepoConnection()); 4.180 - 4.181 - } 4.182 - 4.183 - @Test 4.184 - public void testQuery9a() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.185 - { 4.186 - strabon.query(query9a,strabon.getSailRepoConnection()); 4.187 - 4.188 - } 4.189 - 4.190 - @Test 4.191 - public void testQuery3way() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.192 - { 4.193 - strabon.query(query3way,strabon.getSailRepoConnection()); 4.194 - 4.195 - } 4.196 - 4.197 - @Test 4.198 - public void testQuery5_3filters() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.199 - { 4.200 - strabon.query(query5_3filters,strabon.getSailRepoConnection()); 4.201 - 4.202 - } 4.203 - 4.204 - @Test 4.205 - public void testQuery5_properties() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.206 - { 4.207 - strabon.query(query5_properties,strabon.getSailRepoConnection()); 4.208 - 4.209 - } 4.210 -}
5.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/MeaningfulAggregateTests.java Wed Mar 18 14:03:01 2015 +0200 5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 5.3 @@ -1,193 +0,0 @@ 5.4 -/** 5.5 - * This Source Code Form is subject to the terms of the Mozilla Public 5.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 5.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 5.8 - * 5.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 5.10 - * 5.11 - * http://www.strabon.di.uoa.gr/ 5.12 - */ 5.13 -package eu.earthobservatory.runtime.generaldb; 5.14 - 5.15 -import java.io.IOException; 5.16 - 5.17 -import org.junit.Test; 5.18 -import org.openrdf.query.MalformedQueryException; 5.19 -import org.openrdf.query.QueryEvaluationException; 5.20 -import org.openrdf.query.TupleQueryResultHandlerException; 5.21 - 5.22 -public class MeaningfulAggregateTests { 5.23 - public static Strabon strabon; 5.24 - 5.25 - protected static String jdbcDriver= "org.postgresql.Driver"; 5.26 - protected static String serverName = "localhost"; 5.27 - protected static String username = "postgres"; 5.28 - protected static String password = "postgres"; 5.29 - protected static Integer port = 5432; 5.30 - protected static java.sql.Connection conn = null; 5.31 - protected static String databaseName = null; 5.32 - 5.33 - 5.34 -// @BeforeClass 5.35 -// public abstract static void initialize() throws SQLException, ClassNotFoundException 5.36 -// { 5.37 -// strabon = new Strabon("cco2","postgres","p1r3as", 5432, "localhost", true); 5.38 -// } 5.39 - 5.40 - 5.41 - 5.42 - String prefixes = 5.43 - " PREFIX noa:<http://www.earthobservatory.eu/ontologies/noaOntology.owl#>"+ 5.44 - " PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+ 5.45 - " PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "; 5.46 - 5.47 - 5.48 - /** 5.49 - * May seem like this query has a spatial dimension, 5.50 - * but since the spatial literal is not involved in any 5.51 - * spatial operations, it is evaluated as a plain literal 5.52 - */ 5.53 - String query1NotSpatial = prefixes + 5.54 - "SELECT ( COUNT(?hotspot) AS ?count) ?geo "+ 5.55 - "WHERE " + 5.56 - "{ " + 5.57 - " ?hotspot a noa:Hotspot;" + 5.58 - " strdf:hasGeometry ?geo. " + 5.59 - "}"+ 5.60 - "GROUP BY ?geo"; 5.61 - 5.62 - /** 5.63 - * Current results: 6 - 4 - 2 5.64 - */ 5.65 - String query1Spatial = prefixes + 5.66 - "SELECT ( COUNT(?hotspot) AS ?count) ?geo "+ 5.67 - "WHERE " + 5.68 - "{ " + 5.69 - " ?hotspot a noa:Hotspot;" + 5.70 - " strdf:hasGeometry ?geo. " + 5.71 - " ?urbanArea a noa:UrbanArea; " + 5.72 - " strdf:hasGeometry ?uaGeo."+ 5.73 - " FILTER(strdf:disjoint(?geo,?uaGeo)) "+ 5.74 - "}"+ 5.75 - "GROUP BY ?geo"; 5.76 - 5.77 - 5.78 - /** 5.79 - * Functionality seems ok 5.80 - */ 5.81 - String query2simple = prefixes + 5.82 - "SELECT ?burntArea ?baGeo " + 5.83 - "(strdf:union(?uaGeo) AS ?urban) "+ 5.84 - "WHERE { " + 5.85 - " ?burntArea a noa:BurntArea; " + 5.86 - " strdf:hasGeometry ?baGeo. " + 5.87 - " ?urbanArea a noa:UrbanArea; " + 5.88 - " strdf:hasGeometry ?uaGeo. " + 5.89 - " FILTER(strdf:mbbIntersects(?baGeo,?uaGeo))" + 5.90 - " } " + 5.91 - " GROUP BY ?burntArea ?baGeo "+ 5.92 - " "; 5.93 - 5.94 - String query2complexA = prefixes + 5.95 - "SELECT ?burntArea " + 5.96 -// "?baGeo " + 5.97 - "(strdf:difference(?baGeo, strdf:union(?uaGeo)) AS ?urbanPiece) "+ 5.98 - " WHERE { " + 5.99 - " ?burntArea a noa:BurntArea; " + 5.100 - " strdf:hasGeometry ?baGeo. " + 5.101 - " ?urbanArea a noa:UrbanArea; " + 5.102 - " strdf:hasGeometry ?uaGeo. " + 5.103 - " FILTER(strdf:mbbIntersects(?baGeo,?uaGeo))" + 5.104 - " } " + 5.105 - " GROUP BY ?burntArea" + 5.106 -// " ?baGeo "+ 5.107 - " "; 5.108 - 5.109 - String query2complexB = prefixes + 5.110 - "SELECT ?burntArea ?baGeo " + 5.111 - "(strdf:difference(strdf:union(?uaGeo) , ?baGeo) AS ?urbanPiece) "+ 5.112 - " WHERE { " + 5.113 - " ?burntArea a noa:BurntArea; " + 5.114 - " strdf:hasGeometry ?baGeo. " + 5.115 - " ?urbanArea a noa:UrbanArea; " + 5.116 - " strdf:hasGeometry ?uaGeo. " + 5.117 - " FILTER(strdf:mbbIntersects(?baGeo,?uaGeo))" + 5.118 - " } " + 5.119 - " GROUP BY ?burntArea ?baGeo "+ 5.120 - " "; 5.121 - 5.122 - String query2complexC = prefixes + 5.123 - "SELECT ?burntArea ?baGeo " + 5.124 - "(strdf:buffer(strdf:union(?uaGeo) , 5) AS ?urbanPiece) "+ 5.125 - " WHERE { " + 5.126 - " ?burntArea a noa:BurntArea; " + 5.127 - " strdf:hasGeometry ?baGeo. " + 5.128 - " ?urbanArea a noa:UrbanArea; " + 5.129 - " strdf:hasGeometry ?uaGeo. " + 5.130 - " FILTER(strdf:mbbIntersects(?baGeo,?uaGeo))" + 5.131 - " } " + 5.132 - " GROUP BY ?burntArea ?baGeo "+ 5.133 - " "; 5.134 - 5.135 - String query2complexD = prefixes + 5.136 - "SELECT " + 5.137 - " ?burntArea " + 5.138 -// " ?baGeo " + 5.139 -// " (strdf:union(?uaGeo) AS ?urban) " + 5.140 - " (COUNT(?uaGeo) AS ?urbanNo) "+ 5.141 - "WHERE { " + 5.142 - " ?burntArea a noa:BurntArea; " + 5.143 - " strdf:hasGeometry ?baGeo. " + 5.144 - " ?urbanArea a noa:UrbanArea; " + 5.145 - " strdf:hasGeometry ?uaGeo. " + 5.146 - " FILTER(strdf:mbbIntersects(?baGeo,?uaGeo))" + 5.147 - " } " + 5.148 - " GROUP BY ?burntArea ?baGeo "+ 5.149 - " HAVING (COUNT(?uaGeo) > 1 )"+ 5.150 - " " 5.151 - ; 5.152 - 5.153 - @Test 5.154 - public void testQuery1NotSpatial() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.155 - { 5.156 - strabon.query(query1NotSpatial,strabon.getSailRepoConnection()); 5.157 - 5.158 - } 5.159 - @Test 5.160 - public void testQuery1Spatial() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.161 - { 5.162 - strabon.query(query1Spatial,strabon.getSailRepoConnection()); 5.163 - 5.164 - } 5.165 - @Test 5.166 - public void testQuery2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.167 - { 5.168 - strabon.query(query2simple,strabon.getSailRepoConnection()); 5.169 - 5.170 - } 5.171 - @Test 5.172 - public void testQuery2complexA() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.173 - { 5.174 - strabon.query(query2complexA,strabon.getSailRepoConnection()); 5.175 - 5.176 - } 5.177 - @Test 5.178 - public void testQuery2complexB() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.179 - { 5.180 - strabon.query(query2complexB,strabon.getSailRepoConnection()); 5.181 - 5.182 - } 5.183 - @Test 5.184 - public void testQuery2complexC() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.185 - { 5.186 - strabon.query(query2complexC,strabon.getSailRepoConnection()); 5.187 - 5.188 - } 5.189 - @Test 5.190 - public void testQuery2complexD() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.191 - { 5.192 - strabon.query(query2complexD,strabon.getSailRepoConnection()); 5.193 - 5.194 - } 5.195 - 5.196 -}
6.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/NOATests.java Wed Mar 18 14:03:01 2015 +0200 6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 6.3 @@ -1,167 +0,0 @@ 6.4 -/** 6.5 - * This Source Code Form is subject to the terms of the Mozilla Public 6.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 6.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 6.8 - * 6.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 6.10 - * 6.11 - * http://www.strabon.di.uoa.gr/ 6.12 - */ 6.13 -package eu.earthobservatory.runtime.generaldb; 6.14 - 6.15 -import java.io.IOException; 6.16 - 6.17 -import org.junit.Test; 6.18 -import org.openrdf.query.MalformedQueryException; 6.19 -import org.openrdf.query.QueryEvaluationException; 6.20 -import org.openrdf.query.TupleQueryResultHandlerException; 6.21 - 6.22 -public class NOATests { 6.23 - public static Strabon strabon; 6.24 - 6.25 - 6.26 - protected static String jdbcDriver= "org.postgresql.Driver"; 6.27 - protected static String serverName = "localhost"; 6.28 - protected static String username = "postgres"; 6.29 - protected static String password = "postgres"; 6.30 - protected static Integer port = 5432; 6.31 - protected static java.sql.Connection conn = null; 6.32 - protected static String databaseName = null; 6.33 - 6.34 - 6.35 - 6.36 - String prefixes = 6.37 - "PREFIX imAn: <http://teleios.di.uoa.gr/ontologies/imageAnnotationOntology.owl#> "+ 6.38 - "PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> "+ 6.39 - "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "+ 6.40 - "PREFIX eolo:<http://www.dlr.de/ontologies/EOLO.owl#> "+ 6.41 - "PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> "+ 6.42 - "PREFIX base: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> "+ 6.43 - "PREFIX ex: <http://www.example.org/ontology#> "+ 6.44 - "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> "; 6.45 - 6.46 - String query1 = prefixes+ 6.47 - "SELECT ?FILENAME { "+ 6.48 - "?COLLECTION rdf:type imAn:NOA-UC . "+ 6.49 - "?FILE noa:belongToCollection ?COLLECTION . "+ 6.50 - "?FILE noa:hasFilename ?FILENAME .}"; 6.51 - 6.52 - String query2 = prefixes+ 6.53 - "SELECT ?FILENAME { "+ 6.54 - "?COLLECTION rdf:type imAn:NOA-UC . "+ 6.55 - "?FILE noa:belongToCollection ?COLLECTION . "+ 6.56 - "?FILE noa:hasFilename ?FILENAME . "+ 6.57 - "?COLLECTION eolo:hasProcessingLevel eolo:L1 . "+ 6.58 - "?COLLECTION eolo:hasResolution eolo:LowResolution .}"; 6.59 - 6.60 - String query3 = prefixes+ 6.61 - "SELECT ?FILENAME "+ 6.62 - "WHERE { ?FILE rdf:type noa:ShpFile . "+ 6.63 - "?FILE noa:hasFilename ?FILENAME . "+ 6.64 - "?FILE noa:hasAcquisitionTime ?SENSING_TIME . "+ 6.65 - "FILTER( str(?SENSING_TIME) > \"2010-08-21T20:00:00\" ) . "+ 6.66 - "FILTER( str(?SENSING_TIME) < \"2010-08-21T20:30:00\" ) . "+ 6.67 - "?FILE noa:isDerivedFromSensor ?SENSOR . "+ 6.68 - "FILTER( str(?SENSOR) = \"MSG1_RSS\" ) . }"; 6.69 - 6.70 - 6.71 - protected String query4 = prefixes+ 6.72 - "SELECT DISTINCT ?H1 ?HGEO1 ?CONFIRMATION1 ?SATTELITE1 ?HCONF1 ?PC1 "+ 6.73 - "WHERE { "+ 6.74 - "?H1 rdf:type noa:Hotspot . "+ 6.75 - "?H1 noa:hasConfidence ?HCONF1 . "+ 6.76 - "?H1 noa:hasGeometry ?HGEO1 . "+ 6.77 - "?H1 noa:hasAcquisitionTime ?HAT1 . "+ 6.78 - "?H1 noa:isDerivedFromSensor ?SENSOR1 . "+ 6.79 - "?H1 noa:isDerivedFromSatellite ?SATTELITE1 . "+ 6.80 - "?H1 noa:producedFromProcessingChain ?PC1 . "+ 6.81 - "?H1 noa:hasConfirmation ?CONFIRMATION1 . "+ 6.82 - "FILTER( \"2010-08-22T15:35:00\" < str(?HAT1) " + 6.83 - "&& str(?HAT1) < \"2010-08-22T16:10:00\" && str(?SENSOR1) = \"MSG1_RSS\" && str(?PC1) = \"plain\" ) . "+ 6.84 - "OPTIONAL { "+ 6.85 - "?H2 rdf:type noa:Hotspot . "+ 6.86 - "?H2 noa:hasGeometry ?HGEO2 . "+ 6.87 - "?H2 noa:hasAcquisitionTime ?HAT2 . "+ 6.88 - "?H2 noa:isDerivedFromSensor ?SENSOR2 . "+ 6.89 - "?H2 noa:producedFromProcessingChain ?PC2 . "+ 6.90 - "FILTER( strdf:equals(?HGEO1 , ?HGEO2) ) . "+ 6.91 - "FILTER( str(?HAT2) = \"2010-08-22T16:10:00\" && str(?SENSOR2) = \"MSG1_RSS\" " + 6.92 - "&& str(?PC2) = \"plain\" ) . "+ 6.93 - "} . "+ 6.94 - "FILTER (!bound(?H2)) .} "; 6.95 - 6.96 - String query5 = prefixes+ 6.97 - "SELECT DISTINCT ?H "+ 6.98 - "WHERE { "+ 6.99 - "?H rdf:type noa:Hotspot . "+ 6.100 - "?H noa:hasGeometry ?HGEO . "+ 6.101 - "?H noa:isDerivedFromSensor ?HS . "+ 6.102 - "FILTER( str(?HS) = \"MSG2\" ) . "+ 6.103 - "?H noa:hasAcquisitionTime ?HAT . "+ 6.104 - "FILTER(str(?HAT) = \"2007-08-24T12:45:00\") . "+ 6.105 - "OPTIONAL { "+ 6.106 - "?C rdf:type noa:Coastline . "+ 6.107 - "?C noa:hasGeometry ?CGEO . "+ 6.108 - "filter ( strdf:mbbIntersects(?HGEO , ?CGEO) ) . "+ 6.109 - "} FILTER( !bound(?C) ) "+ 6.110 - "}"; 6.111 - 6.112 - protected String query6 = prefixes+ 6.113 - "SELECT ?H (strdf:intersection(?HGEO, ?CGEO) AS ?REFINEDGEO) "+ 6.114 - "WHERE { "+ 6.115 - "?H rdf:type noa:Hotspot . "+ 6.116 - "?H noa:hasGeometry ?HGEO . "+ 6.117 - "?H noa:isDerivedFromSensor ?HS . "+ 6.118 - "FILTER( str(?HS) = \"MSG2\" ) . "+ 6.119 - "?H noa:hasAcquisitionTime ?HAT . "+ 6.120 - "FILTER(str(?HAT) = \"2007-08-24T12:45:00\") . "+ 6.121 - "?C rdf:type noa:Coastline . "+ 6.122 - "?C noa:hasGeometry ?CGEO . "+ 6.123 - "FILTER( strdf:overlap(?HGEO,?CGEO) ) . "+ 6.124 - "} ORDER BY ?H "; 6.125 - 6.126 - protected String query7 = prefixes+ 6.127 - //"SELECT ?H (strdf:intersection(?HGEO, ?CGEO) AS ?REFINEDGEO) "+ 6.128 - "INSERT {?H noa:hasGeometry (strdf:intersection(?HGEO, ?CGEO) AS ?REFINEDGEO)} \n"+ 6.129 - "WHERE { "+ 6.130 - "?H rdf:type noa:Hotspot . "+ 6.131 - "?H noa:hasGeometry ?HGEO . "+ 6.132 - "?H noa:isDerivedFromSensor ?HS . "+ 6.133 - "FILTER( str(?HS) = \"MSG2\" ) . "+ 6.134 - "?H noa:hasAcquisitionTime ?HAT . "+ 6.135 - "FILTER(str(?HAT) = \"2007-08-24T12:45:00\") . "+ 6.136 - "?C rdf:type noa:Coastline . "+ 6.137 - "?C noa:hasGeometry ?CGEO . "+ 6.138 - "FILTER( strdf:overlap(?HGEO,?CGEO) ) . "+ 6.139 - "} "; 6.140 - 6.141 - 6.142 - @Test 6.143 - public void testQuery1() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 6.144 - { 6.145 - strabon.query(query1,strabon.getSailRepoConnection()); 6.146 - 6.147 - } 6.148 - 6.149 - @Test 6.150 - public void testQuery2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 6.151 - { 6.152 - strabon.query(query2,strabon.getSailRepoConnection()); 6.153 - 6.154 - } 6.155 - 6.156 - @Test 6.157 - public void testQuery3() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 6.158 - { 6.159 - strabon.query(query3,strabon.getSailRepoConnection()); 6.160 - 6.161 - } 6.162 - 6.163 - @Test 6.164 - public void testQuery7() throws MalformedQueryException 6.165 - { 6.166 - strabon.update(query7,strabon.getSailRepoConnection()); 6.167 - 6.168 - } 6.169 - 6.170 -}
7.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SPARQL11Tests.java Wed Mar 18 14:03:01 2015 +0200 7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 7.3 @@ -1,356 +0,0 @@ 7.4 -/** 7.5 - * This Source Code Form is subject to the terms of the Mozilla Public 7.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 7.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 7.8 - * 7.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 7.10 - * 7.11 - * http://www.strabon.di.uoa.gr/ 7.12 - */ 7.13 -package eu.earthobservatory.runtime.generaldb; 7.14 - 7.15 -import static org.junit.Assert.assertEquals; 7.16 -import static org.junit.Assert.assertTrue; 7.17 - 7.18 -import java.io.IOException; 7.19 -import java.util.ArrayList; 7.20 - 7.21 -import org.junit.BeforeClass; 7.22 -import org.junit.Test; 7.23 -import org.openrdf.model.vocabulary.RDF; 7.24 -import org.openrdf.model.vocabulary.XMLSchema; 7.25 -import org.openrdf.query.MalformedQueryException; 7.26 -import org.openrdf.query.QueryEvaluationException; 7.27 -import org.openrdf.query.TupleQueryResultHandlerException; 7.28 -import org.openrdf.repository.RepositoryException; 7.29 - 7.30 -public class SPARQL11Tests { 7.31 - public static Strabon strabon; 7.32 - 7.33 - public String FOAF_NS = "http://xmlns.com/foaf/0.1/", 7.34 - DT_NS = "http://example.org/datatype#", 7.35 - NS_NS = "http://example.org/ns#", 7.36 - DEF_NS = "http://example.org#", 7.37 - ORG_NS = "http://example.com/org#", 7.38 - DC_NS = "http://purl.org/dc/elements/1.1/", 7.39 - DC10_NS = "http://purl.org/dc/elements/1.0/", 7.40 - DC11_NS = "http://purl.org/dc/elements/1.1/"; 7.41 - 7.42 - protected String prefixes = 7.43 - "PREFIX rdf: <"+RDF.NAMESPACE+"> \n" + 7.44 - "PREFIX xsd: <"+XMLSchema.NAMESPACE+"> \n" + 7.45 - "PREFIX foaf: <"+FOAF_NS+"> \n" + 7.46 - "PREFIX dt: <"+DT_NS+"> "+ 7.47 - "PREFIX ns: <"+NS_NS+"> \n" + 7.48 - "PREFIX def: <"+DEF_NS+"> \n" + 7.49 - "PREFIX org: <"+ORG_NS+"> \n" + 7.50 - "PREFIX dc: <"+DC_NS+"> \n" + 7.51 - "PREFIX dc10: <"+DC10_NS+"> \n" + 7.52 - "PREFIX dc11: <"+DC11_NS+"> \n"; 7.53 - 7.54 -// @BeforeClass 7.55 -// public static void initialize() throws Exception 7.56 -// { 7.57 -// strabon = new eu.earthobservatory.runtime.postgis.Strabon("test", "postgres", "postgres", 5432, "localhost", true); 7.58 -// 7.59 -// } 7.60 - 7.61 - @Test 7.62 - public void testRetrieveEveryEntry() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.63 - { 7.64 - String queryString = prefixes+ 7.65 - "SELECT ?s ?p ?o \n" + 7.66 - "WHERE \n" + 7.67 - "{ ?s ?p ?o . } \n"; 7.68 - 7.69 - @SuppressWarnings("unchecked") 7.70 - ArrayList<String> results = (ArrayList <String>)strabon.query(queryString, strabon.getSailRepoConnection()); 7.71 - assertEquals(62, results.size()); 7.72 - } 7.73 - 7.74 - @Test 7.75 - public void testMultipleMatches() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.76 - { 7.77 - String queryString = prefixes+ 7.78 - "SELECT DISTINCT ?name ?mbox \n" + 7.79 - "WHERE \n" + 7.80 - "{ ?x foaf:name ?name . \n" + 7.81 - " ?x foaf:mbox ?mbox ." + 7.82 - " } \n"; 7.83 - 7.84 - @SuppressWarnings("unchecked") 7.85 - ArrayList<String> results = (ArrayList <String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.86 - assertEquals(11, results.size()); 7.87 - } 7.88 - 7.89 - @Test 7.90 - public void testMatchingLiterals() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.91 - { 7.92 - String queryString = prefixes+ 7.93 - "SELECT ?v WHERE { ?v ns:p ?s . FILTER(str(?s) = \"cat\") } \n"; 7.94 -// "SELECT ?v WHERE { ?v ns:p \"cat\" } \n"; 7.95 - 7.96 - @SuppressWarnings("unchecked") 7.97 - ArrayList<String> results = (ArrayList <String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.98 - assertEquals(1, results.size()); 7.99 - assertTrue(-1<results.indexOf("[v=http://example.org#x]")); 7.100 - } 7.101 - 7.102 - @Test 7.103 - public void testMatchingLiteralsWithLanguage() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.104 - { 7.105 - String queryString = prefixes+ 7.106 - "SELECT ?v WHERE { ?v ns:p \"cat\"@en } \n"; 7.107 - 7.108 - @SuppressWarnings("unchecked") 7.109 - ArrayList<String> results = (ArrayList <String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.110 - assertEquals(1, results.size()); 7.111 - assertTrue(-1<results.indexOf("[v=http://example.org#x]")); 7.112 - } 7.113 - 7.114 - @Test 7.115 - public void testMatchingLiteralsWithNumericTypes() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.116 - { 7.117 - String queryString = prefixes+ 7.118 - "SELECT ?v WHERE { ?v ns:p 42 } \n"; 7.119 - 7.120 - @SuppressWarnings("unchecked") 7.121 - ArrayList<String> results = (ArrayList <String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.122 - assertEquals(1, results.size()); 7.123 - assertTrue(-1<results.indexOf("[v=http://example.org#y]")); 7.124 - } 7.125 - 7.126 - @Test 7.127 - public void testMatchingLiteralWithArbitraryTypes() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.128 - { 7.129 - String queryString = prefixes+ 7.130 - "SELECT ?v WHERE { ?v ?p \"abc\"^^dt:specialDatatype } \n"; 7.131 - 7.132 - @SuppressWarnings("unchecked") 7.133 - ArrayList<String> results = (ArrayList <String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.134 - assertEquals(1, results.size()); 7.135 - assertTrue(-1<results.indexOf("[v=http://example.org#z]")); 7.136 - } 7.137 - 7.138 - @Test 7.139 - public void testBind() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.140 - { 7.141 - String queryString = prefixes+ 7.142 - "SELECT ?name \n" + 7.143 - "WHERE { \n" + 7.144 - " ?P foaf:givenName ?G . \n" + 7.145 - " ?P foaf:surname ?S . \n" + 7.146 - " BIND( CONCAT(?G, \" \", ?S) AS ?name ) . \n"+ 7.147 - "} \n"; 7.148 - 7.149 - @SuppressWarnings("unchecked") 7.150 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.151 - assertEquals(1, results.size()); 7.152 - assertTrue(-1<results.indexOf("[name=\"John Doe\"]")); 7.153 - } 7.154 - 7.155 - 7.156 - @Test 7.157 - public void testConcat() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.158 - { 7.159 - String queryString = prefixes+ 7.160 - "SELECT ( CONCAT(?G, \" \", ?S) AS ?name ) \n" + 7.161 - "WHERE { ?P foaf:givenName ?G ; foaf:surname ?S } \n"; 7.162 - 7.163 - @SuppressWarnings("unchecked") 7.164 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.165 - assertEquals(1, results.size()); 7.166 - assertTrue(-1<results.indexOf("[name=\"John Doe\"]")); 7.167 - } 7.168 - 7.169 - @Test 7.170 - public void testOptional() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.171 - { 7.172 - String queryString = prefixes+ 7.173 - "SELECT ?name ?mbox \n"+ 7.174 - "WHERE { ?x foaf:name ?name . \n"+ 7.175 - " OPTIONAL { ?x foaf:mbox ?mbox } \n"+ 7.176 - "} \n"; 7.177 - 7.178 - @SuppressWarnings("unchecked") 7.179 - ArrayList<String> results = (ArrayList<String>)strabon.query(queryString, strabon.getSailRepoConnection()); 7.180 - assertEquals(13, results.size()); 7.181 - assertTrue(-1<results.indexOf("[name=\"Alice\";mbox=mailto:alice@example.com]")); 7.182 - assertTrue(-1<results.indexOf("[name=\"Alice\";mbox=mailto:alice@work.example]")); 7.183 - assertTrue(-1<results.indexOf("[name=\"Carol Baz\"]")); 7.184 - } 7.185 - 7.186 - @Test 7.187 - public void testOptionalFilter() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.188 - { 7.189 - String queryString = prefixes+ 7.190 - "SELECT ?title ?price \n"+ 7.191 - "WHERE { ?x dc:title ?title . \n"+ 7.192 - " OPTIONAL { ?x ns:price ?price . FILTER (?price < 30) } \n"+ 7.193 - "}\n"; 7.194 - 7.195 - @SuppressWarnings("unchecked") 7.196 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.197 - assertEquals(4, results.size()); 7.198 - assertTrue(-1<results.indexOf("[title=\"SPARQL Tutorial\"]")); 7.199 - assertTrue(-1<results.indexOf("[title=\"SPARQL Protocol Tutorial\"]")); 7.200 - assertTrue(-1<results.indexOf("[title=\"SPARQL (updated)\"]")); 7.201 - assertTrue(-1<results.indexOf("[title=\"The Semantic Web\";price=\"23\"^^<http://www.w3.org/2001/XMLSchema#integer>]")); 7.202 - } 7.203 - 7.204 - @Test 7.205 - public void testTwoOptionals() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.206 - { 7.207 - String queryString = prefixes+ 7.208 - "SELECT ?name ?mbox ?hpage \n"+ 7.209 - "WHERE { ?x foaf:name ?name \n"+ 7.210 - " OPTIONAL { ?x foaf:mbox ?mbox } . \n"+ 7.211 - " OPTIONAL { ?x foaf:homepage ?hpage } . \n"+ 7.212 - "} ORDER BY ?name \n"; 7.213 - 7.214 - @SuppressWarnings("unchecked") 7.215 - ArrayList<String> results = (ArrayList<String>)strabon.query(queryString, strabon.getSailRepoConnection()); 7.216 - 7.217 - assertEquals(13, results.size()); 7.218 - assertTrue(-1<results.indexOf("[hpage=http://work.example.org/alice/;name=\"A. Foo\";mbox=mailto:alice@example.com]")); 7.219 - assertTrue(-1<results.indexOf("[name=\"Bob\";mbox=mailto:bob@work.example]")); 7.220 - assertTrue(-1<results.indexOf("[name=\"C. Baz\"]")); 7.221 - } 7.222 - 7.223 - 7.224 - @Test 7.225 - public void testFilterNotExists() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.226 - { 7.227 - String queryString = prefixes+ 7.228 - "SELECT ?person \n"+ 7.229 - "WHERE { \n"+ 7.230 - " ?person rdf:type foaf:Person . \n"+ 7.231 - " FILTER NOT EXISTS { ?person foaf:name ?name } . \n"+ 7.232 - "} \n"; 7.233 - 7.234 - @SuppressWarnings("unchecked") 7.235 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.236 - assertEquals(0, results.size()); // TODO add such an item 7.237 - } 7.238 - 7.239 - @Test 7.240 - public void testFilterExists() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.241 - { 7.242 - String queryString = prefixes+ 7.243 - "SELECT ?person \n"+ 7.244 - "WHERE { \n"+ 7.245 - " ?person rdf:type foaf:Person . \n"+ 7.246 - " FILTER EXISTS { ?person foaf:name ?name } \n"+ 7.247 - "} \n"; 7.248 - 7.249 - @SuppressWarnings("unchecked") 7.250 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.251 - assertEquals(2, results.size()); 7.252 - assertTrue(-1<results.indexOf("[person=http://example.org#bob]")); 7.253 - assertTrue(-1<results.indexOf("[person=http://example.org#alice]")); 7.254 - } 7.255 - 7.256 - @Test 7.257 - public void testMinus() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.258 - { 7.259 - String queryString = prefixes+ 7.260 - "SELECT DISTINCT ?s \n"+ 7.261 - "WHERE { \n"+ 7.262 - " ?s ?p ?o . \n"+ 7.263 - "MINUS { \n"+ 7.264 - " ?s foaf:givenName \"Bob\" . \n"+ 7.265 - "} } \n"; 7.266 - 7.267 - @SuppressWarnings("unchecked") 7.268 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.269 - assertEquals(19, results.size()); 7.270 - } 7.271 - 7.272 - @Test 7.273 - public void testQuerySumGroupByHaving() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.274 - { 7.275 - String queryString = prefixes+ 7.276 - "SELECT (SUM(?lprice) AS ?totalPrice) \n"+ 7.277 - "WHERE { \n"+ 7.278 - " ?org def:affiliates ?auth . \n"+ 7.279 - " ?auth def:writesBook ?book . \n"+ 7.280 - " ?book def:price ?lprice . \n"+ 7.281 - "} \n" 7.282 - +"GROUP BY ?org HAVING (SUM(?lprice) > 10) \n" 7.283 - ; 7.284 - 7.285 - @SuppressWarnings("unchecked") 7.286 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.287 - assertEquals(1, results.size()); 7.288 - assertTrue(-1<results.indexOf("[totalPrice=\"21\"^^<http://www.w3.org/2001/XMLSchema#integer>]")); 7.289 - } 7.290 - 7.291 - @Test 7.292 - public void testRegex() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.293 - { 7.294 - String queryString = prefixes+ 7.295 - "SELECT ?title \n"+ 7.296 - "WHERE { ?x dc:title ?title \n"+ 7.297 - " FILTER regex(?title, \"^SPARQL\") \n"+ 7.298 - "} ORDER BY ?title\n"; 7.299 - 7.300 - @SuppressWarnings("unchecked") 7.301 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.302 - assertEquals(3, results.size()); 7.303 - assertTrue(-1<results.indexOf("[title=\"SPARQL Protocol Tutorial\"]")); 7.304 - assertTrue(-1<results.indexOf("[title=\"SPARQL Tutorial\"]")); 7.305 - assertTrue(-1<results.indexOf("[title=\"SPARQL (updated)\"]")); 7.306 - } 7.307 - 7.308 - @Test 7.309 - public void testRegexI() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.310 - { 7.311 - String queryString = prefixes+ 7.312 - "SELECT ?title \n"+ 7.313 - "WHERE { ?x dc:title ?title . \n"+ 7.314 - " FILTER regex(?title, \"web\", \"i\" ) ."+ 7.315 - "} \n"; 7.316 - 7.317 - @SuppressWarnings("unchecked") 7.318 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.319 - assertEquals(1, results.size()); 7.320 - assertTrue(-1<results.indexOf("[title=\"The Semantic Web\"]")); 7.321 - } 7.322 - 7.323 - @Test 7.324 - public void testUnionWithCommonObject() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.325 - { 7.326 - String queryString = prefixes+ 7.327 - "SELECT ?title \n"+ 7.328 - "WHERE { { ?book dc10:title ?title } UNION { ?book dc11:title ?title } } \n"; 7.329 - 7.330 - @SuppressWarnings("unchecked") 7.331 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.332 - assertEquals(6, results.size()); 7.333 - assertTrue(-1<results.indexOf("[title=\"SPARQL Query Language Tutorial\"]")); 7.334 - assertTrue(-1<results.indexOf("[title=\"SPARQL\"]")); 7.335 - assertTrue(-1<results.indexOf("[title=\"SPARQL Tutorial\"]")); 7.336 - assertTrue(-1<results.indexOf("[title=\"The Semantic Web\"]")); 7.337 - assertTrue(-1<results.indexOf("[title=\"SPARQL Protocol Tutorial\"]")); 7.338 - assertTrue(-1<results.indexOf("[title=\"SPARQL (updated)\"]")); 7.339 - } 7.340 - 7.341 - @Test 7.342 - public void testUnionWithDifferentObject() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.343 - { 7.344 - String queryString = prefixes+ 7.345 - "SELECT ?x ?y \n"+ 7.346 - "WHERE { { ?book dc10:title ?x } UNION { ?book dc11:title ?y } } \n"; 7.347 - 7.348 - @SuppressWarnings("unchecked") 7.349 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 7.350 - assertEquals(6, results.size()); 7.351 - assertTrue(-1<results.indexOf("[x=\"SPARQL Query Language Tutorial\"]")); 7.352 - assertTrue(-1<results.indexOf("[x=\"SPARQL\"]")); 7.353 - assertTrue(-1<results.indexOf("[y=\"SPARQL Tutorial\"]")); 7.354 - assertTrue(-1<results.indexOf("[y=\"The Semantic Web\"]")); 7.355 - assertTrue(-1<results.indexOf("[y=\"SPARQL Protocol Tutorial\"]")); 7.356 - assertTrue(-1<results.indexOf("[y=\"SPARQL (updated)\"]")); 7.357 - } 7.358 - 7.359 -} 7.360 \ No newline at end of file
8.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SimpleTests.java Wed Mar 18 14:03:01 2015 +0200 8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 8.3 @@ -1,129 +0,0 @@ 8.4 -/** 8.5 - * This Source Code Form is subject to the terms of the Mozilla Public 8.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 8.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 8.8 - * 8.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 8.10 - * 8.11 - * http://www.strabon.di.uoa.gr/ 8.12 - */ 8.13 -package eu.earthobservatory.runtime.generaldb; 8.14 - 8.15 -import static org.junit.Assert.assertEquals; 8.16 -import static org.junit.Assert.assertTrue; 8.17 - 8.18 -import java.io.IOException; 8.19 -import java.util.ArrayList; 8.20 - 8.21 -import org.junit.Test; 8.22 -import org.openrdf.model.vocabulary.RDF; 8.23 -import org.openrdf.model.vocabulary.XMLSchema; 8.24 -import org.openrdf.query.MalformedQueryException; 8.25 -import org.openrdf.query.QueryEvaluationException; 8.26 -import org.openrdf.query.TupleQueryResultHandlerException; 8.27 - 8.28 -/** 8.29 - * A set of simple tests on SPARQL query functionality 8.30 - * 8.31 - * @author George Garbis <ggarbis@di.uoa.gr> 8.32 - */ 8.33 -public class SimpleTests { 8.34 - 8.35 - protected static Strabon strabon; 8.36 - 8.37 - protected static java.sql.Connection conn = null; 8.38 - protected static String databaseName = null; 8.39 - 8.40 - protected static String jdbcDriver = null; 8.41 - protected static String serverName = null; 8.42 - protected static String username = null; 8.43 - protected static String password = null; 8.44 - protected static Integer port = null; 8.45 - 8.46 - protected static final String 8.47 - STRDF_NS = "http://strdf.di.uoa.gr/ontology#", 8.48 - EX_NS = "http://example.org/", 8.49 - NOA_NS = "http://teleios.di.uoa.gr/ontologies/noaOntology.owl#"; 8.50 - 8.51 - 8.52 - protected static final String prefixes = 8.53 - "PREFIX rdf: <"+RDF.NAMESPACE+"> \n" + 8.54 - "PREFIX strdf: <"+STRDF_NS+"> \n" + 8.55 - "PREFIX xsd: <"+XMLSchema.NAMESPACE+"> \n" + 8.56 - "PREFIX ex: <"+EX_NS+"> \n" + 8.57 - "PREFIX noa: <"+NOA_NS+"> \n"; 8.58 - 8.59 - @Test 8.60 - public void testSimpleFilter() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, QueryEvaluationException 8.61 - { 8.62 - 8.63 - String query = 8.64 - prefixes+ 8.65 - "SELECT ?id "+ 8.66 - "WHERE { "+ 8.67 - "?s ex:id ?id . "+ 8.68 - "?s ex:value ?value . "+ 8.69 - "FILTER( ?id<2 ) . " + 8.70 - "}"; 8.71 - 8.72 - @SuppressWarnings("unchecked") 8.73 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 8.74 - 8.75 - assertEquals(1, bindings.size()); 8.76 - assertTrue(-1<bindings.indexOf("[id=\"1\"^^<http://www.w3.org/2001/XMLSchema#int>]")); 8.77 - } 8.78 - 8.79 - @Test 8.80 - public void testMatchLiteralWithWKTType() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, QueryEvaluationException 8.81 - { 8.82 - String query = 8.83 - prefixes+ 8.84 - "SELECT ?s2 "+ 8.85 - "WHERE { "+ 8.86 - " ?s2 noa:hasGeometry \"POINT(1 0)\"^^strdf:WKT . "+ 8.87 - "}"; 8.88 - 8.89 - @SuppressWarnings("unchecked") 8.90 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 8.91 - 8.92 - assertEquals(1, bindings.size()); 8.93 - assertTrue(-1<bindings.indexOf("[s2=http://example.org/item1]")); 8.94 - } 8.95 - 8.96 - @Test 8.97 - public void testComplexFilter() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, QueryEvaluationException 8.98 - { 8.99 - 8.100 - String query = 8.101 - prefixes+ 8.102 - "SELECT ?s ?id "+ 8.103 - "WHERE { "+ 8.104 - "?s ex:id ?id . "+ 8.105 - "FILTER( ?id>20 || ?id<2 ) . " + 8.106 - "}"; 8.107 - 8.108 - @SuppressWarnings("unchecked") 8.109 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 8.110 - 8.111 - assertEquals(1, bindings.size()); 8.112 - assertTrue(-1<bindings.indexOf("[id=\"1\"^^<http://www.w3.org/2001/XMLSchema#int>;s=http://example.org/item1]")); 8.113 - } 8.114 - 8.115 - @Test 8.116 - public void testNotExistingPredicate() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, QueryEvaluationException 8.117 - { 8.118 - 8.119 - String query = 8.120 - prefixes+ 8.121 - "SELECT ?s ?o "+ 8.122 - "WHERE { "+ 8.123 - "?s ex:notExisting ?o . "+ 8.124 - "}"; 8.125 - 8.126 - @SuppressWarnings("unchecked") 8.127 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 8.128 - 8.129 - assertEquals(0, bindings.size()); 8.130 - } 8.131 - 8.132 -}
9.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SpatialTests.java Wed Mar 18 14:03:01 2015 +0200 9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 9.3 @@ -1,1242 +0,0 @@ 9.4 -/** 9.5 - * This Source Code Form is subject to the terms of the Mozilla Public 9.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 9.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 9.8 - * 9.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 9.10 - * 9.11 - * http://www.strabon.di.uoa.gr/ 9.12 - */ 9.13 -package eu.earthobservatory.runtime.generaldb; 9.14 - 9.15 -import static org.junit.Assert.assertEquals; 9.16 -import static org.junit.Assert.assertTrue; 9.17 -import static org.junit.Assert.fail; 9.18 - 9.19 -import java.io.IOException; 9.20 -import java.util.ArrayList; 9.21 - 9.22 -import org.junit.Test; 9.23 -import org.openrdf.model.vocabulary.RDF; 9.24 -import org.openrdf.model.vocabulary.XMLSchema; 9.25 -import org.openrdf.query.MalformedQueryException; 9.26 -import org.openrdf.query.QueryEvaluationException; 9.27 -import org.openrdf.query.TupleQueryResultHandlerException; 9.28 - 9.29 -public class SpatialTests { 9.30 - public static Strabon strabon; 9.31 - 9.32 - public String STRDF_NS = "http://strdf.di.uoa.gr/ontology#", 9.33 - EX_NS = "http://example.org/", 9.34 - NOA_NS = "http://teleios.di.uoa.gr/ontologies/noaOntology.owl#", 9.35 - GEOF_NS ="http://www.opengis.net/def/function/geosparql/"; 9.36 - 9.37 - protected String prefixes = 9.38 - "PREFIX rdf: <"+RDF.NAMESPACE+"> \n" + 9.39 - "PREFIX strdf: <"+STRDF_NS+"> \n" + 9.40 - "PREFIX xsd: <"+XMLSchema.NAMESPACE+"> \n" + 9.41 - "PREFIX ex: <"+EX_NS+"> \n" + 9.42 - "PREFIX noa: <"+NOA_NS+"> \n" + 9.43 - "PREFIX geof: <"+GEOF_NS+"> \n"; 9.44 - 9.45 - // -- Spatial Relationships -- // 9.46 - 9.47 - @Test 9.48 - public void testStrdfEquals() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.49 - { 9.50 - String query = 9.51 - prefixes+ 9.52 - "SELECT DISTINCT ?s1 ?s2 \n"+ 9.53 - "WHERE { \n" + 9.54 - " ?s1 ex:geometry ?g1 . \n"+ 9.55 - " ?s2 ex:geometry ?g2 . \n" + 9.56 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 9.57 - " FILTER( strdf:equals(?g1, ?g2 )) . \n"+ 9.58 - "}"; 9.59 - 9.60 - @SuppressWarnings("unchecked") 9.61 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.62 - assertEquals(1, bindings.size()); 9.63 - assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 9.64 - } 9.65 - 9.66 - @Test 9.67 - public void testStrdfDisjoint() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.68 - { 9.69 - String query = 9.70 - prefixes+ 9.71 - "SELECT DISTINCT ?s1 ?s2 \n"+ 9.72 - "WHERE { \n" + 9.73 - " ?s1 ex:geometry ?g1 . \n"+ 9.74 - " ?s2 ex:geometry ?g2 . \n" + 9.75 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 9.76 - " FILTER( strdf:disjoint(?g1, ?g2 )) . \n"+ 9.77 - "}"; 9.78 - 9.79 - @SuppressWarnings("unchecked") 9.80 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.81 - assertEquals(60, bindings.size()); 9.82 - // too many results 9.83 - //assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 9.84 - } 9.85 - 9.86 - @Test 9.87 - public void testStrdfIntesects() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.88 - { 9.89 - String query = 9.90 - prefixes+ 9.91 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.92 - "WHERE { \n" + 9.93 - " ?s1 ex:id ?id1 . \n"+ 9.94 - " ?s2 ex:id ?id2 . \n"+ 9.95 - " FILTER( str(?id1) < str(?id2) ) . \n"+ 9.96 - " ?s2 ex:geometry ?g2 . \n" + 9.97 - " ?s1 ex:geometry ?g1 . \n"+ 9.98 - " FILTER( strdf:intersects(?g1, ?g2 )) . \n"+ 9.99 - "}"; 9.100 - 9.101 - @SuppressWarnings("unchecked") 9.102 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.103 - assertEquals(5, bindings.size()); 9.104 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.105 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.106 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.107 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.108 - assertTrue(-1<bindings.indexOf("[id2=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.109 - } 9.110 - 9.111 - @Test 9.112 - public void testStrdfTouches() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.113 - { 9.114 - String query = 9.115 - prefixes+ 9.116 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.117 - "WHERE { \n" + 9.118 - " ?s1 ex:id ?id1 . \n"+ 9.119 - " ?s2 ex:id ?id2 . \n"+ 9.120 - " FILTER( str(?id1) < str(?id2) ) . \n"+ 9.121 - " ?s2 ex:geometry ?g2 . \n" + 9.122 - " ?s1 ex:geometry ?g1 . \n"+ 9.123 - " FILTER( strdf:touches(?g1, ?g2 )) . \n"+ 9.124 - "}"; 9.125 - 9.126 - @SuppressWarnings("unchecked") 9.127 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.128 - assertEquals(1, bindings.size()); 9.129 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.130 - } 9.131 - 9.132 - @Test 9.133 - public void testStrdfCrosses() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.134 - { 9.135 - String query = 9.136 - prefixes+ 9.137 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.138 - "WHERE { \n" + 9.139 - " ?s1 ex:id ?id1 . \n"+ 9.140 - " ?s2 ex:id ?id2 . \n"+ 9.141 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.142 - " ?s2 ex:geometry ?g2 . \n" + 9.143 - " ?s1 ex:geometry ?g1 . \n"+ 9.144 - " FILTER( strdf:crosses(?g1, ?g2 )) . \n"+ 9.145 - "}"; 9.146 - 9.147 - @SuppressWarnings("unchecked") 9.148 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.149 - assertEquals(2, bindings.size()); 9.150 - assertTrue(-1<bindings.indexOf("[id2=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.151 - assertTrue(-1<bindings.indexOf("[id2=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.152 - } 9.153 - 9.154 - @Test 9.155 - public void testStrdfWithin() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.156 - { 9.157 - String query = 9.158 - prefixes+ 9.159 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.160 - "WHERE { \n" + 9.161 - " ?s1 ex:id ?id1 . \n"+ 9.162 - " ?s2 ex:id ?id2 . \n"+ 9.163 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.164 - " ?s2 ex:geometry ?g2 . \n" + 9.165 - " ?s1 ex:geometry ?g1 . \n"+ 9.166 - " FILTER( strdf:within(?g1, ?g2)) . \n"+ 9.167 - "}"; 9.168 - 9.169 - @SuppressWarnings("unchecked") 9.170 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.171 - assertEquals(2, bindings.size()); 9.172 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.173 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.174 - } 9.175 - 9.176 - @Test 9.177 - public void testStrdfContains() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.178 - { 9.179 - String query = 9.180 - prefixes+ 9.181 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.182 - "WHERE { \n" + 9.183 - " ?s1 ex:id ?id1 . \n"+ 9.184 - " ?s2 ex:id ?id2 . \n"+ 9.185 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.186 - " ?s2 ex:geometry ?g2 . \n" + 9.187 - " ?s1 ex:geometry ?g1 . \n"+ 9.188 - " FILTER( strdf:contains(?g1, ?g2 )) . \n"+ 9.189 - "}"; 9.190 - 9.191 - @SuppressWarnings("unchecked") 9.192 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.193 - assertEquals(2, bindings.size()); 9.194 - assertTrue(-1<bindings.indexOf("[id2=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.195 - assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.196 - } 9.197 - 9.198 - @Test 9.199 - public void testStrdfOverlaps() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.200 - { 9.201 - String query = 9.202 - prefixes+ 9.203 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.204 - "WHERE { \n" + 9.205 - " ?s1 ex:id ?id1 . \n"+ 9.206 - " ?s2 ex:id ?id2 . \n"+ 9.207 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.208 - " ?s2 ex:geometry ?g2 . \n" + 9.209 - " ?s1 ex:geometry ?g1 . \n"+ 9.210 - " FILTER( strdf:overlaps(?g1, ?g2 )) . \n"+ 9.211 - "}"; 9.212 - 9.213 - @SuppressWarnings("unchecked") 9.214 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.215 - assertEquals(2, bindings.size()); 9.216 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.217 - assertTrue(-1<bindings.indexOf("[id2=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.218 - } 9.219 - 9.220 - @Test 9.221 - public void testStrdfmbbIntersects() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.222 - { 9.223 - String query = 9.224 - prefixes+ 9.225 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.226 - "WHERE { \n" + 9.227 - " ?s1 ex:id ?id1 . \n"+ 9.228 - " ?s2 ex:id ?id2 . \n"+ 9.229 - " FILTER( str(?id1) < str(?id2) ) . \n"+ 9.230 - " ?s2 ex:geometry ?g2 . \n" + 9.231 - " ?s1 ex:geometry ?g1 . \n"+ 9.232 - " FILTER( strdf:mbbIntersects(?g1, ?g2 ) ) . \n"+ 9.233 - "}"; 9.234 - 9.235 - @SuppressWarnings("unchecked") 9.236 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.237 - 9.238 - assertEquals(5, bindings.size()); 9.239 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.240 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.241 - assertTrue(-1<bindings.indexOf("[id2=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.242 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.243 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.244 - } 9.245 - 9.246 -// @Test 9.247 -// public void testStrdfCovers() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.248 -// { 9.249 -// String query = 9.250 -// prefixes+ 9.251 -// "SELECT DISTINCT ?id1 ?id2 \n"+ 9.252 -// "WHERE { \n" + 9.253 -// " ?s1 ex:id ?id1 . \n"+ 9.254 -// " ?s2 ex:id ?id2 . \n"+ 9.255 -// " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.256 -// " ?s2 ex:geometry ?g2 . \n" + 9.257 -// " ?s1 ex:geometry ?g1 . \n"+ 9.258 -// " FILTER( strdf:covers(?g1, ?g2 )) . \n"+ 9.259 -// "}"; 9.260 -// 9.261 -// @SuppressWarnings("unchecked") 9.262 -// ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.263 -// assertEquals(2, bindings.size()); 9.264 -// assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.265 -// assertTrue(-1<bindings.indexOf("[id2=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.266 -// } 9.267 -// 9.268 -// @Test 9.269 -// public void testStrdfCoveredBy() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.270 -// { 9.271 -// String query = 9.272 -// prefixes+ 9.273 -// "SELECT DISTINCT ?id1 ?id2 \n"+ 9.274 -// "WHERE { \n" + 9.275 -// " ?s1 ex:id ?id1 . \n"+ 9.276 -// " ?s2 ex:id ?id2 . \n"+ 9.277 -// " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.278 -// " ?s2 ex:geometry ?g2 . \n" + 9.279 -// " ?s1 ex:geometry ?g1 . \n"+ 9.280 -// " FILTER( strdf:coveredBy(?g1, ?g2 )) . \n"+ 9.281 -// "}"; 9.282 -// 9.283 -// @SuppressWarnings("unchecked") 9.284 -// ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.285 -// assertEquals(2, bindings.size()); 9.286 -// assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.287 -// assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.288 -// } 9.289 - 9.290 - @Test 9.291 - public void testStrdfRelate() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.292 - { 9.293 - String query = 9.294 - prefixes+ 9.295 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.296 - "WHERE { \n" + 9.297 - " ?s1 ex:id ?id1 . \n"+ 9.298 - " ?s2 ex:id ?id2 . \n"+ 9.299 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.300 - " ?s2 ex:geometry ?g2 . \n" + 9.301 - " ?s1 ex:geometry ?g1 . \n"+ 9.302 - " FILTER( strdf:relate(?g1, ?g2, \"T*F**F***\" )) . \n"+ 9.303 - "}"; 9.304 - 9.305 - @SuppressWarnings("unchecked") 9.306 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.307 - assertEquals(2, bindings.size()); 9.308 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.309 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.310 - } 9.311 - 9.312 -// TODO these tests run only in postgis 9.313 -// @Test 9.314 -// public void testStrdfLeft() throws MalformedQueryException, QueryEvaluationException 9.315 -// @Test 9.316 -// public void testStrdfRight() throws MalformedQueryException, QueryEvaluationException 9.317 -// @Test 9.318 -// public void testStrdfAbove() throws MalformedQueryException, QueryEvaluationException 9.319 -// @Test 9.320 -// public void testStrdfBelow() throws MalformedQueryException, QueryEvaluationException 9.321 - 9.322 - // -- Spatial Constructs -- // 9.323 - @Test 9.324 - public void testStrdfUnion() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.325 - { 9.326 - String query = 9.327 - prefixes+ 9.328 - "SELECT DISTINCT ( strdf:union(?g, \"POLYGON((5 3, 10 3, 10 8, 5 8, 5 3))\"^^strdf:WKT) AS ?ret ) \n"+ 9.329 - "WHERE { \n" + 9.330 - " ?s ex:id ?id . \n"+ 9.331 - " ?s ex:geometry ?g . \n" + 9.332 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 9.333 - "}"; 9.334 - 9.335 - @SuppressWarnings("unchecked") 9.336 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.337 - 9.338 - assertEquals(1, bindings.size()); 9.339 - assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((5 3, 3 3, 3 8, 5 8, 10 8, 10 3, 5 3));http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.340 - } 9.341 - 9.342 - @Test 9.343 - public void testStrdfEnvelopeBuffer() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.344 - { 9.345 - String query = 9.346 - prefixes+ 9.347 - "SELECT DISTINCT ( strdf:envelope(strdf:buffer(?g, \"0.5\"^^xsd:float)) AS ?ret ) \n"+ 9.348 -// "SELECT DISTINCT ?g (strdf:buffer(?g, \"0.5\"^^xsd:float) as ?buf) ( strdf:envelope(strdf:buffer(?g, \"0.5\"^^xsd:float)) AS ?ret ) \n"+ 9.349 - "WHERE { \n" + 9.350 - " ?s ex:id ?id . \n"+ 9.351 - " ?s ex:geometry ?g . \n" + 9.352 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.353 - "}"; 9.354 - 9.355 - @SuppressWarnings("unchecked") 9.356 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.357 - 9.358 - assertEquals(1, bindings.size()); 9.359 - 9.360 - if ( -1<bindings.indexOf("[ret=\"POLYGON ((7.5 0.5, 7.5 2.5, 9.5 2.5, 9.5 0.5, 7.5 0.5));http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]") || 9.361 - -1<bindings.indexOf("[ret=\"POLYGON ((7.542893218813453 0.5428932188134517, 9.457106781186548 0.5428932188134517, 9.457106781186548 2.4571067811865483, 7.542893218813453 2.4571067811865483, 7.542893218813453 0.5428932188134517));http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]") 9.362 - ) 9.363 - assertTrue(true); 9.364 - else 9.365 - fail(); 9.366 - } 9.367 - 9.368 - @Test 9.369 - public void testStrdfConvexHull() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.370 - { 9.371 - String query = 9.372 - prefixes+ 9.373 - "SELECT DISTINCT ( strdf:convexHull(\"GEOMETRYCOLLECTION( MULTILINESTRING((100 190,10 8),(150 10, 20 30)), MULTIPOINT(50 5, 150 30, 50 10, 10 10) )\"^^strdf:WKT) AS ?ret ) \n"+ 9.374 - "WHERE { \n" + 9.375 - " ?s ex:id ?id . \n"+ 9.376 - " ?s ex:geometry ?g . \n" + 9.377 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.378 - "}"; 9.379 - 9.380 - @SuppressWarnings("unchecked") 9.381 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.382 - 9.383 - assertEquals(1, bindings.size()); 9.384 - assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((50 5, 10 8, 10 10, 100 190, 150 30, 150 10, 50 5));http://www.opengis.net/def/crs/EPSG/0/0\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.385 - } 9.386 - 9.387 - @Test 9.388 - public void testStrdfBoundary() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.389 - { 9.390 - String query = 9.391 - prefixes+ 9.392 - "SELECT DISTINCT ( strdf:boundary(?g) AS ?ret ) \n"+ 9.393 - "WHERE { \n" + 9.394 - " ?s ex:id ?id . \n"+ 9.395 - " ?s ex:geometry ?g . \n" + 9.396 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.397 - "}"; 9.398 - 9.399 - @SuppressWarnings("unchecked") 9.400 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.401 - 9.402 - assertEquals(1, bindings.size()); 9.403 - assertTrue(-1<bindings.indexOf("[ret=\"LINESTRING (8 1, 9 1, 9 2, 8 2, 8 1);http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); } 9.404 - 9.405 - @Test 9.406 - public void testStrdfIntersection() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.407 - { 9.408 - String query = 9.409 - prefixes+ 9.410 - "SELECT DISTINCT ( strdf:intersection(?g, \"POLYGON((5 3, 10 3, 10 8, 5 8, 5 3));http://www.opengis.net/def/crs/EPSG/0/4326\"^^strdf:WKT) AS ?ret ) \n"+ 9.411 - "WHERE { \n" + 9.412 - " ?s ex:id ?id . \n"+ 9.413 - " ?s ex:geometry ?g . \n" + 9.414 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 9.415 - "}"; 9.416 - 9.417 - @SuppressWarnings("unchecked") 9.418 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.419 - 9.420 - assertEquals(1, bindings.size()); 9.421 - assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((10 3, 5 3, 5 8, 10 8, 10 3));http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.422 - } 9.423 - 9.424 - @Test 9.425 - public void testStrdfDifference() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.426 - { 9.427 - String query = 9.428 - prefixes+ 9.429 - "SELECT DISTINCT ( strdf:difference(?g, \"POLYGON((5 3, 10 3, 10 8, 5 8, 5 3))\"^^strdf:WKT) AS ?ret ) \n"+ 9.430 - "WHERE { \n" + 9.431 - " ?s ex:id ?id . \n"+ 9.432 - " ?s ex:geometry ?g . \n" + 9.433 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 9.434 - "}"; 9.435 - 9.436 - @SuppressWarnings("unchecked") 9.437 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.438 - 9.439 - assertEquals(1, bindings.size()); 9.440 - assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((5 3, 3 3, 3 8, 5 8, 5 3));http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.441 - } 9.442 - 9.443 - @Test 9.444 - public void testStrdfSymDifference() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.445 - { 9.446 - String query = 9.447 - prefixes+ 9.448 - "SELECT DISTINCT ( strdf:symDifference(?g, \"POLYGON((5 3, 12 3, 12 8, 5 8, 5 3));http://www.opengis.net/def/crs/EPSG/0/4326\"^^strdf:WKT) AS ?ret ) \n"+ 9.449 - "WHERE { \n" + 9.450 - " ?s ex:id ?id . \n"+ 9.451 - " ?s ex:geometry ?g . \n" + 9.452 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 9.453 - "}"; 9.454 - 9.455 - @SuppressWarnings("unchecked") 9.456 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.457 - 9.458 - assertEquals(1, bindings.size()); 9.459 - assertTrue(-1<bindings.indexOf("[ret=\"MULTIPOLYGON (((5 3, 3 3, 3 8, 5 8, 5 3)), ((10 3, 10 8, 12 8, 12 3, 10 3)));http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.460 - } 9.461 - 9.462 -// // -- Spatial Metric Functions -- // 9.463 - 9.464 - @Test 9.465 - public void testStrdfDistance() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.466 - { 9.467 - String query = 9.468 - prefixes+ 9.469 - "SELECT DISTINCT ( strdf:distance(?g, \"POINT( 10 1 )\"^^strdf:WKT) AS ?ret ) \n"+ 9.470 - "WHERE { \n" + 9.471 - " ?s ex:id ?id . \n"+ 9.472 - " ?s ex:geometry ?g . \n" + 9.473 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.474 - "}"; 9.475 - 9.476 - @SuppressWarnings("unchecked") 9.477 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.478 - 9.479 - assertEquals(1, bindings.size()); 9.480 - assertTrue(-1<bindings.indexOf("[ret=\"1.0\"^^<http://www.w3.org/2001/XMLSchema#double>]")); 9.481 - } 9.482 - 9.483 - @Test 9.484 - public void testStrdfArea() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.485 - { 9.486 - String query = 9.487 - prefixes+ 9.488 - "SELECT DISTINCT ( strdf:area(?g) AS ?ret ) \n"+ 9.489 - "WHERE { \n" + 9.490 - " ?s ex:id ?id . \n"+ 9.491 - " ?s ex:geometry ?g . \n" + 9.492 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.493 - "}"; 9.494 - 9.495 - @SuppressWarnings("unchecked") 9.496 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.497 - 9.498 - assertEquals(1, bindings.size()); 9.499 - assertTrue(-1<bindings.indexOf("[ret=\"1.0\"^^<http://www.w3.org/2001/XMLSchema#double>]")); 9.500 - } 9.501 - 9.502 - @Test 9.503 - public void testStrdfDimension() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.504 - { 9.505 - String query = 9.506 - prefixes+ 9.507 - "SELECT DISTINCT (strdf:dimension(?g) AS ?ret2) " + 9.508 - "(strdf:dimension(strdf:boundary(?g)) AS ?ret1) " + 9.509 - "(strdf:dimension(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 9.510 - "WHERE { \n" + 9.511 - " ?s ex:id ?id . \n"+ 9.512 - " ?s ex:geometry ?g . \n" + 9.513 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.514 - "}"; 9.515 - 9.516 - @SuppressWarnings("unchecked") 9.517 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.518 - 9.519 - assertEquals(1, bindings.size()); 9.520 - // TODO monetdb returns as dimension only 3 (because of GEOS lib) 9.521 - if ( -1<bindings.indexOf("[ret2=\"2\"^^<http://www.w3.org/2001/XMLSchema#int>;ret1=\"1\"^^<http://www.w3.org/2001/XMLSchema#int>;ret0=\"0\"^^<http://www.w3.org/2001/XMLSchema#int>]") || 9.522 - -1<bindings.indexOf("[ret2=\"3\"^^<http://www.w3.org/2001/XMLSchema#int>;ret1=\"3\"^^<http://www.w3.org/2001/XMLSchema#int>;ret0=\"3\"^^<http://www.w3.org/2001/XMLSchema#int>]") ) 9.523 - assertTrue(true); 9.524 - else 9.525 - fail(); 9.526 - 9.527 - } 9.528 - 9.529 - @Test 9.530 - public void testStrdfGeometryType() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.531 - { 9.532 - String query = 9.533 - prefixes+ 9.534 - "SELECT DISTINCT (strdf:geometryType(?g) AS ?ret2) " + 9.535 - "(strdf:geometryType(strdf:boundary(?g)) AS ?ret1) " + 9.536 - "(strdf:geometryType(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 9.537 - "WHERE { \n" + 9.538 - " ?s ex:id ?id . \n"+ 9.539 - " ?s ex:geometry ?g . \n" + 9.540 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.541 - "}"; 9.542 - 9.543 - @SuppressWarnings("unchecked") 9.544 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.545 - 9.546 - assertEquals(1, bindings.size()); 9.547 - // TODO different results between dbms in strdf:geometryType 9.548 - if ( -1<bindings.indexOf("[ret2=\"3\";ret1=\"1\";ret0=\"0\"]") || 9.549 - -1<bindings.indexOf("[ret2=\"ST_Polygon\";ret1=\"ST_LineString\";ret0=\"ST_Point\"]") 9.550 - ) 9.551 - assertTrue(true); 9.552 - else 9.553 - fail(); 9.554 - } 9.555 - 9.556 - @Test 9.557 - public void testStrdfAsText() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.558 - { 9.559 - String query = 9.560 - prefixes+ 9.561 - "SELECT DISTINCT (strdf:asText(?g) AS ?ret2) " + 9.562 - "(strdf:asText(strdf:boundary(?g)) AS ?ret1) " + 9.563 - "(strdf:asText(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 9.564 - "WHERE { \n" + 9.565 - " ?s ex:id ?id . \n"+ 9.566 - " ?s ex:geometry ?g . \n" + 9.567 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.568 - "}"; 9.569 - 9.570 - @SuppressWarnings("unchecked") 9.571 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.572 - 9.573 - assertEquals(1, bindings.size()); 9.574 - if ( -1<bindings.indexOf("[ret2=\"POLYGON((8 1,9 1,9 2,8 2,8 1))\";ret1=\"LINESTRING(8 1,9 1,9 2,8 2,8 1)\";ret0=\"POINT(0 0)\"]") || 9.575 - -1<bindings.indexOf("[ret2=\"POLYGON ((8.0000000000000000 1.0000000000000000, 9.0000000000000000 1.0000000000000000, 9.0000000000000000 2.0000000000000000, 8.0000000000000000 2.0000000000000000, 8.0000000000000000 1.0000000000000000))\";ret1=\"LINESTRING (8.0000000000000000 1.0000000000000000, 9.0000000000000000 1.0000000000000000, 9.0000000000000000 2.0000000000000000, 8.0000000000000000 2.0000000000000000, 8.0000000000000000 1.0000000000000000)\";ret0=\"POINT (0.0000000000000000 0.0000000000000000)\"]") 9.576 - ) 9.577 - assertTrue(true); 9.578 - else 9.579 - fail(); 9.580 - 9.581 - } 9.582 - 9.583 - @Test 9.584 - public void testStrdfSrid() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.585 - { 9.586 - String query = 9.587 - prefixes+ 9.588 - "SELECT DISTINCT (strdf:srid(?g) AS ?ret2) " + 9.589 - "(strdf:srid(strdf:boundary(?g)) AS ?ret1) " + 9.590 - "(strdf:srid(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 9.591 - "WHERE { \n" + 9.592 - " ?s ex:id ?id . \n"+ 9.593 - " ?s ex:geometry ?g . \n" + 9.594 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.595 - "}"; 9.596 - 9.597 - @SuppressWarnings("unchecked") 9.598 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.599 - // TODO test srid uri arguments 9.600 - assertEquals(1, bindings.size()); 9.601 - if ( -1<bindings.indexOf("[ret2=\"4326\"^^<http://www.w3.org/2001/XMLSchema#int>;ret1=\"4326\"^^<http://www.w3.org/2001/XMLSchema#int>;ret0=\"4326\"^^<http://www.w3.org/2001/XMLSchema#int>]") || 9.602 - -1<bindings.indexOf("[ret2=\"0\"^^<http://www.w3.org/2001/XMLSchema#int>;ret1=\"0\"^^<http://www.w3.org/2001/XMLSchema#int>;ret0=\"0\"^^<http://www.w3.org/2001/XMLSchema#int>]") 9.603 - ) 9.604 - assertTrue(true); 9.605 - else 9.606 - fail(); 9.607 - } 9.608 - 9.609 - @Test 9.610 - public void testStrdfIsEmpty() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.611 - { 9.612 - String query = 9.613 - prefixes+ 9.614 - "SELECT DISTINCT (strdf:isEmpty(?g) AS ?ret2) " + 9.615 - "(strdf:isEmpty(strdf:boundary(?g)) AS ?ret1) " + 9.616 - "(strdf:isEmpty(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 9.617 - "WHERE { \n" + 9.618 - " ?s ex:id ?id . \n"+ 9.619 - " ?s ex:geometry ?g . \n" + 9.620 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.621 - "}"; 9.622 - 9.623 - @SuppressWarnings("unchecked") 9.624 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.625 - 9.626 - assertEquals(1, bindings.size()); 9.627 - assertTrue(-1<bindings.indexOf("[ret2=\"false\"^^<http://www.w3.org/2001/XMLSchema#boolean>;ret1=\"false\"^^<http://www.w3.org/2001/XMLSchema#boolean>;ret0=\"false\"^^<http://www.w3.org/2001/XMLSchema#boolean>]")); 9.628 - } 9.629 - 9.630 - @Test 9.631 - public void testStrdfIsSimple() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.632 - { 9.633 - String query = 9.634 - prefixes+ 9.635 - "SELECT DISTINCT (strdf:isSimple(?g) AS ?ret2) " + 9.636 - "(strdf:isSimple(strdf:boundary(?g)) AS ?ret1) " + 9.637 - "(strdf:isSimple(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 9.638 - "WHERE { \n" + 9.639 - " ?s ex:id ?id . \n"+ 9.640 - " ?s ex:geometry ?g . \n" + 9.641 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.642 - "}"; 9.643 - 9.644 - @SuppressWarnings("unchecked") 9.645 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.646 - 9.647 - assertEquals(1, bindings.size()); 9.648 - assertTrue(-1<bindings.indexOf("[ret2=\"true\"^^<http://www.w3.org/2001/XMLSchema#boolean>;ret1=\"true\"^^<http://www.w3.org/2001/XMLSchema#boolean>;ret0=\"true\"^^<http://www.w3.org/2001/XMLSchema#boolean>]")); 9.649 - } 9.650 - 9.651 - // -- GEOSPARQL -- // 9.652 - 9.653 - // -- Non-topological -- // 9.654 - 9.655 - @Test 9.656 - public void testGeofConvexHull() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.657 - { 9.658 - String query = 9.659 - prefixes+ 9.660 - "SELECT DISTINCT ( geof:convexHull(\"GEOMETRYCOLLECTION( MULTILINESTRING((100 190,10 8),(150 10, 20 30)), MULTIPOINT(50 5, 150 30, 50 10, 10 10) )\"^^strdf:WKT) AS ?ret ) \n"+ 9.661 - "WHERE { \n" + 9.662 - " ?s ex:id ?id . \n"+ 9.663 - " ?s ex:geometry ?g . \n" + 9.664 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.665 - "}"; 9.666 - 9.667 - @SuppressWarnings("unchecked") 9.668 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.669 - 9.670 - assertEquals(1, bindings.size()); 9.671 - assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((50 5, 10 8, 10 10, 100 190, 150 30, 150 10, 50 5));http://www.opengis.net/def/crs/EPSG/0/0\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.672 - } 9.673 - 9.674 - @Test 9.675 - public void testGeofIntersection() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.676 - { 9.677 - String query = 9.678 - prefixes+ 9.679 - "SELECT DISTINCT ( geof:intersection(?g, \"POLYGON((5 3, 10 3, 10 8, 5 8, 5 3))\"^^strdf:WKT) AS ?ret ) \n"+ 9.680 - "WHERE { \n" + 9.681 - " ?s ex:id ?id . \n"+ 9.682 - " ?s ex:geometry ?g . \n" + 9.683 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 9.684 - "}"; 9.685 - 9.686 - @SuppressWarnings("unchecked") 9.687 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.688 - 9.689 - assertEquals(1, bindings.size()); 9.690 - assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((10 3, 5 3, 5 8, 10 8, 10 3));http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.691 - } 9.692 - 9.693 - @Test 9.694 - public void testGeofDifference() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.695 - { 9.696 - String query = 9.697 - prefixes+ 9.698 - "SELECT DISTINCT ( geof:difference(?g, \"POLYGON((5 3, 10 3, 10 8, 5 8, 5 3))\"^^strdf:WKT) AS ?ret ) \n"+ 9.699 - "WHERE { \n" + 9.700 - " ?s ex:id ?id . \n"+ 9.701 - " ?s ex:geometry ?g . \n" + 9.702 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 9.703 - "}"; 9.704 - 9.705 - @SuppressWarnings("unchecked") 9.706 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.707 - 9.708 - assertEquals(1, bindings.size()); 9.709 - assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((5 3, 3 3, 3 8, 5 8, 5 3));http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.710 - } 9.711 - 9.712 - @Test 9.713 - public void testGeofSymDifference() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.714 - { 9.715 - String query = 9.716 - prefixes+ 9.717 - "SELECT DISTINCT ( geof:symmetricDifference(?g, \"POLYGON((5 3, 12 3, 12 8, 5 8, 5 3))\"^^strdf:WKT) AS ?ret ) \n"+ 9.718 - "WHERE { \n" + 9.719 - " ?s ex:id ?id . \n"+ 9.720 - " ?s ex:geometry ?g . \n" + 9.721 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 9.722 - "}"; 9.723 - 9.724 - @SuppressWarnings("unchecked") 9.725 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.726 - 9.727 - assertEquals(1, bindings.size()); 9.728 - assertTrue(-1<bindings.indexOf("[ret=\"MULTIPOLYGON (((5 3, 3 3, 3 8, 5 8, 5 3)), ((10 3, 10 8, 12 8, 12 3, 10 3)));http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.729 - } 9.730 - 9.731 - @Test 9.732 - public void testGeofEnvelope() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.733 - { 9.734 - String query = 9.735 - prefixes+ 9.736 - "SELECT DISTINCT ( strdf:envelope(strdf:buffer(?g, \"0.5\"^^xsd:float)) AS ?ret ) \n"+ 9.737 - "WHERE { \n" + 9.738 - " ?s ex:id ?id . \n"+ 9.739 - " ?s ex:geometry ?g . \n" + 9.740 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 9.741 - "}"; 9.742 - 9.743 - @SuppressWarnings("unchecked") 9.744 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.745 - 9.746 - assertEquals(1, bindings.size()); 9.747 - 9.748 - if ( -1<bindings.indexOf("[ret=\"POLYGON ((7.5 0.5, 7.5 2.5, 9.5 2.5, 9.5 0.5, 7.5 0.5));http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]") || 9.749 - -1<bindings.indexOf("[ret=\"POLYGON ((7.542893218813453 0.5428932188134517, 9.457106781186548 0.5428932188134517, 9.457106781186548 2.4571067811865483, 7.542893218813453 2.4571067811865483, 7.542893218813453 0.5428932188134517));http://www.opengis.net/def/crs/EPSG/0/4326\"^^<http://strdf.di.uoa.gr/ontology#WKT>]") 9.750 - ) 9.751 - assertTrue(true); 9.752 - else 9.753 - fail(); 9.754 - } 9.755 - 9.756 -// @Test 9.757 -// public void testGeofEnvelopeBuffer() throws MalformedQueryException, QueryEvaluationException 9.758 -// { // TODO 3 arguments 9.759 -// String query = 9.760 -// prefixes+ 9.761 -// "SELECT DISTINCT ( geof:envelope(geof:buffer(?g, \"1.0\"^^xsd:float)) AS ?ret ) \n"+ 9.762 -// "WHERE { \n" + 9.763 -// " ?s noa:hasGeometry ?g . \n"+ 9.764 -// " ?s ex:id ?id . \n"+ 9.765 -// "}"; 9.766 -// 9.767 -// ArrayList<String> bindings = strabon.query(query,strabon.getSailRepoConnection()); 9.768 -// 9.769 -// assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((0 -1, 0 1, 2 1, 2 -1, 0 -1))\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.770 -// assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((1 -1, 1 1, 3 1, 3 -1, 1 -1))\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.771 -// assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((2 -1, 2 1, 4 1, 4 -1, 2 -1))\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 9.772 -// } 9.773 - 9.774 - //Simple Features - 8 functions - all with 2 arguments + boolean 9.775 - 9.776 - @Test 9.777 - public void testGeofSfEquals() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.778 - { 9.779 - String query = 9.780 - prefixes+ 9.781 - "SELECT DISTINCT ?s1 ?s2 \n"+ 9.782 - "WHERE { \n" + 9.783 - " ?s1 ex:geometry ?g1 . \n"+ 9.784 - " ?s2 ex:geometry ?g2 . \n" + 9.785 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 9.786 - " FILTER( geof:sfEquals(?g1, ?g2 )) . \n"+ 9.787 - "}"; 9.788 - 9.789 - @SuppressWarnings("unchecked") 9.790 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.791 - assertEquals(1, bindings.size()); 9.792 - assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 9.793 - } 9.794 - 9.795 - @Test 9.796 - public void testGeofSfDisjoint() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.797 - { 9.798 - String query = 9.799 - prefixes+ 9.800 - "SELECT DISTINCT ?s1 ?s2 \n"+ 9.801 - "WHERE { \n" + 9.802 - " ?s1 ex:geometry ?g1 . \n"+ 9.803 - " ?s2 ex:geometry ?g2 . \n" + 9.804 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 9.805 - " FILTER( geof:sfDisjoint(?g1, ?g2 )) . \n"+ 9.806 - "}"; 9.807 - 9.808 - @SuppressWarnings("unchecked") 9.809 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.810 - assertEquals(60, bindings.size()); 9.811 - // too many results :) 9.812 -// assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 9.813 - } 9.814 - 9.815 - @Test 9.816 - public void testGeofSfIntesects() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.817 - { 9.818 - String query = 9.819 - prefixes+ 9.820 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.821 - "WHERE { \n" + 9.822 - " ?s1 ex:id ?id1 . \n"+ 9.823 - " ?s2 ex:id ?id2 . \n"+ 9.824 - " FILTER( str(?id1) < str(?id2) ) . \n"+ 9.825 - " ?s2 ex:geometry ?g2 . \n" + 9.826 - " ?s1 ex:geometry ?g1 . \n"+ 9.827 - " FILTER( geof:sfIntersects(?g1, ?g2 )) . \n"+ 9.828 - "}"; 9.829 - 9.830 - @SuppressWarnings("unchecked") 9.831 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.832 - assertEquals(5, bindings.size()); 9.833 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.834 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.835 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.836 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.837 - assertTrue(-1<bindings.indexOf("[id2=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.838 - } 9.839 - 9.840 - @Test 9.841 - public void testGeofSfTouches() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.842 - { 9.843 - String query = 9.844 - prefixes+ 9.845 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.846 - "WHERE { \n" + 9.847 - " ?s1 ex:id ?id1 . \n"+ 9.848 - " ?s2 ex:id ?id2 . \n"+ 9.849 - " FILTER( str(?id1) < str(?id2) ) . \n"+ 9.850 - " ?s2 ex:geometry ?g2 . \n" + 9.851 - " ?s1 ex:geometry ?g1 . \n"+ 9.852 - " FILTER( geof:sfTouches(?g1, ?g2 )) . \n"+ 9.853 - "}"; 9.854 - 9.855 - @SuppressWarnings("unchecked") 9.856 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.857 - assertEquals(1, bindings.size()); 9.858 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.859 - } 9.860 - 9.861 - @Test 9.862 - public void testGeofSfCrosses() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.863 - { 9.864 - String query = 9.865 - prefixes+ 9.866 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.867 - "WHERE { \n" + 9.868 - " ?s1 ex:id ?id1 . \n"+ 9.869 - " ?s2 ex:id ?id2 . \n"+ 9.870 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.871 - " ?s2 ex:geometry ?g2 . \n" + 9.872 - " ?s1 ex:geometry ?g1 . \n"+ 9.873 - " FILTER( geof:sfCrosses(?g1, ?g2 )) . \n"+ 9.874 - "}"; 9.875 - 9.876 - @SuppressWarnings("unchecked") 9.877 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.878 - assertEquals(2, bindings.size()); 9.879 - assertTrue(-1<bindings.indexOf("[id2=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.880 - assertTrue(-1<bindings.indexOf("[id2=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.881 - } 9.882 - 9.883 - @Test 9.884 - public void testGeofSfWithin() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.885 - { 9.886 - String query = 9.887 - prefixes+ 9.888 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.889 - "WHERE { \n" + 9.890 - " ?s1 ex:id ?id1 . \n"+ 9.891 - " ?s2 ex:id ?id2 . \n"+ 9.892 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.893 - " ?s2 ex:geometry ?g2 . \n" + 9.894 - " ?s1 ex:geometry ?g1 . \n"+ 9.895 - " FILTER( geof:sfWithin(?g1, ?g2 )) . \n"+ 9.896 - "}"; 9.897 - 9.898 - @SuppressWarnings("unchecked") 9.899 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.900 - assertEquals(2, bindings.size()); 9.901 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.902 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.903 - } 9.904 - 9.905 - @Test 9.906 - public void testGeofSfContains() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.907 - { 9.908 - String query = 9.909 - prefixes+ 9.910 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.911 - "WHERE { \n" + 9.912 - " ?s1 ex:id ?id1 . \n"+ 9.913 - " ?s2 ex:id ?id2 . \n"+ 9.914 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.915 - " ?s2 ex:geometry ?g2 . \n" + 9.916 - " ?s1 ex:geometry ?g1 . \n"+ 9.917 - " FILTER( geof:sfContains(?g1, ?g2 )) . \n"+ 9.918 - "}"; 9.919 - 9.920 - @SuppressWarnings("unchecked") 9.921 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.922 - assertEquals(2, bindings.size()); 9.923 - assertTrue(-1<bindings.indexOf("[id2=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.924 - assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.925 - } 9.926 - 9.927 - @Test 9.928 - public void testGeofSfOverlaps() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.929 - { 9.930 - String query = 9.931 - prefixes+ 9.932 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.933 - "WHERE { \n" + 9.934 - " ?s1 ex:id ?id1 . \n"+ 9.935 - " ?s2 ex:id ?id2 . \n"+ 9.936 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.937 - " ?s2 ex:geometry ?g2 . \n" + 9.938 - " ?s1 ex:geometry ?g1 . \n"+ 9.939 - " FILTER( geof:sfOverlaps(?g1, ?g2 )) . \n"+ 9.940 - "}"; 9.941 - 9.942 - @SuppressWarnings("unchecked") 9.943 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.944 - assertEquals(2, bindings.size()); 9.945 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.946 - assertTrue(-1<bindings.indexOf("[id2=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.947 - } 9.948 - 9.949 - //Egenhofer - 8 functions - all with 2 arguments + boolean 9.950 - 9.951 - @Test 9.952 - public void testGeofEhEquals() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.953 - { 9.954 - String query = 9.955 - prefixes+ 9.956 - "SELECT DISTINCT ?s1 ?s2 \n"+ 9.957 - "WHERE { \n" + 9.958 - " ?s1 ex:geometry ?g1 . \n"+ 9.959 - " ?s2 ex:geometry ?g2 . \n" + 9.960 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 9.961 - " FILTER( geof:ehEquals(?g1, ?g2 )) . \n"+ 9.962 - "}"; 9.963 - 9.964 - @SuppressWarnings("unchecked") 9.965 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.966 - assertEquals(1, bindings.size()); 9.967 - assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 9.968 - } 9.969 - 9.970 - @Test 9.971 - public void testGeofEhDisjoint() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.972 - { 9.973 - String query = 9.974 - prefixes+ 9.975 - "SELECT DISTINCT ?s1 ?s2 \n"+ 9.976 - "WHERE { \n" + 9.977 - " ?s1 ex:geometry ?g1 . \n"+ 9.978 - " ?s2 ex:geometry ?g2 . \n" + 9.979 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 9.980 - " FILTER( geof:ehDisjoint(?g1, ?g2 )) . \n"+ 9.981 - "}"; 9.982 - 9.983 - @SuppressWarnings("unchecked") 9.984 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.985 - assertEquals(60, bindings.size()); 9.986 - // too many results :) 9.987 -// assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 9.988 - } 9.989 - 9.990 - @Test 9.991 - public void testGeofEhMeet() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.992 - { 9.993 - String query = 9.994 - prefixes+ 9.995 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.996 - "WHERE { \n" + 9.997 - " ?s1 ex:id ?id1 . \n"+ 9.998 - " ?s2 ex:id ?id2 . \n"+ 9.999 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.1000 - " ?s2 ex:geometry ?g2 . \n" + 9.1001 - " ?s1 ex:geometry ?g1 . \n"+ 9.1002 - " FILTER( geof:ehMeet(?g1, ?g2 )) . \n"+ 9.1003 - "}"; 9.1004 - 9.1005 - @SuppressWarnings("unchecked") 9.1006 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1007 - assertEquals(2, bindings.size()); 9.1008 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1009 - assertTrue(-1<bindings.indexOf("[id2=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1010 - } 9.1011 - 9.1012 - @Test 9.1013 - public void testGeofEhOverlap() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.1014 - { 9.1015 - String query = 9.1016 - prefixes+ 9.1017 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.1018 - "WHERE { \n" + 9.1019 - " ?s1 ex:id ?id1 . \n"+ 9.1020 - " ?s2 ex:id ?id2 . \n"+ 9.1021 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.1022 - " ?s2 ex:geometry ?g2 . \n" + 9.1023 - " ?s1 ex:geometry ?g1 . \n"+ 9.1024 - " FILTER( geof:ehOverlap(?g1, ?g2 )) . \n"+ 9.1025 - "}"; 9.1026 - 9.1027 - @SuppressWarnings("unchecked") 9.1028 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1029 - assertEquals(2, bindings.size()); 9.1030 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1031 - assertTrue(-1<bindings.indexOf("[id2=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1032 - } 9.1033 - 9.1034 - @Test 9.1035 - public void testGeofEhCovers() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.1036 - { 9.1037 - String query = 9.1038 - prefixes+ 9.1039 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.1040 - "WHERE { \n" + 9.1041 - " ?s1 ex:id ?id1 . \n"+ 9.1042 - " ?s2 ex:id ?id2 . \n"+ 9.1043 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.1044 - " ?s2 ex:geometry ?g2 . \n" + 9.1045 - " ?s1 ex:geometry ?g1 . \n"+ 9.1046 - " FILTER( geof:ehCovers(?g1, ?g2 )) . \n"+ 9.1047 - "}"; 9.1048 - 9.1049 - @SuppressWarnings("unchecked") 9.1050 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1051 - assertEquals(1, bindings.size()); 9.1052 - assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1053 - } 9.1054 - 9.1055 - @Test 9.1056 - public void testGeofEhCoveredBy() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.1057 - { 9.1058 - String query = 9.1059 - prefixes+ 9.1060 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.1061 - "WHERE { \n" + 9.1062 - " ?s1 ex:id ?id1 . \n"+ 9.1063 - " ?s2 ex:id ?id2 . \n"+ 9.1064 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.1065 - " ?s2 ex:geometry ?g2 . \n" + 9.1066 - " ?s1 ex:geometry ?g1 . \n"+ 9.1067 - " FILTER( geof:ehCoveredBy(?g1, ?g2 )) . \n"+ 9.1068 - "}"; 9.1069 - 9.1070 - @SuppressWarnings("unchecked") 9.1071 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1072 - assertEquals(1, bindings.size()); 9.1073 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1074 - } 9.1075 - 9.1076 - @Test 9.1077 - public void testGeofEhInside() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.1078 - { 9.1079 - String query = 9.1080 - prefixes+ 9.1081 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.1082 - "WHERE { \n" + 9.1083 - " ?s1 ex:id ?id1 . \n"+ 9.1084 - " ?s2 ex:id ?id2 . \n"+ 9.1085 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.1086 - " ?s2 ex:geometry ?g2 . \n" + 9.1087 - " ?s1 ex:geometry ?g1 . \n"+ 9.1088 - " FILTER( geof:ehInside(?g1, ?g2 )) . \n"+ 9.1089 - "}"; 9.1090 - 9.1091 - @SuppressWarnings("unchecked") 9.1092 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1093 - assertEquals(1, bindings.size()); 9.1094 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1095 - } 9.1096 - 9.1097 - @Test 9.1098 - public void testGeofEhContains() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.1099 - { 9.1100 - String query = 9.1101 - prefixes+ 9.1102 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.1103 - "WHERE { \n" + 9.1104 - " ?s1 ex:id ?id1 . \n"+ 9.1105 - " ?s2 ex:id ?id2 . \n"+ 9.1106 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.1107 - " ?s2 ex:geometry ?g2 . \n" + 9.1108 - " ?s1 ex:geometry ?g1 . \n"+ 9.1109 - " FILTER( geof:ehContains(?g1, ?g2 )) . \n"+ 9.1110 - "}"; 9.1111 - 9.1112 - @SuppressWarnings("unchecked") 9.1113 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1114 - assertEquals(1, bindings.size()); 9.1115 - assertTrue(-1<bindings.indexOf("[id2=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1116 - } 9.1117 - 9.1118 - //RCC8 - 8 functions - all with 2 arguments + boolean 9.1119 - 9.1120 - @Test 9.1121 - public void testGeofRcc8Dc() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.1122 - { 9.1123 - String query = 9.1124 - prefixes+ 9.1125 - "SELECT DISTINCT ?s1 ?s2 \n"+ 9.1126 - "WHERE { \n" + 9.1127 - " ?s1 ex:geometry ?g1 . \n"+ 9.1128 - " ?s2 ex:geometry ?g2 . \n" + 9.1129 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 9.1130 - " FILTER( geof:rcc8dc(?g1, ?g2 )) . \n"+ 9.1131 - "}"; 9.1132 - 9.1133 - @SuppressWarnings("unchecked") 9.1134 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1135 - assertEquals(60, bindings.size()); 9.1136 - // too many results :) 9.1137 -// assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 9.1138 - } 9.1139 - 9.1140 - @Test 9.1141 - public void testGeofRcc8Ec() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.1142 - { 9.1143 - String query = 9.1144 - prefixes+ 9.1145 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.1146 - "WHERE { \n" + 9.1147 - " ?s1 ex:id ?id1 . \n"+ 9.1148 - " ?s2 ex:id ?id2 . \n"+ 9.1149 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.1150 - " ?s2 ex:geometry ?g2 . \n" + 9.1151 - " ?s1 ex:geometry ?g1 . \n"+ 9.1152 - " FILTER( geof:rcc8po(?g1, ?g2 )) . \n"+ 9.1153 - "}"; 9.1154 - 9.1155 - @SuppressWarnings("unchecked") 9.1156 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1157 - assertEquals(2, bindings.size()); 9.1158 - assertTrue(-1<bindings.indexOf("[id2=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1159 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1160 - } 9.1161 - 9.1162 - @Test 9.1163 - public void testGeofRcc8Tppi() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.1164 - { 9.1165 - String query = 9.1166 - prefixes+ 9.1167 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.1168 - "WHERE { \n" + 9.1169 - " ?s1 ex:id ?id1 . \n"+ 9.1170 - " ?s2 ex:id ?id2 . \n"+ 9.1171 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.1172 - " ?s2 ex:geometry ?g2 . \n" + 9.1173 - " ?s1 ex:geometry ?g1 . \n"+ 9.1174 - " FILTER( geof:rcc8tppi(?g1, ?g2 )) . \n"+ 9.1175 - "}"; 9.1176 - 9.1177 - @SuppressWarnings("unchecked") 9.1178 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1179 - assertEquals(1, bindings.size()); 9.1180 - assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1181 - } 9.1182 - 9.1183 - @Test 9.1184 - public void testGeofRcc8Tpp() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.1185 - { 9.1186 - String query = 9.1187 - prefixes+ 9.1188 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.1189 - "WHERE { \n" + 9.1190 - " ?s1 ex:id ?id1 . \n"+ 9.1191 - " ?s2 ex:id ?id2 . \n"+ 9.1192 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.1193 - " ?s2 ex:geometry ?g2 . \n" + 9.1194 - " ?s1 ex:geometry ?g1 . \n"+ 9.1195 - " FILTER( geof:rcc8tpp(?g1, ?g2 )) . \n"+ 9.1196 - "}"; 9.1197 - 9.1198 - @SuppressWarnings("unchecked") 9.1199 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1200 - assertEquals(1, bindings.size()); 9.1201 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1202 - } 9.1203 - 9.1204 - 9.1205 - @Test 9.1206 - public void testGeofRcc8Ntpp() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.1207 - { 9.1208 - String query = 9.1209 - prefixes+ 9.1210 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.1211 - "WHERE { \n" + 9.1212 - " ?s1 ex:id ?id1 . \n"+ 9.1213 - " ?s2 ex:id ?id2 . \n"+ 9.1214 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.1215 - " ?s2 ex:geometry ?g2 . \n" + 9.1216 - " ?s1 ex:geometry ?g1 . \n"+ 9.1217 - " FILTER( geof:rcc8ntpp(?g1, ?g2 )) . \n"+ 9.1218 - "}"; 9.1219 - 9.1220 - @SuppressWarnings("unchecked") 9.1221 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1222 - assertEquals(1, bindings.size()); 9.1223 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1224 - } 9.1225 - @Test 9.1226 - public void testGeofRcc8Ntppi() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.1227 - { 9.1228 - String query = 9.1229 - prefixes+ 9.1230 - "SELECT DISTINCT ?id1 ?id2 \n"+ 9.1231 - "WHERE { \n" + 9.1232 - " ?s1 ex:id ?id1 . \n"+ 9.1233 - " ?s2 ex:id ?id2 . \n"+ 9.1234 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 9.1235 - " ?s2 ex:geometry ?g2 . \n" + 9.1236 - " ?s1 ex:geometry ?g1 . \n"+ 9.1237 - " FILTER( geof:rcc8ntpp(?g1, ?g2 )) . \n"+ 9.1238 - "}"; 9.1239 - 9.1240 - @SuppressWarnings("unchecked") 9.1241 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 9.1242 - assertEquals(1, bindings.size()); 9.1243 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 9.1244 - } 9.1245 -}
10.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/TransformTests.java Wed Mar 18 14:03:01 2015 +0200 10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 10.3 @@ -1,85 +0,0 @@ 10.4 -/** 10.5 - * This Source Code Form is subject to the terms of the Mozilla Public 10.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 10.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 10.8 - * 10.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 10.10 - * 10.11 - * http://www.strabon.di.uoa.gr/ 10.12 - */ 10.13 -package eu.earthobservatory.runtime.generaldb; 10.14 - 10.15 -public class TransformTests { 10.16 - 10.17 - public static Strabon strabon; 10.18 - 10.19 - protected static String jdbcDriver= "org.postgresql.Driver"; 10.20 - protected static String serverName = "localhost"; 10.21 - protected static String username = "postgres"; 10.22 - protected static String password = "postgres"; 10.23 - protected static Integer port = 5432; 10.24 - protected static java.sql.Connection conn = null; 10.25 - protected static String databaseName = null; 10.26 - 10.27 - 10.28 - 10.29 - String prefixes = "PREFIX gag: <http://www.semanticweb.org/ontologies/2011/gagKallikratis.rdf#> \n"+ 10.30 - "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n"+ 10.31 - "PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> \n"+ 10.32 - "PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> \n"+ 10.33 - "PREFIX base: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> \n"+ 10.34 - "PREFIX ex: <http://www.example.org/ontology#> \n"+ 10.35 - "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + 10.36 - "PREFIX geof: <http://www.opengis.net/def/function/geosparql/> \n"; 10.37 - 10.38 - protected String query1 = prefixes + 10.39 - "SELECT ?H1 ?HAT1 ?HGEO1 " + 10.40 - "(strdf:transform(?HGEO1, <http://www.opengis.net/def/crs/EPSG/0/4326> ) AS ?converted)" + 10.41 - "(strdf:transform(strdf:union(?HGEO1,?HGEO1),<http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?united) " + 10.42 - "WHERE { \n"+ 10.43 - "?H1 rdf:type noa:Hotspot . \n"+ 10.44 - "?H1 noa:hasConfidence ?HCONF1 . \n"+ 10.45 - "?H1 noa:hasGeometry ?HGEO1 . \n"+ 10.46 - "?H1 noa:hasAcquisitionTime ?HAT1 . \n"+ 10.47 -// " FILTER(strdf:mbbIntersects(?HGEO1,?HGEO1)) "+ 10.48 - "}" + 10.49 - " LIMIT 5 \n"; 10.50 - 10.51 -// protected String query2 = prefixes + 10.52 -// "SELECT ?H1 ?H2 (strdf:transform(strdf:union(?HGEO1,?HGEO2),<http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?united)" + 10.53 -// "WHERE { \n"+ 10.54 -//// "?H1 rdf:type noa:Hotspot . \n"+ 10.55 -//// "?H2 rdf:type noa:Hotspot . \n"+ 10.56 -// "?H1 noa:hasGeometry ?HGEO1 . \n"+ 10.57 -// "?H2 noa:hasGeometry ?HGEO2 . \n"+ 10.58 -//// "?H1 noa:producedFromProcessingChain ?PC1 . \n"+ 10.59 -//// "?H2 noa:producedFromProcessingChain ?PC2 . \n"+ 10.60 -//// " FILTER(strdf:mbbIntersects(?HGEO1,?HGEO2)) "+ 10.61 -// " FILTER(?H1 != ?H2) "+ 10.62 -// "}" + 10.63 -// " LIMIT 5 \n"; 10.64 - 10.65 - 10.66 - 10.67 - protected String query3= prefixes + 10.68 - "SELECT ?H ?HGEO ?HAT " + 10.69 - "(strdf:transform(strdf:intersection(?HGEO, strdf:union(?CGEO)),<http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?DIF) \n"+ 10.70 - "WHERE { \n"+ 10.71 - " ?H rdf:type noa:Hotspot ; \n"+ 10.72 - " noa:hasAcquisitionTime ?HAT ; \n"+ 10.73 - " noa:isDerivedFromSensor ?HS ; \n"+ 10.74 - " noa:hasGeometry ?HGEO . \n"+ 10.75 - " FILTER(str(?HS) = \"MSG2\") . \n"+ 10.76 - " FILTER(str(?HAT) = \"2007-08-24T14:45:00\") . \n"+ 10.77 - " ?C rdf:type noa:Coastline ; \n"+ 10.78 - " noa:hasGeometry ?CGEO . \n"+ 10.79 - " FILTER( strdf:mbbIntersects(?HGEO, ?CGEO) ) . \n"+ 10.80 - "} \n"+ 10.81 - "GROUP BY ?H ?HAT ?HGEO\n"+ 10.82 - "HAVING strdf:overlap(strdf:union(?CGEO), ?HGEO) " + 10.83 - " "; 10.84 - 10.85 - 10.86 - 10.87 - 10.88 -}
11.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/AggregateTests.java Wed Mar 18 14:03:01 2015 +0200 11.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 11.3 @@ -1,38 +0,0 @@ 11.4 -/** 11.5 - * This Source Code Form is subject to the terms of the Mozilla Public 11.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 11.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 11.8 - * 11.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 11.10 - * 11.11 - * http://www.strabon.di.uoa.gr/ 11.12 - */ 11.13 -package eu.earthobservatory.runtime.monetdb; 11.14 - 11.15 -import java.sql.SQLException; 11.16 - 11.17 -import org.junit.AfterClass; 11.18 -import org.junit.BeforeClass; 11.19 - 11.20 -/** 11.21 - * A set of simple tests on SPARQL query functionality 11.22 - * 11.23 - * @author George Garbis <ggarbis@di.uoa.gr> 11.24 - */ 11.25 -public class AggregateTests extends eu.earthobservatory.runtime.generaldb.AggregateTests { 11.26 - 11.27 - @BeforeClass 11.28 - public static void beforeClass(String inputfile) throws Exception 11.29 - { 11.30 - strabon = TemplateTests.beforeClass("/aggregate-tests-srid.nt"); 11.31 - 11.32 - } 11.33 - 11.34 - @AfterClass 11.35 - public static void afterClass() throws SQLException 11.36 - { 11.37 - TemplateTests.afterClass(strabon); 11.38 - } 11.39 - 11.40 - 11.41 -}
12.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/GeneralTests.java Wed Mar 18 14:03:01 2015 +0200 12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 12.3 @@ -1,87 +0,0 @@ 12.4 -/** 12.5 - * This Source Code Form is subject to the terms of the Mozilla Public 12.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 12.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 12.8 - * 12.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 12.10 - * 12.11 - * http://www.strabon.di.uoa.gr/ 12.12 - */ 12.13 -package eu.earthobservatory.runtime.monetdb; 12.14 - 12.15 -import java.io.IOException; 12.16 -import java.sql.SQLException; 12.17 - 12.18 -import org.junit.AfterClass; 12.19 -import org.junit.BeforeClass; 12.20 -import org.junit.Test; 12.21 -import org.openrdf.query.MalformedQueryException; 12.22 -import org.openrdf.query.QueryEvaluationException; 12.23 -import org.openrdf.query.TupleQueryResultHandlerException; 12.24 - 12.25 -/** 12.26 - * A set of simple tests on SPARQL query functionality 12.27 - * 12.28 - * @author George Garbis <ggarbis@di.uoa.gr> 12.29 - */ 12.30 -public class GeneralTests extends eu.earthobservatory.runtime.generaldb.GeneralTests { 12.31 - 12.32 - @BeforeClass 12.33 - public static void beforeClass() throws Exception 12.34 - { 12.35 - strabon = TemplateTests.beforeClass("/more-tests.nt"); 12.36 - } 12.37 - 12.38 - @AfterClass 12.39 - public static void afterClass() throws SQLException 12.40 - { 12.41 - TemplateTests.afterClass(strabon); 12.42 - } 12.43 - 12.44 - @Test 12.45 - public void testQuerySpatialProperties() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.46 - { 12.47 - strabon.query(querySpatialPropertiesMonetDB,strabon.getSailRepoConnection()); 12.48 - 12.49 - } 12.50 - 12.51 - @Test 12.52 - public void testQuerySpatialPropertiesConst() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.53 - { 12.54 - strabon.query(querySpatialPropertiesConstMonetDB,strabon.getSailRepoConnection()); 12.55 - 12.56 - } 12.57 - 12.58 -// /** 12.59 -// * @throws java.lang.Exception 12.60 -// */ 12.61 -// @Before 12.62 -// public void before() 12.63 -// throws Exception 12.64 -// { 12.65 -// 12.66 -// } 12.67 -// 12.68 -// /** 12.69 -// * @throws java.lang.Exception 12.70 -// */ 12.71 -// @After 12.72 -// public void after() 12.73 -// throws Exception 12.74 -// { 12.75 -// // Clean database 12.76 -// Statement stmt = conn.createStatement(); 12.77 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 12.78 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 12.79 -// "and table_name <> 'geometry_columns' and " + 12.80 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 12.81 -// while (results.next()) { 12.82 -// String table_name = results.getString("table_name"); 12.83 -// Statement stmt2 = conn.createStatement(); 12.84 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 12.85 -// stmt2.close(); 12.86 -// } 12.87 -// 12.88 -// stmt.close(); 12.89 -// } 12.90 -}
13.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/HavingTests.java Wed Mar 18 14:03:01 2015 +0200 13.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 13.3 @@ -1,68 +0,0 @@ 13.4 -/** 13.5 - * This Source Code Form is subject to the terms of the Mozilla Public 13.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 13.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 13.8 - * 13.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 13.10 - * 13.11 - * http://www.strabon.di.uoa.gr/ 13.12 - */ 13.13 -package eu.earthobservatory.runtime.monetdb; 13.14 - 13.15 -import java.sql.SQLException; 13.16 - 13.17 -import org.junit.AfterClass; 13.18 -import org.junit.BeforeClass; 13.19 - 13.20 -/** 13.21 - * 13.22 - * @author George Garbis <ggarbis@di.uoa.gr> 13.23 - * 13.24 - */ 13.25 -public class HavingTests extends eu.earthobservatory.runtime.generaldb.HavingTests { 13.26 - 13.27 - @BeforeClass 13.28 - public static void beforeClass() throws Exception 13.29 - { 13.30 - strabon = TemplateTests.beforeClass("/having-tests-srid.nt"); 13.31 - } 13.32 - 13.33 - @AfterClass 13.34 - public static void afterClass() throws SQLException 13.35 - { 13.36 - TemplateTests.afterClass(strabon); 13.37 - } 13.38 - 13.39 -// /** 13.40 -// * @throws java.lang.Exception 13.41 -// */ 13.42 -// @Before 13.43 -// public void before() 13.44 -// throws Exception 13.45 -// { 13.46 -// 13.47 -// } 13.48 -// 13.49 -// /** 13.50 -// * @throws java.lang.Exception 13.51 -// */ 13.52 -// @After 13.53 -// public void after() 13.54 -// throws Exception 13.55 -// { 13.56 -// // Clean database 13.57 -// Statement stmt = conn.createStatement(); 13.58 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 13.59 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 13.60 -// "and table_name <> 'geometry_columns' and " + 13.61 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 13.62 -// while (results.next()) { 13.63 -// String table_name = results.getString("table_name"); 13.64 -// Statement stmt2 = conn.createStatement(); 13.65 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 13.66 -// stmt2.close(); 13.67 -// } 13.68 -// 13.69 -// stmt.close(); 13.70 -// } 13.71 -}
14.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/JoinTests.java Wed Mar 18 14:03:01 2015 +0200 14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 14.3 @@ -1,36 +0,0 @@ 14.4 -/** 14.5 - * This Source Code Form is subject to the terms of the Mozilla Public 14.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 14.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 14.8 - * 14.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 14.10 - * 14.11 - * http://www.strabon.di.uoa.gr/ 14.12 - */ 14.13 -package eu.earthobservatory.runtime.monetdb; 14.14 - 14.15 -import java.sql.SQLException; 14.16 - 14.17 -import org.junit.AfterClass; 14.18 -import org.junit.BeforeClass; 14.19 - 14.20 -/** 14.21 - * 14.22 - * @author George Garbis <ggarbis@di.uoa.gr> 14.23 - * 14.24 - */ 14.25 -public class JoinTests extends eu.earthobservatory.runtime.generaldb.JoinTests { 14.26 - 14.27 - @BeforeClass 14.28 - public static void beforeClass() throws Exception 14.29 - { 14.30 - strabon = TemplateTests.beforeClass("/join-tests-srid.nt"); 14.31 - } 14.32 - 14.33 - @AfterClass 14.34 - public static void afterClass() throws SQLException 14.35 - { 14.36 - TemplateTests.afterClass(strabon); 14.37 - } 14.38 - 14.39 -}
15.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/MeaningfulAggregateTests.java Wed Mar 18 14:03:01 2015 +0200 15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 15.3 @@ -1,32 +0,0 @@ 15.4 -/** 15.5 - * This Source Code Form is subject to the terms of the Mozilla Public 15.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 15.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 15.8 - * 15.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 15.10 - * 15.11 - * http://www.strabon.di.uoa.gr/ 15.12 - */ 15.13 -package eu.earthobservatory.runtime.monetdb; 15.14 - 15.15 -import java.sql.SQLException; 15.16 - 15.17 -import org.junit.AfterClass; 15.18 -import org.junit.BeforeClass; 15.19 - 15.20 -public class MeaningfulAggregateTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 15.21 - 15.22 - @BeforeClass 15.23 - public static void beforeClass() throws Exception 15.24 - { 15.25 - strabon = TemplateTests.beforeClass("/more-tests.nt"); 15.26 - } 15.27 - 15.28 - @AfterClass 15.29 - public static void afterClass() throws SQLException 15.30 - { 15.31 - TemplateTests.afterClass(strabon); 15.32 - } 15.33 - 15.34 - 15.35 -}
16.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SimpleTests.java Wed Mar 18 14:03:01 2015 +0200 16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 16.3 @@ -1,68 +0,0 @@ 16.4 -/** 16.5 - * This Source Code Form is subject to the terms of the Mozilla Public 16.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 16.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 16.8 - * 16.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 16.10 - * 16.11 - * http://www.strabon.di.uoa.gr/ 16.12 - */ 16.13 -package eu.earthobservatory.runtime.monetdb; 16.14 - 16.15 -import java.sql.SQLException; 16.16 - 16.17 -import org.junit.AfterClass; 16.18 -import org.junit.BeforeClass; 16.19 - 16.20 -/** 16.21 - * A set of simple tests on SPARQL query functionality 16.22 - * 16.23 - * @author George Garbis <ggarbis@di.uoa.gr> 16.24 - */ 16.25 -public class SimpleTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 16.26 - 16.27 - @BeforeClass 16.28 - public static void beforeClass() throws Exception 16.29 - { 16.30 - strabon = TemplateTests.beforeClass("/simple-tests.nt"); 16.31 - } 16.32 - 16.33 - @AfterClass 16.34 - public static void afterClass() throws SQLException 16.35 - { 16.36 - TemplateTests.afterClass(strabon); 16.37 - } 16.38 - 16.39 -// /** 16.40 -// * @throws java.lang.Exception 16.41 -// */ 16.42 -// @Before 16.43 -// public void before() 16.44 -// throws Exception 16.45 -// { 16.46 -// 16.47 -// } 16.48 -// 16.49 -// /** 16.50 -// * @throws java.lang.Exception 16.51 -// */ 16.52 -// @After 16.53 -// public void after() 16.54 -// throws Exception 16.55 -// { 16.56 -// // Clean database 16.57 -// Statement stmt = conn.createStatement(); 16.58 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 16.59 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 16.60 -// "and table_name <> 'geometry_columns' and " + 16.61 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 16.62 -// while (results.next()) { 16.63 -// String table_name = results.getString("table_name"); 16.64 -// Statement stmt2 = conn.createStatement(); 16.65 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 16.66 -// stmt2.close(); 16.67 -// } 16.68 -// 16.69 -// stmt.close(); 16.70 -// } 16.71 -}
17.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SpatialTests.java Wed Mar 18 14:03:01 2015 +0200 17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 17.3 @@ -1,68 +0,0 @@ 17.4 -/** 17.5 - * This Source Code Form is subject to the terms of the Mozilla Public 17.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 17.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 17.8 - * 17.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 17.10 - * 17.11 - * http://www.strabon.di.uoa.gr/ 17.12 - */ 17.13 -package eu.earthobservatory.runtime.monetdb; 17.14 - 17.15 -import java.sql.SQLException; 17.16 - 17.17 -import org.junit.AfterClass; 17.18 -import org.junit.BeforeClass; 17.19 - 17.20 -/** 17.21 - * A set of simple tests on SPARQL query functionality 17.22 - * 17.23 - * @author George Garbis <ggarbis@di.uoa.gr> 17.24 - */ 17.25 -public class SpatialTests extends eu.earthobservatory.runtime.generaldb.SpatialTests { 17.26 - 17.27 - @BeforeClass 17.28 - public static void beforeClass() throws Exception 17.29 - { 17.30 - strabon = TemplateTests.beforeClass("/spatial-tests-srid.nt"); 17.31 - } 17.32 - 17.33 - @AfterClass 17.34 - public static void afterClass() throws SQLException 17.35 - { 17.36 - TemplateTests.afterClass(strabon); 17.37 - } 17.38 - 17.39 -// /** 17.40 -// * @throws java.lang.Exception 17.41 -// */ 17.42 -// @Before 17.43 -// public void before() 17.44 -// throws Exception 17.45 -// { 17.46 -// 17.47 -// } 17.48 -// 17.49 -// /** 17.50 -// * @throws java.lang.Exception 17.51 -// */ 17.52 -// @After 17.53 -// public void after() 17.54 -// throws Exception 17.55 -// { 17.56 -// // Clean database 17.57 -// Statement stmt = conn.createStatement(); 17.58 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 17.59 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 17.60 -// "and table_name <> 'geometry_columns' and " + 17.61 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 17.62 -// while (results.next()) { 17.63 -// String table_name = results.getString("table_name"); 17.64 -// Statement stmt2 = conn.createStatement(); 17.65 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 17.66 -// stmt2.close(); 17.67 -// } 17.68 -// 17.69 -// stmt.close(); 17.70 -// } 17.71 -}
18.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TemplateTests.java Wed Mar 18 14:03:01 2015 +0200 18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 18.3 @@ -1,143 +0,0 @@ 18.4 -/** 18.5 - * This Source Code Form is subject to the terms of the Mozilla Public 18.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 18.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 18.8 - * 18.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 18.10 - * 18.11 - * http://www.strabon.di.uoa.gr/ 18.12 - */ 18.13 -package eu.earthobservatory.runtime.monetdb; 18.14 - 18.15 -import java.io.IOException; 18.16 -import java.io.InputStream; 18.17 -import java.sql.DriverManager; 18.18 -import java.sql.ResultSet; 18.19 -import java.sql.SQLException; 18.20 -import java.sql.Statement; 18.21 -import java.util.Properties; 18.22 - 18.23 -import org.junit.AfterClass; 18.24 -import org.junit.BeforeClass; 18.25 -import org.openrdf.repository.RepositoryException; 18.26 -import org.openrdf.rio.RDFHandlerException; 18.27 -import org.openrdf.rio.RDFParseException; 18.28 - 18.29 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 18.30 -import eu.earthobservatory.runtime.generaldb.Strabon; 18.31 - 18.32 -/** 18.33 - * A set of simple tests on SPARQL query functionality 18.34 - * 18.35 - * @author George Garbis <ggarbis@di.uoa.gr> 18.36 - */ 18.37 -public class TemplateTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 18.38 - 18.39 - @BeforeClass 18.40 - public static Strabon beforeClass(String inputfile) throws Exception 18.41 - { 18.42 - // Read properties 18.43 - Properties properties = new Properties(); 18.44 - InputStream propertiesStream = TemplateTests.class.getResourceAsStream("/databases.properties"); 18.45 - properties.load(propertiesStream); 18.46 - 18.47 - serverName = properties.getProperty("monetdb.serverName"); 18.48 - databaseName = properties.getProperty("monetdb.databaseName"); 18.49 - port = Integer.parseInt(properties.getProperty("monetdb.port")); 18.50 - username = properties.getProperty("monetdb.username"); 18.51 - password = properties.getProperty("monetdb.password"); 18.52 - 18.53 - // Connect to database 18.54 - Class.forName("nl.cwi.monetdb.jdbc.MonetDriver"); 18.55 - String url = "jdbc:monetdb://"+serverName+":"+port+"/"+databaseName; 18.56 - conn = DriverManager.getConnection(url, username, password); 18.57 - 18.58 -// // Clean database 18.59 - Statement stmt = conn.createStatement(); 18.60 - ResultSet results = stmt.executeQuery("SELECT name FROM tables WHERE system=false AND name <> 'locked'"); 18.61 - while (results.next()) { 18.62 - String table_name = results.getString("name"); 18.63 - Statement stmt2 = conn.createStatement(); 18.64 - stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 18.65 - stmt2.close(); 18.66 - } 18.67 - stmt.close(); 18.68 - 18.69 - Strabon strabon = new eu.earthobservatory.runtime.monetdb.Strabon(databaseName, username, password, port, serverName, true); 18.70 - 18.71 - TemplateTests.loadTestData(inputfile, strabon); 18.72 - 18.73 - // This is a workaround for http://bug.strabon.di.uoa.gr/ticket/1 18.74 - strabon.close(); 18.75 - strabon = new eu.earthobservatory.runtime.monetdb.Strabon(databaseName, username, password, port, serverName, true); 18.76 - // 18.77 - 18.78 - return strabon; 18.79 - } 18.80 - 18.81 - @AfterClass 18.82 - public static void afterClass(Strabon strabon) throws SQLException 18.83 - { 18.84 - strabon.close(); 18.85 - } 18.86 - 18.87 - protected static void loadTestData(String inputfile, Strabon strabon) 18.88 - throws RDFParseException, RepositoryException, IOException, RDFHandlerException, InvalidDatasetFormatFault 18.89 - { 18.90 - strabon.storeInRepo(inputfile, "NTRIPLES", false); 18.91 - } 18.92 - 18.93 -// /** 18.94 -// * @throws java.lang.Exception 18.95 -// */ 18.96 -// @Before 18.97 -// public void before() 18.98 -// throws Exception 18.99 -// { 18.100 -// 18.101 -// } 18.102 -// 18.103 -// /** 18.104 -// * @throws java.lang.Exception 18.105 -// */ 18.106 -// @After 18.107 -// public void after() 18.108 -// throws Exception 18.109 -// { 18.110 -// // Clean database 18.111 -// Statement stmt = conn.createStatement(); 18.112 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 18.113 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 18.114 -// "and table_name <> 'geometry_columns' and " + 18.115 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 18.116 -// while (results.next()) { 18.117 -// String table_name = results.getString("table_name"); 18.118 -// Statement stmt2 = conn.createStatement(); 18.119 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 18.120 -// stmt2.close(); 18.121 -// } 18.122 -// 18.123 -// stmt.close(); 18.124 -// } 18.125 -} 18.126 -// */ 18.127 -// @After 18.128 -// public void after() 18.129 -// throws Exception 18.130 -// { 18.131 -// // Clean database 18.132 -// Statement stmt = conn.createStatement(); 18.133 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 18.134 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 18.135 -// "and table_name <> 'geometry_columns' and " + 18.136 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 18.137 -// while (results.next()) { 18.138 -// String table_name = results.getString("table_name"); 18.139 -// Statement stmt2 = conn.createStatement(); 18.140 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 18.141 -// stmt2.close(); 18.142 -// } 18.143 -// 18.144 -// stmt.close(); 18.145 -// } 18.146 -
19.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TransformTests.java Wed Mar 18 14:03:01 2015 +0200 19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 19.3 @@ -1,36 +0,0 @@ 19.4 -/** 19.5 - * This Source Code Form is subject to the terms of the Mozilla Public 19.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 19.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 19.8 - * 19.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 19.10 - * 19.11 - * http://www.strabon.di.uoa.gr/ 19.12 - */ 19.13 -package eu.earthobservatory.runtime.monetdb; 19.14 - 19.15 -import java.sql.SQLException; 19.16 - 19.17 -import org.junit.AfterClass; 19.18 -import org.junit.BeforeClass; 19.19 - 19.20 -/** 19.21 - * A set of simple tests on SPARQL query functionality 19.22 - * 19.23 - * @author George Garbis <ggarbis@di.uoa.gr> 19.24 - */ 19.25 -public class TransformTests extends eu.earthobservatory.runtime.generaldb.TransformTests { 19.26 - 19.27 - @BeforeClass 19.28 - public static void beforeClass() throws Exception 19.29 - { 19.30 - strabon = TemplateTests.beforeClass("/transform-tests.nt"); 19.31 - } 19.32 - 19.33 - @AfterClass 19.34 - public static void afterClass() throws SQLException 19.35 - { 19.36 - TemplateTests.afterClass(strabon); 19.37 - } 19.38 - 19.39 -}
20.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/AggregateTests.java Wed Mar 18 14:03:01 2015 +0200 20.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 20.3 @@ -1,32 +0,0 @@ 20.4 -/** 20.5 - * This Source Code Form is subject to the terms of the Mozilla Public 20.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 20.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 20.8 - * 20.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 20.10 - * 20.11 - * http://www.strabon.di.uoa.gr/ 20.12 - */ 20.13 -package eu.earthobservatory.runtime.postgis; 20.14 - 20.15 -import java.sql.SQLException; 20.16 - 20.17 -import org.junit.AfterClass; 20.18 -import org.junit.BeforeClass; 20.19 - 20.20 - 20.21 -public class AggregateTests extends eu.earthobservatory.runtime.generaldb.AggregateTests { 20.22 - 20.23 - @BeforeClass 20.24 - public static void beforeClass() throws Exception 20.25 - { 20.26 - strabon = TemplateTests.beforeClass("/aggregate-tests-srid.nt"); 20.27 - } 20.28 - 20.29 - @AfterClass 20.30 - public static void afterClass() throws SQLException 20.31 - { 20.32 - TemplateTests.afterClass(strabon); 20.33 - } 20.34 - 20.35 -}
21.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/AllTests.java Wed Mar 18 14:03:01 2015 +0200 21.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 21.3 @@ -1,13 +0,0 @@ 21.4 -package eu.earthobservatory.runtime.postgis; 21.5 - 21.6 -import org.junit.runner.RunWith; 21.7 -import org.junit.runners.Suite; 21.8 -import org.junit.runners.Suite.SuiteClasses; 21.9 - 21.10 -@RunWith(Suite.class) 21.11 -@SuiteClasses({ AggregateTests.class, GeneralTests.class, HavingTests.class, 21.12 - JoinTests.class, MeaningfulAggregateTests.class, SimpleTests.class, 21.13 - SPARQL11Tests.class, SpatialTests.class }) 21.14 -public class AllTests { 21.15 - 21.16 -}
22.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/GeneralTests.java Wed Mar 18 14:03:01 2015 +0200 22.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 22.3 @@ -1,88 +0,0 @@ 22.4 -/** 22.5 - * This Source Code Form is subject to the terms of the Mozilla Public 22.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 22.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 22.8 - * 22.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 22.10 - * 22.11 - * http://www.strabon.di.uoa.gr/ 22.12 - */ 22.13 -package eu.earthobservatory.runtime.postgis; 22.14 - 22.15 -import java.io.IOException; 22.16 -import java.sql.SQLException; 22.17 - 22.18 -import org.junit.AfterClass; 22.19 -import org.junit.BeforeClass; 22.20 -import org.junit.Test; 22.21 -import org.openrdf.query.MalformedQueryException; 22.22 -import org.openrdf.query.QueryEvaluationException; 22.23 -import org.openrdf.query.TupleQueryResultHandlerException; 22.24 - 22.25 -/** 22.26 - * A set of simple tests on SPARQL query functionality 22.27 - * 22.28 - * @author George Garbis <ggarbis@di.uoa.gr> 22.29 - */ 22.30 -public class GeneralTests extends eu.earthobservatory.runtime.generaldb.GeneralTests { 22.31 - 22.32 - @BeforeClass 22.33 - public static void beforeClass() throws Exception 22.34 - { 22.35 - strabon = TemplateTests.beforeClass("/more-tests.nt"); 22.36 - } 22.37 - 22.38 - @AfterClass 22.39 - public static void afterClass() throws SQLException 22.40 - { 22.41 - TemplateTests.afterClass(strabon); 22.42 - } 22.43 - 22.44 - @Test 22.45 - public void testQuerySpatialProperties() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 22.46 - { 22.47 - strabon.query(querySpatialPropertiesPostGIS,strabon.getSailRepoConnection()); 22.48 - 22.49 - } 22.50 - 22.51 - @Test 22.52 - public void testQuerySpatialPropertiesConst() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 22.53 - { 22.54 - strabon.query(querySpatialPropertiesConstPostGIS,strabon.getSailRepoConnection()); 22.55 - 22.56 - } 22.57 - 22.58 - 22.59 -// /** 22.60 -// * @throws java.lang.Exception 22.61 -// */ 22.62 -// @Before 22.63 -// public void before() 22.64 -// throws Exception 22.65 -// { 22.66 -// 22.67 -// } 22.68 -// 22.69 -// /** 22.70 -// * @throws java.lang.Exception 22.71 -// */ 22.72 -// @After 22.73 -// public void after() 22.74 -// throws Exception 22.75 -// { 22.76 -// // Clean database 22.77 -// Statement stmt = conn.createStatement(); 22.78 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 22.79 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 22.80 -// "and table_name <> 'geometry_columns' and " + 22.81 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 22.82 -// while (results.next()) { 22.83 -// String table_name = results.getString("table_name"); 22.84 -// Statement stmt2 = conn.createStatement(); 22.85 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 22.86 -// stmt2.close(); 22.87 -// } 22.88 -// 22.89 -// stmt.close(); 22.90 -// } 22.91 -}
23.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/HavingTests.java Wed Mar 18 14:03:01 2015 +0200 23.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 23.3 @@ -1,32 +0,0 @@ 23.4 -/** 23.5 - * This Source Code Form is subject to the terms of the Mozilla Public 23.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 23.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 23.8 - * 23.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 23.10 - * 23.11 - * http://www.strabon.di.uoa.gr/ 23.12 - */ 23.13 -package eu.earthobservatory.runtime.postgis; 23.14 - 23.15 -import java.sql.SQLException; 23.16 - 23.17 -import org.junit.AfterClass; 23.18 -import org.junit.BeforeClass; 23.19 - 23.20 - 23.21 -public class HavingTests extends eu.earthobservatory.runtime.generaldb.HavingTests { 23.22 - 23.23 - @BeforeClass 23.24 - public static void beforeClass() throws Exception 23.25 - { 23.26 - strabon = TemplateTests.beforeClass("/having-tests-srid.nt"); 23.27 - } 23.28 - 23.29 - @AfterClass 23.30 - public static void afterClass() throws SQLException 23.31 - { 23.32 - TemplateTests.afterClass(strabon); 23.33 - } 23.34 - 23.35 -}
24.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/JoinTests.java Wed Mar 18 14:03:01 2015 +0200 24.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 24.3 @@ -1,31 +0,0 @@ 24.4 -/** 24.5 - * This Source Code Form is subject to the terms of the Mozilla Public 24.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 24.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 24.8 - * 24.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 24.10 - * 24.11 - * http://www.strabon.di.uoa.gr/ 24.12 - */ 24.13 -package eu.earthobservatory.runtime.postgis; 24.14 - 24.15 -import java.sql.SQLException; 24.16 - 24.17 -import org.junit.AfterClass; 24.18 -import org.junit.BeforeClass; 24.19 - 24.20 -public class JoinTests extends eu.earthobservatory.runtime.generaldb.JoinTests { 24.21 - 24.22 - @BeforeClass 24.23 - public static void beforeClass() throws Exception 24.24 - { 24.25 - strabon = TemplateTests.beforeClass("/join-tests-srid.nt"); 24.26 - } 24.27 - 24.28 - @AfterClass 24.29 - public static void afterClass() throws SQLException 24.30 - { 24.31 - TemplateTests.afterClass(strabon); 24.32 - } 24.33 - 24.34 -}
25.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/MeaningfulAggregateTests.java Wed Mar 18 14:03:01 2015 +0200 25.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 25.3 @@ -1,35 +0,0 @@ 25.4 -/** 25.5 - * This Source Code Form is subject to the terms of the Mozilla Public 25.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 25.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 25.8 - * 25.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 25.10 - * 25.11 - * http://www.strabon.di.uoa.gr/ 25.12 - */ 25.13 -package eu.earthobservatory.runtime.postgis; 25.14 - 25.15 -import java.sql.SQLException; 25.16 - 25.17 -import org.junit.AfterClass; 25.18 -import org.junit.BeforeClass; 25.19 - 25.20 - 25.21 -public class MeaningfulAggregateTests extends eu.earthobservatory.runtime.generaldb.MeaningfulAggregateTests { 25.22 - 25.23 - 25.24 - @BeforeClass 25.25 - public static void beforeClass() throws Exception 25.26 - { 25.27 - strabon = TemplateTests.beforeClass("/group-tests-srid.nt"); 25.28 - } 25.29 - 25.30 - @AfterClass 25.31 - public static void afterClass() throws SQLException 25.32 - { 25.33 - TemplateTests.afterClass(strabon); 25.34 - } 25.35 - 25.36 - 25.37 - 25.38 -} 25.39 \ No newline at end of file
26.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SPARQL11Tests.java Wed Mar 18 14:03:01 2015 +0200 26.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 26.3 @@ -1,71 +0,0 @@ 26.4 -/** 26.5 - * This Source Code Form is subject to the terms of the Mozilla Public 26.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 26.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 26.8 - * 26.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 26.10 - * 26.11 - * http://www.strabon.di.uoa.gr/ 26.12 - */ 26.13 -package eu.earthobservatory.runtime.postgis; 26.14 - 26.15 -import java.sql.SQLException; 26.16 - 26.17 -import org.junit.AfterClass; 26.18 -import org.junit.BeforeClass; 26.19 - 26.20 -/** 26.21 - * A set of simple tests on SPARQL query functionality 26.22 - * 26.23 - * @author George Garbis <ggarbis@di.uoa.gr> 26.24 - */ 26.25 - 26.26 -public class SPARQL11Tests extends eu.earthobservatory.runtime.generaldb.SPARQL11Tests { 26.27 - 26.28 - @BeforeClass 26.29 - public static void beforeClass() throws Exception 26.30 - { 26.31 - strabon = TemplateTests.beforeClass("/sparql11-tests.nt"); 26.32 - } 26.33 - 26.34 - @AfterClass 26.35 - public static void afterClass() throws SQLException 26.36 - { 26.37 - TemplateTests.afterClass(strabon); 26.38 - } 26.39 - 26.40 - 26.41 - 26.42 -// /** 26.43 -// * @throws java.lang.Exception 26.44 -// */ 26.45 -// @Before 26.46 -// public void before() 26.47 -// throws Exception 26.48 -// { 26.49 -// 26.50 -// } 26.51 -// 26.52 -// /** 26.53 -// * @throws java.lang.Exception 26.54 -// */ 26.55 -// @After 26.56 -// public void after() 26.57 -// throws Exception 26.58 -// { 26.59 -// // Clean database 26.60 -// Statement stmt = conn.createStatement(); 26.61 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 26.62 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 26.63 -// "and table_name <> 'geometry_columns' and " + 26.64 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 26.65 -// while (results.next()) { 26.66 -// String table_name = results.getString("table_name"); 26.67 -// Statement stmt2 = conn.createStatement(); 26.68 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 26.69 -// stmt2.close(); 26.70 -// } 26.71 -// 26.72 -// stmt.close(); 26.73 -// } 26.74 -}
27.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SimpleTests.java Wed Mar 18 14:03:01 2015 +0200 27.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 27.3 @@ -1,68 +0,0 @@ 27.4 -/** 27.5 - * This Source Code Form is subject to the terms of the Mozilla Public 27.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 27.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 27.8 - * 27.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 27.10 - * 27.11 - * http://www.strabon.di.uoa.gr/ 27.12 - */ 27.13 -package eu.earthobservatory.runtime.postgis; 27.14 - 27.15 -import java.sql.SQLException; 27.16 - 27.17 -import org.junit.AfterClass; 27.18 -import org.junit.BeforeClass; 27.19 - 27.20 -/** 27.21 - * A set of simple tests on SPARQL query functionality 27.22 - * 27.23 - * @author George Garbis <ggarbis@di.uoa.gr 27.24 - */ 27.25 -public class SimpleTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 27.26 - 27.27 - @BeforeClass 27.28 - public static void beforeClass() throws Exception 27.29 - { 27.30 - strabon = TemplateTests.beforeClass("/simple-tests.nt"); 27.31 - } 27.32 - 27.33 - @AfterClass 27.34 - public static void afterClass() throws SQLException 27.35 - { 27.36 - TemplateTests.afterClass(strabon); 27.37 - } 27.38 - 27.39 -// /** 27.40 -// * @throws java.lang.Exception 27.41 -// */ 27.42 -// @Before 27.43 -// public void before() 27.44 -// throws Exception 27.45 -// { 27.46 -// 27.47 -// } 27.48 -// 27.49 -// /** 27.50 -// * @throws java.lang.Exception 27.51 -// */ 27.52 -// @After 27.53 -// public void after() 27.54 -// throws Exception 27.55 -// { 27.56 -// // Clean database 27.57 -// Statement stmt = conn.createStatement(); 27.58 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 27.59 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 27.60 -// "and table_name <> 'geometry_columns' and " + 27.61 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 27.62 -// while (results.next()) { 27.63 -// String table_name = results.getString("table_name"); 27.64 -// Statement stmt2 = conn.createStatement(); 27.65 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 27.66 -// stmt2.close(); 27.67 -// } 27.68 -// 27.69 -// stmt.close(); 27.70 -// } 27.71 -}
28.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SpatialTests.java Wed Mar 18 14:03:01 2015 +0200 28.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 28.3 @@ -1,69 +0,0 @@ 28.4 -/** 28.5 - * This Source Code Form is subject to the terms of the Mozilla Public 28.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 28.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 28.8 - * 28.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 28.10 - * 28.11 - * http://www.strabon.di.uoa.gr/ 28.12 - */ 28.13 -package eu.earthobservatory.runtime.postgis; 28.14 - 28.15 -import java.sql.SQLException; 28.16 - 28.17 -import org.junit.AfterClass; 28.18 -import org.junit.BeforeClass; 28.19 - 28.20 -/** 28.21 - * A set of simple tests on SPARQL query functionality 28.22 - * 28.23 - * @author George Garbis <ggarbis@di.uoa.gr> 28.24 - */ 28.25 - 28.26 -public class SpatialTests extends eu.earthobservatory.runtime.generaldb.SpatialTests { 28.27 - 28.28 - @BeforeClass 28.29 - public static void beforeClass() throws Exception 28.30 - { 28.31 - strabon = TemplateTests.beforeClass("/spatial-tests-srid.nt"); 28.32 - } 28.33 - 28.34 - @AfterClass 28.35 - public static void afterClass() throws SQLException 28.36 - { 28.37 - TemplateTests.afterClass(strabon); 28.38 - } 28.39 - 28.40 -// /** 28.41 -// * @throws java.lang.Exception 28.42 -// */ 28.43 -// @Before 28.44 -// public void before() 28.45 -// throws Exception 28.46 -// { 28.47 -// 28.48 -// } 28.49 -// 28.50 -// /** 28.51 -// * @throws java.lang.Exception 28.52 -// */ 28.53 -// @After 28.54 -// public void after() 28.55 -// throws Exception 28.56 -// { 28.57 -// // Clean database 28.58 -// Statement stmt = conn.createStatement(); 28.59 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 28.60 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 28.61 -// "and table_name <> 'geometry_columns' and " + 28.62 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 28.63 -// while (results.next()) { 28.64 -// String table_name = results.getString("table_name"); 28.65 -// Statement stmt2 = conn.createStatement(); 28.66 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 28.67 -// stmt2.close(); 28.68 -// } 28.69 -// 28.70 -// stmt.close(); 28.71 -// } 28.72 -}
29.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TemplateTests.java Wed Mar 18 14:03:01 2015 +0200 29.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 29.3 @@ -1,180 +0,0 @@ 29.4 -/** 29.5 - * This Source Code Form is subject to the terms of the Mozilla Public 29.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 29.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 29.8 - * 29.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 29.10 - * 29.11 - * http://www.strabon.di.uoa.gr/ 29.12 - */ 29.13 -package eu.earthobservatory.runtime.postgis; 29.14 - 29.15 -import static org.junit.Assert.assertNull; 29.16 - 29.17 -import java.io.IOException; 29.18 -import java.io.InputStream; 29.19 -import java.sql.Connection; 29.20 -import java.sql.DriverManager; 29.21 -import java.sql.PreparedStatement; 29.22 -import java.sql.ResultSet; 29.23 -import java.sql.SQLException; 29.24 -import java.util.ArrayList; 29.25 -import java.util.Properties; 29.26 - 29.27 -import org.junit.AfterClass; 29.28 -import org.junit.BeforeClass; 29.29 -import org.openrdf.repository.RepositoryException; 29.30 -import org.openrdf.rio.RDFHandlerException; 29.31 -import org.openrdf.rio.RDFParseException; 29.32 - 29.33 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 29.34 -import eu.earthobservatory.runtime.generaldb.SimpleTests; 29.35 -import eu.earthobservatory.runtime.generaldb.Strabon; 29.36 - 29.37 -/** 29.38 - * A set of simple tests on SPARQL query functionality 29.39 - * 29.40 - * @author George Garbis <ggarbis@di.uoa.gr> 29.41 - * @author Panayiotis Smeros <psmeros@di.uoa.gr> 29.42 - */ 29.43 -public class TemplateTests { 29.44 - 29.45 - public static String databaseTemplateName = null; 29.46 - public static String defaultUser = null; 29.47 - public static String serverName = null; 29.48 - public static String username = null; 29.49 - public static String password = null; 29.50 - public static Integer port = null; 29.51 - 29.52 - public static Connection conn = null; 29.53 - public static String databaseName = null; 29.54 - 29.55 - @BeforeClass 29.56 - public static Strabon beforeClass(String inputFile) throws Exception 29.57 - { 29.58 - String url=""; 29.59 - ArrayList<String> databases=new ArrayList<String>(); 29.60 - PreparedStatement pst = null; 29.61 - 29.62 - // Read properties 29.63 - Properties properties = new Properties(); 29.64 - InputStream propertiesStream = SimpleTests.class.getResourceAsStream("/databases.properties"); 29.65 - properties.load(propertiesStream); 29.66 - 29.67 - databaseTemplateName = properties.getProperty("postgis.databaseTemplateName");; 29.68 - defaultUser = properties.getProperty("postgis.defaultUser"); 29.69 - serverName = properties.getProperty("postgis.serverName"); 29.70 - username = properties.getProperty("postgis.username"); 29.71 - password = properties.getProperty("postgis.password"); 29.72 - port = Integer.parseInt(properties.getProperty("postgis.port")); 29.73 - 29.74 - //Connect to server and create the temp database 29.75 - url = "jdbc:postgresql://"+serverName+":"+port+"/"+defaultUser; 29.76 - conn = DriverManager.getConnection(url, username, password); 29.77 - assertNull(conn.getWarnings()); 29.78 - 29.79 - pst = conn.prepareStatement("SELECT * FROM pg_catalog.pg_database"); 29.80 - ResultSet rs = pst.executeQuery(); 29.81 - 29.82 - while (rs.next()) { 29.83 - databases.add(rs.getString(1)); 29.84 - } 29.85 - rs.close(); 29.86 - pst.close(); 29.87 - 29.88 - databaseName="teststrabon"+(int)(Math.random()*10000); 29.89 - while(databases.contains(databaseName)){ 29.90 - databaseName+="0"; 29.91 - } 29.92 - 29.93 - 29.94 - pst = conn.prepareStatement("CREATE DATABASE "+databaseName+" TEMPLATE " + databaseTemplateName); 29.95 - pst.executeUpdate(); 29.96 - pst.close(); 29.97 - conn.close(); 29.98 - 29.99 - url = "jdbc:postgresql://"+serverName+":"+port+"/"+databaseName; 29.100 - conn = DriverManager.getConnection(url, username, password); 29.101 - assertNull(conn.getWarnings()); 29.102 - 29.103 - Strabon strabon = new eu.earthobservatory.runtime.postgis.Strabon(databaseName, username, password, port, serverName, true); 29.104 - 29.105 - loadTestData(inputFile, strabon); 29.106 - 29.107 - return strabon; 29.108 - } 29.109 - 29.110 - 29.111 - @AfterClass 29.112 - public static void afterClass(Strabon strabon) throws SQLException 29.113 - { 29.114 - strabon.close(); 29.115 - 29.116 - //Drop the temp database 29.117 - conn.close(); 29.118 - String url = "jdbc:postgresql://"+serverName+":"+port+"/"+defaultUser; 29.119 - conn = DriverManager.getConnection(url, username, password); 29.120 - assertNull(conn.getWarnings()); 29.121 - 29.122 - PreparedStatement pst = conn.prepareStatement("DROP DATABASE "+databaseName); 29.123 - pst.executeUpdate(); 29.124 - pst.close(); 29.125 - conn.close(); 29.126 - } 29.127 - 29.128 - protected static void loadTestData(String inputfile, Strabon strabon) 29.129 - throws RDFParseException, RepositoryException, IOException, RDFHandlerException, InvalidDatasetFormatFault 29.130 - { 29.131 - strabon.storeInRepo(inputfile, "NTRIPLES", false); 29.132 - } 29.133 - 29.134 - 29.135 - // Clean database 29.136 -// Statement stmt = conn.createStatement(); 29.137 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 29.138 -// "table_schema='public' AND table_name <> 'spatial_ref_sys' " + 29.139 -// "AND table_name <> 'geometry_columns' AND table_name <> 'geography_columns' " + 29.140 -// "AND table_name <> 'raster_columns' AND table_name <> 'raster_overviews' " + 29.141 -// "AND table_name <> 'locked'" 29.142 -// ); 29.143 -// while (results.next()) { 29.144 -// String table_name = results.getString("table_name"); 29.145 -// Statement stmt2 = conn.createStatement(); 29.146 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 29.147 -// stmt2.close(); 29.148 -// } 29.149 -// stmt.close(); 29.150 - 29.151 -// /** 29.152 -// * @throws java.lang.Exception 29.153 -// */ 29.154 -// @Before 29.155 -// public void before() 29.156 -// throws Exception 29.157 -// { 29.158 -// 29.159 -// } 29.160 -// 29.161 -// /** 29.162 -// * @throws java.lang.Exception 29.163 -// */ 29.164 -// @After 29.165 -// public void after() 29.166 -// throws Exception 29.167 -// { 29.168 -// // Clean database 29.169 -// Statement stmt = conn.createStatement(); 29.170 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 29.171 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 29.172 -// "and table_name <> 'geometry_columns' and " + 29.173 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 29.174 -// while (results.next()) { 29.175 -// String table_name = results.getString("table_name"); 29.176 -// Statement stmt2 = conn.createStatement(); 29.177 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 29.178 -// stmt2.close(); 29.179 -// } 29.180 -// 29.181 -// stmt.close(); 29.182 -// } 29.183 -}
30.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TransformTests.java Wed Mar 18 14:03:01 2015 +0200 30.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 30.3 @@ -1,69 +0,0 @@ 30.4 -/** 30.5 - * This Source Code Form is subject to the terms of the Mozilla Public 30.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 30.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 30.8 - * 30.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 30.10 - * 30.11 - * http://www.strabon.di.uoa.gr/ 30.12 - */ 30.13 -package eu.earthobservatory.runtime.postgis; 30.14 - 30.15 -import java.sql.SQLException; 30.16 - 30.17 -import org.junit.AfterClass; 30.18 -import org.junit.BeforeClass; 30.19 - 30.20 -/** 30.21 - * A set of simple tests on SPARQL query functionality 30.22 - * 30.23 - * @author George Garbis <ggarbis@di.uoa.gr> 30.24 - */ 30.25 - 30.26 -public class TransformTests extends eu.earthobservatory.runtime.generaldb.TransformTests { 30.27 - 30.28 - @BeforeClass 30.29 - public static void beforeClass() throws Exception 30.30 - { 30.31 - strabon = TemplateTests.beforeClass("/transform-tests.nt"); 30.32 - } 30.33 - 30.34 - @AfterClass 30.35 - public static void afterClass() throws SQLException 30.36 - { 30.37 - TemplateTests.afterClass(strabon); 30.38 - } 30.39 - 30.40 -// /** 30.41 -// * @throws java.lang.Exception 30.42 -// */ 30.43 -// @Before 30.44 -// public void before() 30.45 -// throws Exception 30.46 -// { 30.47 -// 30.48 -// } 30.49 -// 30.50 -// /** 30.51 -// * @throws java.lang.Exception 30.52 -// */ 30.53 -// @After 30.54 -// public void after() 30.55 -// throws Exception 30.56 -// { 30.57 -// // Clean database 30.58 -// Statement stmt = conn.createStatement(); 30.59 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 30.60 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 30.61 -// "and table_name <> 'geometry_columns' and " + 30.62 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 30.63 -// while (results.next()) { 30.64 -// String table_name = results.getString("table_name"); 30.65 -// Statement stmt2 = conn.createStatement(); 30.66 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 30.67 -// stmt2.close(); 30.68 -// } 30.69 -// 30.70 -// stmt.close(); 30.71 -// } 30.72 -}
31.1 --- a/runtime/src/test/resources/aggregate-tests-srid.nt Wed Mar 18 14:03:01 2015 +0200 31.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 31.3 @@ -1,46 +0,0 @@ 31.4 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87631 50.7213)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 31.5 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2000/01/rdf-schema#label> "Rosie's". 31.6 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2000/01/rdf-schema#label> "Coffee Republic". 31.7 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2000/01/rdf-schema#label> "Norwegian Wood". 31.8 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87647 50.721)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 31.9 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.83702 50.7272)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 31.10 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 31.11 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 31.12 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 31.13 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 31.14 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 31.15 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 31.16 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 31.17 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 31.18 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 31.19 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.81769 50.7218)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 31.20 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2000/01/rdf-schema#label> "The Clock Café". 31.21 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84845 50.7231)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 31.22 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84667 50.7317)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 31.23 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87346 50.7214)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 31.24 -<http://linkedgeodata.org/ontology/Node122> <http://linkedgeodata.org/ontology/bufferExtent> "2"^^<http://www.w3.org/2001/XMLSchema#integer>. 31.25 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87652 50.7214)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 31.26 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2000/01/rdf-schema#label> "Café Riva". 31.27 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2000/01/rdf-schema#label> "Curzon Diner". 31.28 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84186 50.7255)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 31.29 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2000/01/rdf-schema#label> "Boscanova". 31.30 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2000/01/rdf-schema#label> "Caffe Nero". 31.31 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2000/01/rdf-schema#label> "Costa". 31.32 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 31.33 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 31.34 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 31.35 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 31.36 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 31.37 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 31.38 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 31.39 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 31.40 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 31.41 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 31.42 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 31.43 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 31.44 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 31.45 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 31.46 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 31.47 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 31.48 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 31.49 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>.
32.1 --- a/runtime/src/test/resources/cco2.nt Wed Mar 18 14:03:01 2015 +0200 32.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 32.3 @@ -1,46 +0,0 @@ 32.4 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87631 50.7213)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 32.5 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2000/01/rdf-schema#label> "Rosie's". 32.6 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2000/01/rdf-schema#label> "Coffee Republic". 32.7 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2000/01/rdf-schema#label> "Norwegian Wood". 32.8 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87647 50.721)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 32.9 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.83702 50.7272)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 32.10 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 32.11 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 32.12 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 32.13 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 32.14 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 32.15 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 32.16 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 32.17 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 32.18 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 32.19 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.81769 50.7218)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 32.20 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2000/01/rdf-schema#label> "The Clock Café". 32.21 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84845 50.7231)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 32.22 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84667 50.7317)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 32.23 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87346 50.7214)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 32.24 -<http://linkedgeodata.org/ontology/Node122> <http://linkedgeodata.org/ontology/bufferExtent> "2"^^<http://www.w3.org/2001/XMLSchema#integer>. 32.25 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87652 50.7214)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 32.26 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2000/01/rdf-schema#label> "Café Riva". 32.27 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2000/01/rdf-schema#label> "Curzon Diner". 32.28 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84186 50.7255)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 32.29 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2000/01/rdf-schema#label> "Boscanova". 32.30 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2000/01/rdf-schema#label> "Caffe Nero". 32.31 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2000/01/rdf-schema#label> "Costa". 32.32 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 32.33 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 32.34 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 32.35 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 32.36 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 32.37 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 32.38 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 32.39 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 32.40 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 32.41 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 32.42 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 32.43 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 32.44 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 32.45 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 32.46 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 32.47 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 32.48 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 32.49 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>.
33.1 --- a/runtime/src/test/resources/databases.properties Wed Mar 18 14:03:01 2015 +0200 33.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 33.3 @@ -1,14 +0,0 @@ 33.4 -# PostGIS 33.5 -postgis.databaseTemplateName = template_postgis 33.6 -postgis.defaultUser = postgres 33.7 -postgis.serverName = localhost 33.8 -postgis.username = postgres 33.9 -postgis.password = postgres 33.10 -postgis.port = 5432 33.11 - 33.12 -! MonetDB 33.13 -monetdb.databaseName = strabon-test 33.14 -monetdb.serverName = localhost 33.15 -monetdb.username = monetdb 33.16 -monetdb.password = monetdb 33.17 -monetdb.port = 50000
34.1 --- a/runtime/src/test/resources/group-tests-srid.nt Wed Mar 18 14:03:01 2015 +0200 34.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 34.3 @@ -1,22 +0,0 @@ 34.4 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 34.5 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 34.6 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 34.7 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot4> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 34.8 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot5> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 34.9 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot6> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 34.10 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea>. 34.11 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea>. 34.12 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea>. 34.13 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea>. 34.14 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea>. 34.15 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot1> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(10 10)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 34.16 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot2> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(5 6)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 34.17 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot3> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(10 10)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 34.18 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot4> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(0 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 34.19 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot5> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(10 10)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 34.20 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot6> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(5 6)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 34.21 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea1> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((20 20, 20 22, 22 22, 22 20, 20 20))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 34.22 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea2> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((23 18, 24 19, 23 19, 23 18))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 34.23 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea3> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((20 15, 21 15, 21 16, 20 15))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 34.24 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea1> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((21.5 18.5, 23.5 18.5, 23.5 21, 21.5 21, 21.5 18.5))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 34.25 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea2> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((19 19, 21 19, 21 21, 19 21, 19 19))"^^<http://strdf.di.uoa.gr/ontology#WKT>.
35.1 --- a/runtime/src/test/resources/having-tests-srid.nt Wed Mar 18 14:03:01 2015 +0200 35.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 35.3 @@ -1,26 +0,0 @@ 35.4 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 35.5 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 35.6 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 35.7 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot4> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 35.8 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot5> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 35.9 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot6> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot>. 35.10 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea>. 35.11 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea>. 35.12 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea>. 35.13 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea>. 35.14 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea>. 35.15 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea1> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#reliability> "52"^^<http://www.w3.org/2001/XMLSchema#integer>. 35.16 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea1> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#reliability> "47"^^<http://www.w3.org/2001/XMLSchema#integer>. 35.17 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea2> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#reliability> "11"^^<http://www.w3.org/2001/XMLSchema#integer>. 35.18 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea3> <http://www.earthobservatory.eu/ontologies/noaOntology.owl#reliability> "19"^^<http://www.w3.org/2001/XMLSchema#integer>. 35.19 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot1> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(10 10)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 35.20 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot2> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(5 6)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 35.21 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot3> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(10 10)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 35.22 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot4> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(0 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 35.23 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot5> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(10 10)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 35.24 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#Hotspot6> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(5 6)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 35.25 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea1> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((20 20, 20 22, 22 22, 22 20, 20 20))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 35.26 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea2> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((23 18, 24 19, 23 19, 23 18))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 35.27 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#BurntArea3> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((20 15, 21 15, 21 16, 20 15))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 35.28 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea1> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((21.5 18.5, 23.5 18.5, 23.5 21, 21.5 21, 21.5 18.5))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 35.29 -<http://www.earthobservatory.eu/ontologies/noaOntology.owl#UrbanArea2> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((19 19, 21 19, 21 21, 19 21, 19 19))"^^<http://strdf.di.uoa.gr/ontology#WKT>.
36.1 --- a/runtime/src/test/resources/join-tests-srid.nt Wed Mar 18 14:03:01 2015 +0200 36.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 36.3 @@ -1,20 +0,0 @@ 36.4 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#Area88> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> "POINT(0 1)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 36.5 -<http://dbpedia.org/ontology/PopulatedPlaceGeoNames> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> "POINT(3 5)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 36.6 -<http://dbpedia.org/ontology/PopulatedPlaceGeoNames> <http://www.w3.org/2002/07/owl#sameAs> <http://dbpedia.org/ontology/PopulatedPlace9>. 36.7 -<http://linkedgeodata.org/ontology/Node1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/NaturalWood>. 36.8 -<http://dbpedia.org/ontology/PopulatedPlace9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/PopulatedPlace>. 36.9 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#LandArea9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#Area>. 36.10 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#Area88> <http://www.geonames.org/ontology#name> "London". 36.11 -<http://linkedgeodata.org/ontology/Node1> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(1 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 36.12 -<http://pachube.org/ontology/SensorSystem1> <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> <http://pachube.org/ontology/System1>. 36.13 -<http://pachube.org/ontology/SensorSystem9> <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> <http://pachube.org/ontology/System9>. 36.14 -<http://pachube.org/ontology/SensorDeployment1> <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> <http://pachube.org/ontology/SensorSystem1>. 36.15 -<http://pachube.org/ontology/SensorDeployment9> <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> <http://pachube.org/ontology/SensorSystem9>. 36.16 -<http://pachube.org/ontology/SensorDeployment1> <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> <http://pachube.org/ontology/SensorPlatform1>. 36.17 -<http://pachube.org/ontology/SensorDeployment9> <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> <http://pachube.org/ontology/SensorPlatform9>. 36.18 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#LandArea9> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasLandUse> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#portAreas>. 36.19 -<http://pachube.org/ontology/SensorPlatform1> <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> <http://pachube.org/ontology/Tajikistan>. 36.20 -<http://pachube.org/ontology/SensorPlatform9> <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> <http://pachube.org/ontology/Kikirikistan>. 36.21 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#LandArea9> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeometry> "POINT(0 5)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 36.22 -<http://pachube.org/ontology/Tajikistan> <http://dbpedia.org/property/hasGeometry> "POINT(0 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 36.23 -<http://pachube.org/ontology/Kikirikistan> <http://dbpedia.org/property/hasGeometry> "POINT(2 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>.
37.1 --- a/runtime/src/test/resources/join-tests.nt Wed Mar 18 14:03:01 2015 +0200 37.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 37.3 @@ -1,20 +0,0 @@ 37.4 -<http://pachube.org/ontology/Tajikistan> <http://dbpedia.org/property/hasGeometry> "POINT(0 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 37.5 -<http://pachube.org/ontology/SensorDeployment9> <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> <http://pachube.org/ontology/SensorPlatform9>. 37.6 -<http://pachube.org/ontology/SensorPlatform9> <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> <http://pachube.org/ontology/Kikirikistan>. 37.7 -<http://dbpedia.org/ontology/PopulatedPlace9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/PopulatedPlace>. 37.8 -<http://pachube.org/ontology/SensorDeployment1> <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> <http://pachube.org/ontology/SensorPlatform1>. 37.9 -<http://linkedgeodata.org/ontology/Node1> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(1 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 37.10 -<http://pachube.org/ontology/Kikirikistan> <http://dbpedia.org/property/hasGeometry> "POINT(2 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 37.11 -<http://dbpedia.org/ontology/PopulatedPlaceGeoNames> <http://www.w3.org/2002/07/owl#sameAs> <http://dbpedia.org/ontology/PopulatedPlace9>. 37.12 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#Area88> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> "POINT(0 1)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 37.13 -<http://pachube.org/ontology/SensorSystem1> <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> <http://pachube.org/ontology/System1>. 37.14 -<http://dbpedia.org/ontology/PopulatedPlaceGeoNames> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> "POINT(3 5)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 37.15 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#LandArea9> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeometry> "POINT(0 5)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 37.16 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#LandArea9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#Area>. 37.17 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#Area88> <http://www.geonames.org/ontology#name> "London". 37.18 -<http://pachube.org/ontology/SensorDeployment1> <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> <http://pachube.org/ontology/SensorSystem1>. 37.19 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#LandArea9> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasLandUse> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#portAreas>. 37.20 -<http://pachube.org/ontology/SensorSystem9> <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> <http://pachube.org/ontology/System9>. 37.21 -<http://pachube.org/ontology/SensorDeployment9> <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> <http://pachube.org/ontology/SensorSystem9>. 37.22 -<http://linkedgeodata.org/ontology/Node1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/NaturalWood>. 37.23 -<http://pachube.org/ontology/SensorPlatform1> <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> <http://pachube.org/ontology/Tajikistan>.
38.1 --- a/runtime/src/test/resources/more-tests-srid.nt Wed Mar 18 14:03:01 2015 +0200 38.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 38.3 @@ -1,58 +0,0 @@ 38.4 -<http://www.geonames.org/ontology/Athens> <http://www.w3.org/2002/07/owl#sameAs> <http://dbpedia.org/resource/Athens>. 38.5 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 38.6 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 38.7 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 38.8 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 38.9 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 38.10 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 38.11 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 38.12 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 38.13 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 38.14 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 38.15 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 38.16 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 38.17 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 38.18 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 38.19 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 38.20 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 38.21 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 38.22 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 38.23 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 38.24 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 38.25 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 38.26 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 38.27 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 38.28 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 38.29 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 38.30 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 38.31 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 38.32 -<http://linkedgeodata.org/triplify#way4020526> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology#Harbour>. 38.33 -<http://linkedgeodata.org/triplify#way4020525> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology#Pier>. 38.34 -<http://dbpedia.org/resource/Greece> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/resource/Country>. 38.35 -<http://linkedgeodata.org/ontology/Node122> <http://linkedgeodata.org/ontology/bufferExtent> "2"^^<http://www.w3.org/2001/XMLSchema#integer>. 38.36 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2000/01/rdf-schema#label> "Rosie's". 38.37 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2000/01/rdf-schema#label> "Curzon Diner". 38.38 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2000/01/rdf-schema#label> "Café Riva". 38.39 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2000/01/rdf-schema#label> "The Clock Café". 38.40 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2000/01/rdf-schema#label> "Costa". 38.41 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2000/01/rdf-schema#label> "Coffee Republic". 38.42 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2000/01/rdf-schema#label> "Caffe Nero". 38.43 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2000/01/rdf-schema#label> "Norwegian Wood". 38.44 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2000/01/rdf-schema#label> "Boscanova". 38.45 -<http://dbpedia.org/resource/Athens> <http://www.w3.org/2000/01/rdf-schema#label> "Athens". 38.46 -<http://linkedgeodata.org/triplify#way4020525> <http://www.w3.org/2000/01/rdf-schema#label> "Piraeus Pier". 38.47 -<http://linkedgeodata.org/triplify#way4020526> <http://www.w3.org/2000/01/rdf-schema#label> "Pearl Harbor". 38.48 -<http://dbpedia.org/resource/Greece> <http://dbpedia.org/property/capital> "Athens". 38.49 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84186 50.7255)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.50 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84667 50.7317)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.51 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.81769 50.7218)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.52 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84845 50.7231)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.53 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87652 50.7214)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.54 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87647 50.721)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.55 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87631 50.7213)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.56 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87346 50.7214)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.57 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.83702 50.7272)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.58 -<http://www.geonames.org/ontology/Greece> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(22.0 39.0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.59 -<http://www.geonames.org/ontology/Athens> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(23.71 37.97)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.60 -<http://linkedgeodata.org/triplify#way4020525> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((23.65 37.94,23.64 37.935,23.64 37.934,23.65 37.94))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 38.61 -<http://linkedgeodata.org/triplify#way4020526> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(23.63 37.96)"^^<http://strdf.di.uoa.gr/ontology#WKT>.
39.1 --- a/runtime/src/test/resources/more-tests.nt Wed Mar 18 14:03:01 2015 +0200 39.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 39.3 @@ -1,58 +0,0 @@ 39.4 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87631 50.7213)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.5 -<http://linkedgeodata.org/triplify#way4020525> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POLYGON((23.65 37.94,23.64 37.935,23.64 37.934,23.65 37.94))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.6 -<http://dbpedia.org/resource/Greece> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/resource/Country>. 39.7 -<http://linkedgeodata.org/triplify#way4020525> <http://www.w3.org/2000/01/rdf-schema#label> "Piraeus Pier". 39.8 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2000/01/rdf-schema#label> "Rosie's". 39.9 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2000/01/rdf-schema#label> "Coffee Republic". 39.10 -<http://linkedgeodata.org/triplify#way4020525> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology#Pier>. 39.11 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2000/01/rdf-schema#label> "Norwegian Wood". 39.12 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87647 50.721)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.13 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.83702 50.7272)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.14 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 39.15 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 39.16 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 39.17 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 39.18 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 39.19 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 39.20 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 39.21 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 39.22 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 39.23 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.81769 50.7218)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.24 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2000/01/rdf-schema#label> "The Clock Café". 39.25 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84845 50.7231)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.26 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84667 50.7317)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.27 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87346 50.7214)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.28 -<http://linkedgeodata.org/triplify#way4020526> <http://www.w3.org/2000/01/rdf-schema#label> "Pearl Harbor". 39.29 -<http://linkedgeodata.org/ontology/Node122> <http://linkedgeodata.org/ontology/bufferExtent> "2"^^<http://www.w3.org/2001/XMLSchema#integer>. 39.30 -<http://www.geonames.org/ontology/Athens> <http://www.w3.org/2002/07/owl#sameAs> <http://dbpedia.org/resource/Athens>. 39.31 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.87652 50.7214)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.32 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2000/01/rdf-schema#label> "Café Riva". 39.33 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2000/01/rdf-schema#label> "Curzon Diner". 39.34 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> "POINT(-1.84186 50.7255)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.35 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2000/01/rdf-schema#label> "Boscanova". 39.36 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2000/01/rdf-schema#label> "Caffe Nero". 39.37 -<http://linkedgeodata.org/triplify#way4020526> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(23.63 37.96)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.38 -<http://www.geonames.org/ontology/Athens> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(23.71 37.97)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.39 -<http://linkedgeodata.org/triplify#way4020526> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology#Harbour>. 39.40 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2000/01/rdf-schema#label> "Costa". 39.41 -<http://www.geonames.org/ontology/Greece> <http://strdf.di.uoa.gr/ontology#hasGeometry> "POINT(22.0 39.0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.42 -<http://dbpedia.org/resource/Athens> <http://www.w3.org/2000/01/rdf-schema#label> "Athens". 39.43 -<http://dbpedia.org/resource/Greece> <http://dbpedia.org/property/capital> "Athens". 39.44 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 39.45 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 39.46 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 39.47 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 39.48 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 39.49 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 39.50 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 39.51 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 39.52 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 39.53 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 39.54 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 39.55 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 39.56 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 39.57 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 39.58 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 39.59 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 39.60 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 39.61 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>.
40.1 --- a/runtime/src/test/resources/simple-tests.nt Wed Mar 18 14:03:01 2015 +0200 40.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 40.3 @@ -1,8 +0,0 @@ 40.4 -<http://example.org/item1> <http://example.org/id> "1"^^<http://www.w3.org/2001/XMLSchema#int>. 40.5 -<http://example.org/item2> <http://example.org/id> "2"^^<http://www.w3.org/2001/XMLSchema#int>. 40.6 -<http://example.org/item3> <http://example.org/id> "3"^^<http://www.w3.org/2001/XMLSchema#int>. 40.7 -<http://example.org/item1> <http://example.org/value> "10"^^<http://www.w3.org/2001/XMLSchema#int>. 40.8 -<http://example.org/item2> <http://example.org/value> "20"^^<http://www.w3.org/2001/XMLSchema#int>. 40.9 -<http://example.org/item1> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeometry> "POINT(1 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 40.10 -<http://example.org/item2> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeometry> "POINT(2 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 40.11 -<http://example.org/item3> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeometry> "POINT(3 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>.
41.1 --- a/runtime/src/test/resources/sparql11-tests.nt Wed Mar 18 14:03:01 2015 +0200 41.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 41.3 @@ -1,62 +0,0 @@ 41.4 -<http://example.org#alice> <http://purl.org/dc/elements/1.0/title> "SPARQL Query Language Tutorial". 41.5 -<http://example.org#carol> <http://purl.org/dc/elements/1.0/title> "SPARQL". 41.6 -<http://example.org#a> <http://xmlns.com/foaf/0.1/name> "Johnny Lee Outlaw". 41.7 -<http://example.org#b> <http://xmlns.com/foaf/0.1/name> "Peter Goodguy". 41.8 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/name> "Alice". 41.9 -<http://example.org#bob> <http://xmlns.com/foaf/0.1/name> "Bob". 41.10 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/name> "Alice Foo". 41.11 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/name> "A. Foo". 41.12 -<http://example.org#bob> <http://xmlns.com/foaf/0.1/name> "Bob Bar". 41.13 -<http://example.org#bob> <http://xmlns.com/foaf/0.1/name> "B. Bar". 41.14 -<http://example.org#carol> <http://xmlns.com/foaf/0.1/name> "Carol Baz". 41.15 -<http://example.org#carol> <http://xmlns.com/foaf/0.1/name> "C. Baz". 41.16 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/homepage> <http://work.example.org/alice/>. 41.17 -<http://example.org#a> <http://xmlns.com/foaf/0.1/mbox> <mailto:jlow@example.com>. 41.18 -<http://example.org#b> <http://xmlns.com/foaf/0.1/mbox> <mailto:peter@example.org>. 41.19 -<http://example.org#c> <http://xmlns.com/foaf/0.1/mbox> <mailto:carol@example.org>. 41.20 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/mbox> <mailto:alice@example.com>. 41.21 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/mbox> <mailto:alice@work.example>. 41.22 -<http://example.org#bob> <http://xmlns.com/foaf/0.1/mbox> <mailto:bob@work.example>. 41.23 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/familyName> "Smith". 41.24 -<http://example.org#bob> <http://xmlns.com/foaf/0.1/familyName> "Jones". 41.25 -<http://example.org#carol> <http://xmlns.com/foaf/0.1/familyName> "Smith". 41.26 -<http://example.org#alice> <http://purl.org/dc/elements/1.0/creator> "Alice". 41.27 -<http://example.org#bob> <http://purl.org/dc/elements/1.1/creator> "Bob". 41.28 -<http://example.org#org1> <http://example.org#affiliates> <http://example.org#auth1>. 41.29 -<http://example.org#org1> <http://example.org#affiliates> <http://example.org#auth2>. 41.30 -<http://example.org#org2> <http://example.org#affiliates> <http://example.org#auth3>. 41.31 -<http://example.org#x> <http://example.org/ns#p> "cat"@en. 41.32 -<http://example.org#y> <http://example.org/ns#p> "42"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.33 -<http://example.org#z> <http://example.org/ns#p> "abc"^^<http://example.org/datatype#specialDatatype>. 41.34 -<http://example.org#a> <http://example.org#p> "1"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.35 -<http://example.org#b> <http://example.org#p> "3.0"^^<http://www.w3.org/2001/XMLSchema#decimal>. 41.36 -<http://example.org#a> <http://example.org#q> "1"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.37 -<http://example.org#a> <http://example.org#q> "2"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.38 -<http://example.org#b> <http://example.org#q> "4.0"^^<http://www.w3.org/2001/XMLSchema#decimal>. 41.39 -<http://example.org#b> <http://example.org#q> "5.0"^^<http://www.w3.org/2001/XMLSchema#decimal>. 41.40 -<http://example.org#auth1> <http://example.org#writesBook> <http://example.org#book1>. 41.41 -<http://example.org#auth1> <http://example.org#writesBook> <http://example.org#book2>. 41.42 -<http://example.org#auth2> <http://example.org#writesBook> <http://example.org#book3>. 41.43 -<http://example.org#auth3> <http://example.org#writesBook> <http://example.org#book4>. 41.44 -<http://example.org#book1> <http://example.org#price> "9"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.45 -<http://example.org#book2> <http://example.org#price> "5"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.46 -<http://example.org#book3> <http://example.org#price> "7"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.47 -<http://example.org#book4> <http://example.org#price> "7"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.48 -<http://example.org#johnDoe> <http://xmlns.com/foaf/0.1/surname> "Doe". 41.49 -<http://example.org#johnDoe> <http://xmlns.com/foaf/0.1/givenName> "John". 41.50 -<http://example.org#alice> <http://example.com/org#employeeId> "12345"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.51 -<http://example.org#bob> <http://example.com/org#employeeId> "67890"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.52 -<http://example.org#alice> <http://example.com/org#employeeName> "Alice". 41.53 -<http://example.org#bob> <http://example.com/org#employeeName> "Bob". 41.54 -<http://example.org#book1> <http://purl.org/dc/elements/1.1/title> "SPARQL Tutorial". 41.55 -<http://example.org#book2> <http://purl.org/dc/elements/1.1/title> "The Semantic Web". 41.56 -<http://example.org#bob> <http://purl.org/dc/elements/1.1/title> "SPARQL Protocol Tutorial". 41.57 -<http://example.org#carol> <http://purl.org/dc/elements/1.1/title> "SPARQL (updated)". 41.58 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/knows> <http://example.org#bob>. 41.59 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/knows> <http://example.org#carol>. 41.60 -<http://example.org#book1> <http://example.org/ns#discount> "0.2"^^<http://www.w3.org/2001/XMLSchema#decimal>. 41.61 -<http://example.org#book2> <http://example.org/ns#discount> "0.25"^^<http://www.w3.org/2001/XMLSchema#decimal>. 41.62 -<http://example.org#book1> <http://example.org/ns#price> "42"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.63 -<http://example.org#book2> <http://example.org/ns#price> "23"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.64 -<http://example.org#alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>. 41.65 -<http://example.org#bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>.
42.1 --- a/runtime/src/test/resources/spatial-tests-srid.nt Wed Mar 18 14:03:01 2015 +0200 42.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 42.3 @@ -1,36 +0,0 @@ 42.4 -<http://example.org/pol1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 42.5 -<http://example.org/pol11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 42.6 -<http://example.org/pol2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 42.7 -<http://example.org/pol3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 42.8 -<http://example.org/pol4> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 42.9 -<http://example.org/pol5> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 42.10 -<http://example.org/pol6> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 42.11 -<http://example.org/pol7> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 42.12 -<http://example.org/pol8> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 42.13 -<http://example.org/pol9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 42.14 -<http://example.org/line20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/LineString>. 42.15 -<http://example.org/line21> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/LineString>. 42.16 -<http://example.org/pol1> <http://example.org/id> "A"^^<http://www.w3.org/2001/XMLSchema#string>. 42.17 -<http://example.org/pol11> <http://example.org/id> "A"^^<http://www.w3.org/2001/XMLSchema#string>. 42.18 -<http://example.org/pol2> <http://example.org/id> "B"^^<http://www.w3.org/2001/XMLSchema#string>. 42.19 -<http://example.org/pol3> <http://example.org/id> "C"^^<http://www.w3.org/2001/XMLSchema#string>. 42.20 -<http://example.org/pol4> <http://example.org/id> "D"^^<http://www.w3.org/2001/XMLSchema#string>. 42.21 -<http://example.org/pol5> <http://example.org/id> "E"^^<http://www.w3.org/2001/XMLSchema#string>. 42.22 -<http://example.org/pol6> <http://example.org/id> "F"^^<http://www.w3.org/2001/XMLSchema#string>. 42.23 -<http://example.org/pol7> <http://example.org/id> "G"^^<http://www.w3.org/2001/XMLSchema#string>. 42.24 -<http://example.org/pol8> <http://example.org/id> "H"^^<http://www.w3.org/2001/XMLSchema#string>. 42.25 -<http://example.org/pol9> <http://example.org/id> "Z"^^<http://www.w3.org/2001/XMLSchema#string>. 42.26 -<http://example.org/line20> <http://example.org/id> "L1"^^<http://www.w3.org/2001/XMLSchema#string>. 42.27 -<http://example.org/line21> <http://example.org/id> "L2"^^<http://www.w3.org/2001/XMLSchema#string>. 42.28 -<http://example.org/pol1> <http://example.org/geometry> "POLYGON((1 6, 2 6, 2 7, 1 7, 1 6))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.29 -<http://example.org/pol11> <http://example.org/geometry> "POLYGON((1 6, 2 6, 2 7, 1 7, 1 6))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.30 -<http://example.org/pol2> <http://example.org/geometry> "POLYGON((4 2, 5 2, 5 4, 4 4, 4 2))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.31 -<http://example.org/pol3> <http://example.org/geometry> "POLYGON((8 1, 9 1, 9 2, 8 2, 8 1))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.32 -<http://example.org/pol4> <http://example.org/geometry> "POLYGON((11 6, 12 6, 12 7, 11 7, 11 6))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.33 -<http://example.org/pol5> <http://example.org/geometry> "POLYGON((8 6, 9 6, 9 7, 8 7, 8 6))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.34 -<http://example.org/pol6> <http://example.org/geometry> "POLYGON((6 7, 7 7, 7 8, 6 8, 6 7))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.35 -<http://example.org/pol7> <http://example.org/geometry> "POLYGON((4 8, 5 8, 5 9, 4 9, 4 8))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.36 -<http://example.org/pol8> <http://example.org/geometry> "POLYGON((8 9, 9 9, 9 10, 8 10, 8 9))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.37 -<http://example.org/pol9> <http://example.org/geometry> "POLYGON((3 3, 10 3, 10 8, 3 8, 3 3))"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.38 -<http://example.org/line20> <http://example.org/geometry> "LINESTRING(11 3, 12 4)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.39 -<http://example.org/line21> <http://example.org/geometry> "LINESTRING(11 4, 12 3)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 42.40 \ No newline at end of file