Strabon
changeset 1521:6521e8989dc9
merge
author | Giannis Vlachopoulos <johnvl@di.uoa.gr> |
---|---|
date | Thu May 14 11:24:49 2015 +0300 (2015-05-14) |
parents | 38b0c0a12614 94599fbf9c01 |
children | 178b9891eca2 |
files | generaldb/src/test/java/org/openrdf/sesame/sail/generaldb/AppTest.java postgis/src/test/java/org/openrdf/sesame/sail/postgis/AppTest.java runtime/src/main/java/eu/earthobservatory/utils/GeonamesParser.java 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/generaldb/src/test/java/org/openrdf/sesame/sail/generaldb/AppTest.java Thu May 14 11:24:32 2015 +0300 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,38 +0,0 @@ 1.4 -package org.openrdf.sesame.sail.generaldb; 1.5 - 1.6 -import junit.framework.Test; 1.7 -import junit.framework.TestCase; 1.8 -import junit.framework.TestSuite; 1.9 - 1.10 -/** 1.11 - * Unit test for simple App. 1.12 - */ 1.13 -public class AppTest 1.14 - extends TestCase 1.15 -{ 1.16 - /** 1.17 - * Create the test case 1.18 - * 1.19 - * @param testName name of the test case 1.20 - */ 1.21 - public AppTest( String testName ) 1.22 - { 1.23 - super( testName ); 1.24 - } 1.25 - 1.26 - /** 1.27 - * @return the suite of tests being tested 1.28 - */ 1.29 - public static Test suite() 1.30 - { 1.31 - return new TestSuite( AppTest.class ); 1.32 - } 1.33 - 1.34 - /** 1.35 - * Rigourous Test :-) 1.36 - */ 1.37 - public void testApp() 1.38 - { 1.39 - assertTrue( true ); 1.40 - } 1.41 -}
2.1 --- a/postgis/src/test/java/org/openrdf/sesame/sail/postgis/AppTest.java Thu May 14 11:24:32 2015 +0300 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,38 +0,0 @@ 2.4 -package org.openrdf.sesame.sail.postgis; 2.5 - 2.6 -import junit.framework.Test; 2.7 -import junit.framework.TestCase; 2.8 -import junit.framework.TestSuite; 2.9 - 2.10 -/** 2.11 - * Unit test for simple App. 2.12 - */ 2.13 -public class AppTest 2.14 - extends TestCase 2.15 -{ 2.16 - /** 2.17 - * Create the test case 2.18 - * 2.19 - * @param testName name of the test case 2.20 - */ 2.21 - public AppTest( String testName ) 2.22 - { 2.23 - super( testName ); 2.24 - } 2.25 - 2.26 - /** 2.27 - * @return the suite of tests being tested 2.28 - */ 2.29 - public static Test suite() 2.30 - { 2.31 - return new TestSuite( AppTest.class ); 2.32 - } 2.33 - 2.34 - /** 2.35 - * Rigourous Test :-) 2.36 - */ 2.37 - public void testApp() 2.38 - { 2.39 - assertTrue( true ); 2.40 - } 2.41 -}
3.1 --- a/runtime/src/main/java/eu/earthobservatory/utils/GeonamesParser.java Thu May 14 11:24:32 2015 +0300 3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 3.3 @@ -1,392 +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.utils; 3.14 - 3.15 -import info.aduna.iteration.CloseableIteration; 3.16 - 3.17 -import java.io.BufferedReader; 3.18 -import java.io.BufferedWriter; 3.19 -import java.io.ByteArrayInputStream; 3.20 -import java.io.File; 3.21 -import java.io.FileInputStream; 3.22 -import java.io.FileNotFoundException; 3.23 -import java.io.FileOutputStream; 3.24 -import java.io.IOException; 3.25 -import java.io.InputStreamReader; 3.26 -import java.io.OutputStreamWriter; 3.27 -import java.io.Serializable; 3.28 -import java.util.ArrayList; 3.29 -import java.util.HashMap; 3.30 -import java.util.List; 3.31 -import java.util.ListIterator; 3.32 -import java.util.Map; 3.33 - 3.34 -import org.geotools.data.DataUtilities; 3.35 -import org.geotools.data.shapefile.ShapefileDataStore; 3.36 -import org.geotools.data.shapefile.ShapefileDataStoreFactory; 3.37 -import org.geotools.data.simple.SimpleFeatureCollection; 3.38 -import org.geotools.data.simple.SimpleFeatureIterator; 3.39 -import org.geotools.data.simple.SimpleFeatureSource; 3.40 -import org.geotools.feature.FeatureCollections; 3.41 -import org.geotools.feature.SchemaException; 3.42 -import org.geotools.feature.simple.SimpleFeatureBuilder; 3.43 -import org.geotools.geometry.jts.JTSFactoryFinder; 3.44 -import org.opengis.feature.simple.SimpleFeature; 3.45 -import org.opengis.feature.simple.SimpleFeatureType; 3.46 -import org.opengis.geometry.MismatchedDimensionException; 3.47 -import org.opengis.referencing.FactoryException; 3.48 -import org.opengis.referencing.NoSuchAuthorityCodeException; 3.49 -import org.opengis.referencing.operation.TransformException; 3.50 -import org.openrdf.model.Namespace; 3.51 -import org.openrdf.model.Resource; 3.52 -import org.openrdf.model.Statement; 3.53 -import org.openrdf.model.URI; 3.54 -import org.openrdf.model.Value; 3.55 -import org.openrdf.model.impl.LiteralImpl; 3.56 -import org.openrdf.model.impl.StatementImpl; 3.57 -import org.openrdf.model.impl.URIImpl; 3.58 -import org.openrdf.repository.Repository; 3.59 -import org.openrdf.repository.RepositoryConnection; 3.60 -import org.openrdf.repository.RepositoryException; 3.61 -import org.openrdf.repository.sail.SailRepository; 3.62 -import org.openrdf.rio.RDFHandler; 3.63 -import org.openrdf.rio.RDFHandlerException; 3.64 -import org.openrdf.rio.RDFParseException; 3.65 -import org.openrdf.rio.RDFWriter; 3.66 -import org.openrdf.rio.turtle.TurtleWriter; 3.67 - 3.68 -import org.openrdf.sail.memory.MemoryStore; 3.69 - 3.70 -import com.vividsolutions.jts.geom.Coordinate; 3.71 -import com.vividsolutions.jts.geom.Geometry; 3.72 -import com.vividsolutions.jts.geom.GeometryFactory; 3.73 -import com.vividsolutions.jts.geom.MultiLineString; 3.74 -import com.vividsolutions.jts.geom.Point; 3.75 -import com.vividsolutions.jts.io.ParseException; 3.76 -import com.vividsolutions.jts.io.WKTReader; 3.77 - 3.78 -public class GeonamesParser { 3.79 - 3.80 - static int pointsOut = 0; 3.81 - static int e = 0, a = 0; 3.82 - 3.83 - public static void main(String[] args) throws IOException, SchemaException, 3.84 - NoSuchAuthorityCodeException, FactoryException, 3.85 - MismatchedDimensionException, TransformException { 3.86 - 3.87 - if (args.length < 2) { 3.88 - System.err.println("Usage: eu.earthobservatory.utils.GeonamesParser <IN_FILE> <OUT_FILE>"); 3.89 - System.exit(0); 3.90 - } 3.91 - final String inFile = args[0]; 3.92 - final String outFile = args[1]; 3.93 - final String baseURI = "http://www.geonames.org"; 3.94 - 3.95 - String greece = "POLYGON((" + 3.96 - "19.2214041948412 39.915644583545,19.2214041948412 39.915644583545,19.181097387078 39.9237059450676," + 3.97 - "19.5519200182563 40.0285036451009,19.6567177185669 39.9156445835922,20.1968289424263 39.9075832219288," + 3.98 - "20.3741788961446 40.1655467910226,20.6805106346546 40.4073876369722,20.8497992263774 40.94749885984," + 3.99 - "21.6962421887069 41.0845420054562,21.8897148655894 41.2538305976083,22.5910533201724 41.2780146817553," + 3.100 - "22.5829919583984 41.4231191894311,23.1150418204718 41.4473032736882,23.5987235131646 41.5279168887397," + 3.101 - "23.896993890336 41.5682236962285,24.3967983060956 41.6568986728098,24.7434368528031 41.5359782495121," + 3.102 - "25.331916245936 41.3989351029729,25.9687638080256 41.4553646333056,26.0574387848902 41.5440396101636," + 3.103 - "25.9284569997944 41.7536350102425,26.1944819306803 41.8423099869814,26.6297954543722 41.7375122866789," + 3.104 - "26.7426545167742 41.2941374019925,26.4685682243736 41.1812783406592,26.5169363940019 40.9716829406332," + 3.105 - "26.0896842326308 40.6008603101938,25.5415116482987 40.0688104490916,26.4927523118004 39.4642083330579," + 3.106 - "26.7265317973552 39.0288948098343,26.4040773361785 38.5693972024431,27.1537839611879 37.8599973865071," + 3.107 - "28.451663172698 36.4734432006192,28.0082882886197 35.6834297705082,29.5560697054562 36.3605841370316," + 3.108 - "29.9671991450442 36.0864978436166,27.0570476273072 34.6596368562464,24.0904665776989 34.5870846050009," + 3.109 - "21.9219603198949 35.538325268111,19.2214041948412 39.915644583545" + 3.110 - "))"; 3.111 - 3.112 - Repository myRepository = new SailRepository(new MemoryStore()); 3.113 - BufferedReader dis = null; 3.114 - RepositoryConnection conn = null; 3.115 - boolean isEven = false; 3.116 - 3.117 - Geometry greeceGeo = null; 3.118 - try { 3.119 - //mbbInWGS84 = new WKTReader().read("POLYGON((-10.6700 34.5000, 31.5500 34.5000, 31.5500 71.0500, -10.6700 71.0500, -10.6700 34.5000))"); 3.120 - greeceGeo = new WKTReader().read(greece); 3.121 - greeceGeo.setSRID(4326); 3.122 - } catch (ParseException e1) { 3.123 - e1.printStackTrace(); 3.124 - } 3.125 - 3.126 - // System.out.println("|--MBB Created--|"); 3.127 - 3.128 - // // -- Display map of Greece and its mbb -- // 3.129 - // SimpleFeatureCollection mbbCollection = createCollection(mbbInWGS84); 3.130 - // MapContext map = new DefaultMapContext(); 3.131 - // map.setTitle("Map"); 3.132 - // map.addLayer(clcFeatureCollection, null); 3.133 - // map.addLayer(mbbCollection, null); 3.134 - // JMapFrame.showMap(map); 3.135 - 3.136 - try { 3.137 - // Initialization of classes used for RDF handling 3.138 - myRepository.initialize(); 3.139 - conn = myRepository.getConnection(); 3.140 - conn.setAutoCommit(true); 3.141 - 3.142 - dis = new BufferedReader(new InputStreamReader( 3.143 - new FileInputStream(new File(inFile)))); 3.144 - BufferedWriter osw = new BufferedWriter(new OutputStreamWriter( 3.145 - new FileOutputStream(outFile), "UTF-8")); 3.146 - // BufferedWriter osw = new BufferedWriter(new 3.147 - // OutputStreamWriter(new FileOutputStream(outFile), "UTF-8")); 3.148 - RDFWriter wr = new TurtleWriter(osw); 3.149 - String line = null; 3.150 - 3.151 - // Adding data to repository 3.152 - wr.startRDF(); 3.153 - while (dis.ready()) { 3.154 - line = dis.readLine(); 3.155 - if (isEven) { 3.156 - try { 3.157 - conn.clear(); 3.158 - //ByteArrayInputStream bis = new ByteArrayInputStream(line.getBytes()); 3.159 - ByteArrayInputStream bis = new ByteArrayInputStream(line.getBytes("UTF-8")); 3.160 - conn.add(bis, baseURI, org.openrdf.rio.RDFFormat.RDFXML); 3.161 - exportGeoname(wr, conn, greeceGeo); 3.162 - } catch (RDFParseException ex) { 3.163 - System.err.println(line); 3.164 - e++; 3.165 - } 3.166 - } else { 3.167 - a++; 3.168 - } 3.169 - isEven = !isEven; 3.170 - } 3.171 - wr.endRDF(); 3.172 - dis.close(); 3.173 - 3.174 - System.out.println("Rejected features: " + e); 3.175 - System.out.println("Parsed features: " + a); 3.176 - System.out.println("Points out of MBB of Greece: " + pointsOut); 3.177 - } catch (RepositoryException e) { 3.178 - e.printStackTrace(); 3.179 - } catch (FileNotFoundException e) { 3.180 - e.printStackTrace(); 3.181 - } catch (IOException e) { 3.182 - e.printStackTrace(); 3.183 - } catch (RDFHandlerException e) { 3.184 - e.printStackTrace(); 3.185 - } 3.186 - 3.187 - } 3.188 - 3.189 - /** 3.190 - * Create a SimpleFeatureCollection with a Geometry 3.191 - * 3.192 - * @param all 3.193 - * @return 3.194 - * @throws SchemaException 3.195 - */ 3.196 - public static SimpleFeatureCollection createCollection(Geometry g) 3.197 - throws SchemaException { 3.198 - 3.199 - SimpleFeatureCollection collection = FeatureCollections.newCollection(); 3.200 - SimpleFeatureType TYPE = DataUtilities.createType("MBB", 3.201 - "location:Polygon:srid=4326"); // 4326 = srid of wgs84 3.202 - SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE); 3.203 - 3.204 - featureBuilder.add(g); 3.205 - SimpleFeature feature = featureBuilder.buildFeature(null); 3.206 - collection.add(feature); 3.207 - 3.208 - return collection; 3.209 - } 3.210 - 3.211 -// public static Geometry getMBB(String filename) throws IOException, 3.212 -// SchemaException, NoSuchAuthorityCodeException, FactoryException { 3.213 -// SimpleFeatureCollection featureCollection = getFeatureCollection( 3.214 -// filename, "ISO8859-7"); 3.215 -// 3.216 -// SimpleFeatureIterator featureIterator = featureCollection.features(); 3.217 -// 3.218 -// MultiPolygon all = null; 3.219 -// // Iterate features of shp file 3.220 -// while (featureIterator.hasNext()) { 3.221 -// SimpleFeature f = featureIterator.next(); 3.222 -// List<Object> attributes = f.getAttributes(); 3.223 -// 3.224 -// MultiPolygon landItem = (MultiPolygon) attributes.get(0); 3.225 -// 3.226 -// if (all == null) 3.227 -// all = landItem; 3.228 -// else 3.229 -// all = (MultiPolygon) all.union(landItem); 3.230 -// } 3.231 -// 3.232 -// return all.getEnvelope(); 3.233 -// } 3.234 - 3.235 - /** 3.236 - * @param filename 3.237 - * shp file to be opened 3.238 - * @param encoding 3.239 - * encoding of opened shp file 3.240 - * @return a feature collection of opened shp file 3.241 - * @throws IOException 3.242 - * @throws FactoryException 3.243 - * @throws NoSuchAuthorityCodeException 3.244 - */ 3.245 - public static SimpleFeatureCollection getFeatureCollection(String filename, 3.246 - String encoding) throws IOException, NoSuchAuthorityCodeException, 3.247 - FactoryException { 3.248 - // Open file 3.249 - File infile = new File(filename); 3.250 - 3.251 - // Parameters of ShapefileDatastore 3.252 - Map<String, Serializable> params = new HashMap<String, Serializable>(); 3.253 - params.put(ShapefileDataStoreFactory.URLP.key, infile.toURI().toURL()); 3.254 - // params.put("create spatial index", Boolean.TRUE); 3.255 - params.put(ShapefileDataStoreFactory.DBFCHARSET.key, encoding); 3.256 - 3.257 - // -- Create ShapefileDatastore -- // 3.258 - ShapefileDataStoreFactory dataStoreFactory = new ShapefileDataStoreFactory(); 3.259 - ShapefileDataStore shapefile = (ShapefileDataStore) dataStoreFactory 3.260 - .createNewDataStore(params); 3.261 - // shapefile.setStringCharset(Charset.forName("ISO8859-7")); 3.262 - // DataStore shapefile = new ShapefileDataStore( infile.toURI().toURL(), false); 3.263 - 3.264 - // Get feature collection 3.265 - String[] typeName = shapefile.getTypeNames(); 3.266 - SimpleFeatureSource featureSource = shapefile 3.267 - .getFeatureSource(typeName[0]); 3.268 - //SimpleFeatureCollection collection; 3.269 - SimpleFeatureCollection featureCollection = featureSource.getFeatures(); 3.270 - 3.271 - // SimpleFeatureIterator clcFeatureIterator = 3.272 - // clcFeatureCollection.features(); 3.273 - return featureCollection; 3.274 - } 3.275 - 3.276 - // public static void showMap(String filename) throws IOException { 3.277 - // 3.278 - // File file = new File(filename); 3.279 - // 3.280 - // FileDataStore store = FileDataStoreFinder.getDataStore(file); 3.281 - // SimpleFeatureSource featureSource = store.getFeatureSource(); 3.282 - // 3.283 - // // Create a map context and add our shapefile to it 3.284 - // MapContext map = new DefaultMapContext(); 3.285 - // map.setTitle("Quickstart"); 3.286 - // map.addLayer(featureSource, null); 3.287 - // 3.288 - // // Now display the map 3.289 - // JMapFrame.showMap(map); 3.290 - // } 3.291 - 3.292 - /** 3.293 - * @param featureIterator 3.294 - * iterator of features to print 3.295 - * @throws IOException 3.296 - */ 3.297 - public static void printFeatures(SimpleFeatureIterator featureIterator) 3.298 - throws IOException { 3.299 - 3.300 - // Iterate features of shp file 3.301 - while (featureIterator.hasNext()) { 3.302 - SimpleFeature f = featureIterator.next(); 3.303 - List<Object> attributes = f.getAttributes(); 3.304 - 3.305 - for (int i = 0; i < attributes.size(); i++) { 3.306 - // MultiLineString geometry = 3.307 - // (MultiLineString)attributes.get(0); 3.308 - Object attribute = attributes.get(i); 3.309 - if (!(attribute instanceof MultiLineString)) 3.310 - System.out.println(attributes.get(i).toString()); 3.311 - } 3.312 - System.out.println("---------"); 3.313 - } 3.314 - } 3.315 - 3.316 - public static void exportGeoname(RDFHandler handler, 3.317 - RepositoryConnection conn, Geometry greeceGeo) 3.318 - throws RepositoryException, RDFHandlerException { 3.319 - 3.320 - final URI hasGeography = new URIImpl( 3.321 - "http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography"); 3.322 - final URI geometry = new URIImpl("http://strdf.di.uoa.gr/ontology#WKT"); 3.323 - URI latPredicate = new URIImpl( 3.324 - "http://www.w3.org/2003/01/geo/wgs84_pos#lat"); 3.325 - URI longPredicate = new URIImpl( 3.326 - "http://www.w3.org/2003/01/geo/wgs84_pos#long"); 3.327 - 3.328 - handler.handleNamespace("geo", "http://www.example.org/geo#"); 3.329 - handler.handleNamespace("strdf", "http://strdf.di.uoa.gr/ontology#"); 3.330 - handler.handleNamespace("noa", 3.331 - "http://teleios.di.uoa.gr/ontologies/noaOntology.owl#"); 3.332 - 3.333 - // Export namespace information 3.334 - CloseableIteration<? extends Namespace, RepositoryException> nsIter = conn 3.335 - .getNamespaces(); 3.336 - try { 3.337 - while (nsIter.hasNext()) { 3.338 - Namespace ns = nsIter.next(); 3.339 - handler.handleNamespace(ns.getPrefix(), ns.getName()); 3.340 - } 3.341 - } finally { 3.342 - nsIter.close(); 3.343 - } 3.344 - 3.345 - // Export statements 3.346 - CloseableIteration<? extends Statement, RepositoryException> stIter = conn 3.347 - .getStatements(null, null, null, false); 3.348 - 3.349 - try { 3.350 - Value latV = null, longV = null; 3.351 - Statement st = null; 3.352 - ArrayList<Statement> stL = new ArrayList<Statement>(); 3.353 - Resource sub = null; 3.354 - while (stIter.hasNext()) { 3.355 - st = stIter.next(); 3.356 - URI p = st.getPredicate(); 3.357 - 3.358 - if (p.equals(latPredicate)) { 3.359 - sub = st.getSubject(); 3.360 - latV = st.getObject(); 3.361 - } else if (p.equals(longPredicate)) { 3.362 - longV = st.getObject(); 3.363 - } else { 3.364 - stL.add(st); 3.365 - } 3.366 - } 3.367 - st = new StatementImpl(sub, hasGeography, new LiteralImpl("POINT(" 3.368 - + longV.stringValue() + " " + latV.stringValue() + ")", 3.369 - geometry) // TODO einai swsth h seira, nomizw nai ?? 3.370 - ); 3.371 - stL.add(st); 3.372 - 3.373 - GeometryFactory geometryFactory = JTSFactoryFinder 3.374 - .getGeometryFactory(null); 3.375 - Point point = geometryFactory.createPoint(new Coordinate(Double.parseDouble( 3.376 - //latV.stringValue()), Double.parseDouble(longV.stringValue())) 3.377 - longV.stringValue()), Double.parseDouble(latV.stringValue())) 3.378 - ); 3.379 - // TODO To parapanw nomizw einai swsto edw giati ta pairnei 3.380 - // anapoda?? 3.381 - 3.382 - if (greeceGeo.contains(point)) { 3.383 - ListIterator<Statement> stLI = stL.listIterator(); 3.384 - while (stLI.hasNext()) { 3.385 - handler.handleStatement(stLI.next()); 3.386 - } 3.387 - } else 3.388 - pointsOut++; 3.389 - 3.390 - System.out.println(a + ": " + e + " - " + pointsOut); 3.391 - } finally { 3.392 - stIter.close(); 3.393 - } 3.394 - } 3.395 -} 3.396 \ No newline at end of file
4.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/AggregateTests.java Thu May 14 11:24:32 2015 +0300 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,143 +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 AggregateTests { 4.23 - public static Strabon strabon; 4.24 - 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 - 4.36 - 4.37 - 4.38 - String prefixes = 4.39 - "PREFIX lgdo:<http://linkedgeodata.org/ontology/> "+ 4.40 - "PREFIX geo:<http://www.w3.org/2003/01/geo/wgs84_pos#> "+ 4.41 - "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> "+ 4.42 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "; 4.43 - 4.44 - String queryGroupBy1 = 4.45 - prefixes+ 4.46 - "SELECT (?placegeo AS ?xxx) (AVG(?placegeo) AS ?av) (strdf:union(?placegeo) AS ?united) "+ 4.47 - "WHERE { "+ 4.48 - "?place "+ 4.49 - "rdfs:label ?placename ; "+ 4.50 - "geo:geometry ?placegeo ; "+ 4.51 - "a ?type. "+ 4.52 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 4.53 - "} "+ 4.54 - "GROUP BY ?placegeo (STR(?place) AS ?str) strdf:union(?placegeo,?placegeo) "+ 4.55 - "HAVING (AVG(?str) < 1) "+ 4.56 - "ORDER BY ?placegeo strdf:union(?placegeo,?placegeo) "+ 4.57 - ""; 4.58 - 4.59 - String queryGroupBy2 = 4.60 - prefixes+ 4.61 - "SELECT (strdf:union(strdf:intersection(?placegeo,?placegeo2)) AS ?united) "+ 4.62 - "WHERE { "+ 4.63 - "?place "+ 4.64 - "rdfs:label ?placename ; "+ 4.65 - "geo:geometry ?placegeo ; "+ 4.66 - "geo:geometry ?placegeo2 ; "+ 4.67 - "a ?type. "+ 4.68 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 4.69 - "} "+ 4.70 - "GROUP BY ?placegeo ?placegeo2"; 4.71 - 4.72 - String queryGroupBy3 = 4.73 - prefixes+ 4.74 - "SELECT (strdf:union(strdf:intersection(?placegeo,?placegeo2)) AS ?united) "+ 4.75 - "WHERE { "+ 4.76 - "?place "+ 4.77 - "rdfs:label ?placename ; "+ 4.78 - "geo:geometry ?placegeo ; "+ 4.79 - "geo:geometry ?placegeo2 ; "+ 4.80 - "a ?type. "+ 4.81 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 4.82 - "} "+ 4.83 - "GROUP BY ?placegeo ?placegeo2"; 4.84 - 4.85 - 4.86 - String queryOrder1 = 4.87 - prefixes+ 4.88 - "SELECT ?placegeo ?place (strdf:union(?placegeo) AS ?koko) (strdf:union(?placegeo,?placegeo) AS ?kiki) "+ 4.89 - "WHERE { "+ 4.90 - "?place "+ 4.91 - "rdfs:label ?placename ; "+ 4.92 - "geo:geometry ?placegeo ; "+ 4.93 - "a ?type. "+ 4.94 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 4.95 - "} "+ 4.96 - "ORDER BY strdf:union(?placegeo,?placegeo) ?placegeo ?place"; 4.97 - 4.98 - 4.99 - String queryOrder2 = 4.100 - prefixes+ 4.101 - "SELECT (?place AS ?xx) (strdf:union(?placegeo,?placegeo) AS ?koko) ?place "+ 4.102 - "WHERE { "+ 4.103 - "?place "+ 4.104 - "rdfs:label ?placename ; "+ 4.105 - "geo:geometry ?placegeo ; "+ 4.106 - "a ?type. "+ 4.107 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 4.108 - "} "+ 4.109 - "ORDER BY ?placegeo "; 4.110 - 4.111 - 4.112 - 4.113 - @Test 4.114 - public void testQueryGroupBy1() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.115 - { 4.116 - strabon.query(queryGroupBy1,strabon.getSailRepoConnection()); 4.117 - } 4.118 - 4.119 - @Test 4.120 - public void testQueryGroupBy2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.121 - { 4.122 - strabon.query(queryGroupBy2,strabon.getSailRepoConnection()); 4.123 - 4.124 - } 4.125 - 4.126 - @Test 4.127 - public void testQueryGroupBy3() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.128 - { 4.129 - strabon.query(queryGroupBy3,strabon.getSailRepoConnection()); 4.130 - 4.131 - } 4.132 - 4.133 - @Test 4.134 - public void testQueryOrder1() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.135 - { 4.136 - strabon.query(queryOrder1,strabon.getSailRepoConnection()); 4.137 - 4.138 - } 4.139 - 4.140 - @Test 4.141 - public void testQueryOrder2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 4.142 - { 4.143 - strabon.query(queryOrder2,strabon.getSailRepoConnection()); 4.144 - 4.145 - } 4.146 -}
5.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/GeneralTests.java Thu May 14 11:24:32 2015 +0300 5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 5.3 @@ -1,649 +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 -abstract public class GeneralTests { 5.23 - public static Strabon strabon; 5.24 - 5.25 - 5.26 - protected static String jdbcDriver= "org.postgresql.Driver"; 5.27 - protected static String serverName = "localhost"; 5.28 - protected static String username = "postgres"; 5.29 - protected static String password = "postgres"; 5.30 - protected static Integer port = 5432; 5.31 - protected static java.sql.Connection conn = null; 5.32 - protected static String databaseName = null; 5.33 - 5.34 - // @BeforeClass 5.35 - // public 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 - 5.43 - 5.44 - 5.45 - 5.46 - protected String prefixes = 5.47 - "PREFIX lgdo:<http://linkedgeodata.org/ontology/> "+ 5.48 - "PREFIX geo:<http://www.w3.org/2003/01/geo/wgs84_pos#> "+ 5.49 - "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#> "+ 5.50 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 5.51 - "PREFIX geonames:<http://www.geonames.org/ontology/>"; 5.52 - 5.53 - protected String query1 = 5.54 - prefixes+ 5.55 - "SELECT ?place ?placegeo "+ 5.56 - "WHERE { "+ 5.57 - "?place "+ 5.58 - "rdfs:label ?placename ; "+ 5.59 - "geo:geometry ?placegeo ; "+ 5.60 - "a ?type. "+ 5.61 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)) "+ 5.62 - "}"; 5.63 - 5.64 - protected String query2 = 5.65 - prefixes+ 5.66 - "SELECT ?place (?placegeo AS ?tt1) (strdf:union(?placegeo,?placegeo) AS ?constr) "+ 5.67 - "WHERE { "+ 5.68 - "?place "+ 5.69 - " a ?type ; "+ 5.70 - " geo:geometry ?placegeo ; "+ 5.71 - " rdfs:label ?placename . "+ 5.72 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)) "+ 5.73 - "}"; 5.74 - 5.75 - protected String query3 = 5.76 - prefixes+ 5.77 - "SELECT ?place (?placegeo AS ?constr) "+ 5.78 - "WHERE { "+ 5.79 - "?place "+ 5.80 - " a ?type ; "+ 5.81 - " geo:geometry ?placegeo ; "+ 5.82 - " rdfs:label ?placename . "+ 5.83 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)) "+ 5.84 - "}"; 5.85 - 5.86 - protected String query4 = 5.87 - prefixes+ 5.88 - "SELECT ?place ?placegeo "+ 5.89 - "WHERE { "+ 5.90 - "?place "+ 5.91 - " a ?type ; "+ 5.92 - " geo:geometry ?placegeo ; "+ 5.93 - " rdfs:label ?placename . "+ 5.94 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo) " + 5.95 - "&& strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)) "+ 5.96 - "}"; 5.97 - 5.98 - protected String query5 = 5.99 - prefixes+ 5.100 - "SELECT ?place ?placegeo "+ 5.101 - "WHERE { "+ 5.102 - "?place "+ 5.103 - " a ?type ; "+ 5.104 - " geo:geometry ?placegeo ; "+ 5.105 - " rdfs:label ?placename . "+ 5.106 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)). "+ 5.107 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)). "+ 5.108 - "}"; 5.109 - 5.110 - protected String query6 = 5.111 - prefixes+ 5.112 - "SELECT (strdf:union(?placegeo,strdf:union(?placegeo,?placegeo)) AS ?constr1) " + 5.113 - "?place (?placegeo AS ?tt1) (strdf:union(?placegeo,?placegeo) AS ?constr2) "+ 5.114 - "WHERE { "+ 5.115 - "?place "+ 5.116 - " a ?type ; "+ 5.117 - " geo:geometry ?placegeo ; "+ 5.118 - " rdfs:label ?placename . "+ 5.119 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo)) "+ 5.120 - "}"; 5.121 - 5.122 - protected String query7 = 5.123 - prefixes+ 5.124 - "SELECT ?place (?placegeo AS ?tt1) (strdf:union(?placegeo,?placegeo) AS ?constr) "+ 5.125 - "WHERE { "+ 5.126 - "?place "+ 5.127 - " a ?type ; "+ 5.128 - " geo:geometry ?placegeo ; "+ 5.129 - " rdfs:label ?placename . "+ 5.130 - "} "; 5.131 - 5.132 - protected String query8 = 5.133 - prefixes+ 5.134 - "SELECT ?place "+ 5.135 - "WHERE { "+ 5.136 - "?place "+ 5.137 - " a ?type ; "+ 5.138 - " geo:geometry ?placegeo ; "+ 5.139 - " rdfs:label ?placename . "+ 5.140 - "FILTER(strdf:mbbIntersects(?placegeo,?placegeo)) "+ 5.141 - "}"; 5.142 - 5.143 - protected String queryBufferVar = 5.144 - prefixes+ 5.145 - "SELECT ?place (?placegeo AS ?tt1) "+ 5.146 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 5.147 - "?place "+ 5.148 - " a ?type ; "+ 5.149 - " geo:geometry ?placegeo ; "+ 5.150 - " rdfs:label ?placename . "+ 5.151 - "FILTER(strdf:mbbIntersects(strdf:buffer(?placegeo,?ext),?placegeo)) "+ 5.152 - "}"; 5.153 - 5.154 - protected String queryBufferConst = 5.155 - prefixes+ 5.156 - "SELECT ?place (?placegeo AS ?tt1) "+ 5.157 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 5.158 - "?place "+ 5.159 - " a ?type ; "+ 5.160 - " geo:geometry ?placegeo ; "+ 5.161 - " rdfs:label ?placename . "+ 5.162 - "FILTER(strdf:mbbIntersects(strdf:buffer(?placegeo,2),?placegeo)) "+ 5.163 - "}"; 5.164 - 5.165 - protected String queryBufferConst2 = 5.166 - prefixes+ 5.167 - "SELECT ?place (?placegeo AS ?tt1) "+ 5.168 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 5.169 - "?place "+ 5.170 - " a ?type ; "+ 5.171 - " geo:geometry ?placegeo ; "+ 5.172 - " rdfs:label ?placename . "+ 5.173 - "FILTER(strdf:mbbIntersects(strdf:buffer(\"POINT(23.72873 37.97205)\"^^<http://strdf.di.uoa.gr/ontology#WKT>,0.0572),?placegeo)) "+ 5.174 - "}"; 5.175 - 5.176 - protected String queryBufferConstInSelect = 5.177 - prefixes+ 5.178 - "SELECT ?place (?placegeo AS ?tt1) (strdf:buffer(?placegeo,2.5) AS ?buf) "+ 5.179 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 5.180 - "?place "+ 5.181 - " a ?type ; "+ 5.182 - " geo:geometry ?placegeo ; "+ 5.183 - " rdfs:label ?placename . "+ 5.184 - "FILTER(strdf:mbbIntersects(strdf:buffer(?placegeo,2.5),?placegeo)) "+ 5.185 - "}"; 5.186 - 5.187 - 5.188 - protected String queryBufferSelectFilterA = 5.189 - prefixes+ 5.190 - "SELECT ?place (?placegeo AS ?tt1) (strdf:buffer(?placegeo,?ext) AS ?buf) "+ 5.191 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 5.192 - "?place "+ 5.193 - " a ?type ; "+ 5.194 - " geo:geometry ?placegeo ; "+ 5.195 - " rdfs:label ?placename . "+ 5.196 - "FILTER(strdf:mbbIntersects(strdf:buffer(?placegeo,2),?placegeo)) "+ 5.197 - "}"; 5.198 - 5.199 - protected String queryBufferSelectFilterB = 5.200 - prefixes+ 5.201 - "SELECT ?place (?placegeo AS ?tt1) (strdf:buffer(?placegeo,3) AS ?buf) "+ 5.202 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 5.203 - "?place "+ 5.204 - " a ?type ; "+ 5.205 - " geo:geometry ?placegeo ; "+ 5.206 - " rdfs:label ?placename . "+ 5.207 - "FILTER(strdf:mbbIntersects(strdf:buffer(?placegeo,?ext),?placegeo)) "+ 5.208 - "}"; 5.209 - 5.210 - protected String queryEnvelopeConvexHull = 5.211 - prefixes+ 5.212 - "SELECT ?place (?placegeo AS ?tt1) (strdf:envelope(?placegeo) AS ?constr) (strdf:convexHull(?placegeo) AS ?constr2) "+ 5.213 - "WHERE { "+ 5.214 - "?place "+ 5.215 - " a ?type ; "+ 5.216 - " geo:geometry ?placegeo ; "+ 5.217 - " rdfs:label ?placename . "+ 5.218 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,strdf:envelope(?placegeo)),?placegeo) && strdf:mbbIntersects(strdf:convexHull(?placegeo),?placegeo)) "+ 5.219 - "}"; 5.220 - 5.221 - protected String queryMetrics1 = 5.222 - prefixes+ 5.223 - "SELECT ?place ?placegeo ( strdf:area(?placegeo) AS ?area) "+ 5.224 - "( strdf:envelope(?placegeo) AS ?mbb) "+ 5.225 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 5.226 - "?place "+ 5.227 - " rdfs:label ?placename ; "+ 5.228 - " geo:geometry ?placegeo ; "+ 5.229 - " a ?type. "+ 5.230 - "FILTER(2*strdf:distance(?placegeo,?placegeo) + strdf:area(?placegeo) - 3 + ?ext "+ 5.231 - "< ?ext + 8 - strdf:distance(?placegeo,?placegeo)) "+ 5.232 - "}"; 5.233 - 5.234 - protected String queryMetricsLightOptimized = 5.235 - prefixes+ 5.236 - "SELECT ?place ?placegeo ( 33*strdf:area(?placegeo) + 114 AS ?area) ( strdf:envelope(?placegeo) AS ?mbb) "+ 5.237 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 5.238 - "?place "+ 5.239 - " rdfs:label ?placename ; "+ 5.240 - " geo:geometry ?placegeo ; "+ 5.241 - " a ?type. "+ 5.242 - "FILTER(2*strdf:distance(?placegeo,?placegeo) < 8) "+ 5.243 - "}"; 5.244 - 5.245 - //Metrics with only one var must not be optimized 5.246 - protected String queryMetricsAreaMustNotBeOptimized = 5.247 - prefixes+ 5.248 - "SELECT ?place ?placegeo ( 33*strdf:area(?placegeo) + 114 AS ?area) ( strdf:envelope(?placegeo) AS ?mbb) "+ 5.249 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 5.250 - "?place "+ 5.251 - " rdfs:label ?placename ; "+ 5.252 - " geo:geometry ?placegeo ; "+ 5.253 - " a ?type. "+ 5.254 - "FILTER(2*strdf:area(?placegeo) < 8) "+ 5.255 - "}"; 5.256 - 5.257 - protected String queryMetricsMathInSelect = 5.258 - prefixes+ 5.259 - "SELECT ?place ?placegeo ( 33*strdf:area(?placegeo) + 114 AS ?area) ( strdf:envelope(?placegeo) AS ?mbb) "+ 5.260 - "WHERE { ?x lgdo:bufferExtent ?ext . "+ 5.261 - "?place "+ 5.262 - " rdfs:label ?placename ; "+ 5.263 - " geo:geometry ?placegeo ; "+ 5.264 - " a ?type. "+ 5.265 - "FILTER(2*strdf:distance(?placegeo,?placegeo) + strdf:area(?placegeo) - 3 + ?ext " + 5.266 - "< ?ext + 8 - strdf:distance(?placegeo,?placegeo)) "+ 5.267 - "}"; 5.268 - 5.269 - protected String querySpatialPropertiesMonetDB = 5.270 - prefixes+ 5.271 - "SELECT ?place ?placegeo (strdf:dimension(?placegeo) + 2 AS ?dim) (strdf:srid(?placegeo) AS ?srid) "+ 5.272 - "WHERE { "+ 5.273 - "?place "+ 5.274 - " rdfs:label ?placename ; "+ 5.275 - " geo:geometry ?placegeo ; "+ 5.276 - " a ?type. "+ 5.277 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo) && strdf:isSimple(?placegeo) "+ 5.278 -// "&& strdf:dimension(?placegeo) - 1 < 3" + 5.279 - ") "+ 5.280 - "}"; 5.281 - 5.282 - protected String querySpatialPropertiesPostGIS = 5.283 - prefixes+ 5.284 - "SELECT ?place ?placegeo (strdf:dimension(?placegeo) + 2 AS ?dim) (strdf:srid(?placegeo) AS ?srid) "+ 5.285 - "WHERE { "+ 5.286 - "?place "+ 5.287 - " rdfs:label ?placename ; "+ 5.288 - " geo:geometry ?placegeo ; "+ 5.289 - " a ?type. "+ 5.290 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo) && strdf:isSimple(?placegeo) "+ 5.291 - "&& strdf:dimension(?placegeo) - 1 < 3) "+ 5.292 - "}"; 5.293 - 5.294 - protected String querySpatialPropertiesConstMonetDB = 5.295 - prefixes+ 5.296 - "SELECT ?place ?placegeo (strdf:srid(?placegeo) AS ?srid) (strdf:dimension(?placegeo) + 2 AS ?dim) "+ 5.297 - "WHERE { "+ 5.298 - "?place "+ 5.299 - " rdfs:label ?placename ; "+ 5.300 - " geo:geometry ?placegeo ; "+ 5.301 - " a ?type. "+ 5.302 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo) && strdf:isSimple(?placegeo) "+ 5.303 -// "&& strdf:dimension(\"POINT(0 0)\") - 1 < 3" + 5.304 - ") "+ 5.305 - "}"; 5.306 - 5.307 - protected String querySpatialPropertiesConstPostGIS = 5.308 - prefixes+ 5.309 - "SELECT ?place ?placegeo (strdf:srid(?placegeo) AS ?srid) (strdf:dimension(?placegeo) + 2 AS ?dim) "+ 5.310 - "WHERE { "+ 5.311 - "?place "+ 5.312 - " rdfs:label ?placename ; "+ 5.313 - " geo:geometry ?placegeo ; "+ 5.314 - " a ?type. "+ 5.315 - "FILTER(strdf:mbbIntersects(strdf:union(?placegeo,?placegeo),?placegeo) && strdf:isSimple(?placegeo) "+ 5.316 - "&& strdf:dimension(\"POINT(0 0)\") - 1 < 3) "+ 5.317 - "}"; 5.318 - 5.319 - protected String queryRelate = 5.320 - prefixes+ 5.321 - "SELECT ?place ?placegeo "+ 5.322 - "WHERE { "+ 5.323 - "?place "+ 5.324 - "rdfs:label ?placename ; "+ 5.325 - "geo:geometry ?placegeo ; "+ 5.326 - "a ?type. "+ 5.327 - "FILTER(strdf:relate(?placegeo,?placegeo,\"0FFFFF212\")) "+ 5.328 - "}"; 5.329 - 5.330 - // protected String queryThematicUnion = 5.331 - // prefixes+ 5.332 - // "SELECT ?place "+ 5.333 - // "WHERE { "+ 5.334 - // "?place "+ 5.335 - // "rdfs:label ?placename ; "+ 5.336 - // "geo:geometry ?placegeo. "+ 5.337 - // "{?place a lgdo:Pier . } " + 5.338 - // "UNION" + 5.339 - // "{?place a lgdo:Harbour . } }"; 5.340 - 5.341 - 5.342 - /** 5.343 - * The following three queries test potential bugs noticed during the evaluation process for www2012. 5.344 - * No issue seems to be present. 5.345 - */ 5.346 - protected String queryThematicUnion = 5.347 - prefixes+ 5.348 - "SELECT ?place2 ?placename "+ 5.349 - " WHERE { "+ 5.350 - " ?place2 rdfs:label ?placename. "+ 5.351 - " ?place2 strdf:hasGeometry ?placegeo. " + 5.352 - "{" + 5.353 - " ?place2 a <http://linkedgeodata.org/ontology#Harbour> ." + 5.354 - " } " + 5.355 - "UNION" + 5.356 - "{" + 5.357 - " ?place2 a <http://linkedgeodata.org/ontology#Pier> ." + 5.358 - " } " + 5.359 - "<http://www.geonames.org/ontology/Athens> strdf:hasGeometry ?ar . " + 5.360 - "FILTER(strdf:disjoint(?placegeo,?ar))" + 5.361 - "}"; 5.362 - 5.363 - protected String query6_real = prefixes+ 5.364 - "SELECT ?capital ?pierLabel "+ 5.365 - "WHERE "+ 5.366 - "{ "+ 5.367 - "?country a <http://dbpedia.org/resource/Country> . "+ 5.368 - "?country <http://dbpedia.org/property/capital> ?capital_label . "+ 5.369 - "?capital <http://www.w3.org/2000/01/rdf-schema#label> ?capital_label . "+ 5.370 - "?capitalGeoNames <http://www.w3.org/2002/07/owl#sameAs> ?capital . "+ 5.371 - "?capitalGeoNames strdf:hasGeometry ?capitalGeo . "+ 5.372 - "OPTIONAL "+ 5.373 - "{ "+ 5.374 - " ?pier a <http://linkedgeodata.org/ontology#Pier> . " + 5.375 - " ?pier rdfs:label ?pierLabel . "+ 5.376 - " ?pier strdf:hasGeometry ?pierGeo . "+ 5.377 - " FILTER(strdf:distance(?capitalGeo,?pierGeo) < 3.7) "+ 5.378 - "} "+ 5.379 - "} "; 5.380 - 5.381 - protected String query6_real_union = prefixes+ 5.382 - "SELECT ?capital ?pierLabel "+ 5.383 - "WHERE "+ 5.384 - "{ "+ 5.385 - "?country a <http://dbpedia.org/resource/Country> . "+ 5.386 - "?country <http://dbpedia.org/property/capital> ?capital_label . "+ 5.387 - "?capital <http://www.w3.org/2000/01/rdf-schema#label> ?capital_label . "+ 5.388 - "?capitalGeoNames <http://www.w3.org/2002/07/owl#sameAs> ?capital . "+ 5.389 - "?capitalGeoNames strdf:hasGeometry ?capitalGeo . "+ 5.390 - "OPTIONAL "+ 5.391 - "{ "+ 5.392 - " { " + 5.393 - "?pier a <http://linkedgeodata.org/ontology#Pier> . " + 5.394 - "}" + 5.395 - " UNION" + 5.396 - " { " + 5.397 - "?pier a <http://linkedgeodata.org/ontology#Harbour> . " + 5.398 - "}" + 5.399 - " ?pier rdfs:label ?pierLabel . "+ 5.400 - " ?pier strdf:hasGeometry ?pierGeo . "+ 5.401 - " FILTER(strdf:distance(?capitalGeo,?pierGeo) < 3.7) "+ 5.402 - "} "+ 5.403 - "} "; 5.404 - 5.405 - protected String queryNegation = prefixes+ 5.406 - "SELECT ?capital ?pier "+ 5.407 - "WHERE "+ 5.408 - "{ "+ 5.409 - " ?country a <http://dbpedia.org/resource/Country> . "+ 5.410 - " ?country <http://dbpedia.org/property/capital> ?capital_label . "+ 5.411 - " ?capital <http://www.w3.org/2000/01/rdf-schema#label> ?capital_label . "+ 5.412 - " ?capitalGeoNames <http://www.w3.org/2002/07/owl#sameAs> ?capital . "+ 5.413 - " ?capitalGeoNames strdf:hasGeometry ?capitalGeo . "+ 5.414 - "OPTIONAL "+ 5.415 - "{ "+ 5.416 - " ?pier a <http://linkedgeodata.org/ontology#Harbour> . " + 5.417 - " ?pier rdfs:label ?pierLabel . "+ 5.418 - " ?pier strdf:hasGeometry ?pierGeo . "+ 5.419 - " FILTER(strdf:distance(?capitalGeo,?pierGeo) < 3.7) "+ 5.420 - "} . " + 5.421 - "FILTER (!bound(?pier))" + 5.422 - "} "+ 5.423 - ""; 5.424 - 5.425 - //Representative of functionality. If I remove !bound, 3 more results appear 5.426 - protected String queryNegation2 = prefixes+ 5.427 - "SELECT ?s ?pier "+ 5.428 - "WHERE "+ 5.429 - "{ "+ 5.430 - " ?s strdf:hasGeometry ?geo1 . "+ 5.431 - "OPTIONAL "+ 5.432 - "{ "+ 5.433 - " ?pier a <http://linkedgeodata.org/ontology#Harbour> . " + 5.434 - " ?pier rdfs:label ?pierLabel . "+ 5.435 - " ?pier strdf:hasGeometry ?pierGeo . "+ 5.436 - " FILTER(strdf:distance(?geo1,?pierGeo) < 0.6) "+ 5.437 - "} . " + 5.438 - "FILTER (!bound(?pier))" + 5.439 - "} "+ 5.440 - ""; 5.441 - 5.442 - 5.443 - protected String queryNotExists = 5.444 - prefixes+ 5.445 - "SELECT ?capital ?pierLabel "+ 5.446 - "WHERE "+ 5.447 - "{ "+ 5.448 - "?country a <http://dbpedia.org/resource/Country> . "+ 5.449 - "?country <http://dbpedia.org/property/capital> ?capital_label . "+ 5.450 - "?capital <http://www.w3.org/2000/01/rdf-schema#label> ?capital_label . "+ 5.451 - "?capitalGeoNames <http://www.w3.org/2002/07/owl#sameAs> ?capital . "+ 5.452 - "?capitalGeoNames strdf:hasGeometry ?capitalGeo . "+ 5.453 - " ?pier a <http://linkedgeodata.org/ontology#Pier> . " + 5.454 - " ?pier rdfs:label ?pierLabel . "+ 5.455 - " ?pier strdf:hasGeometry ?pierGeo . "+ 5.456 -// " FILTER NOT EXISTS { ?pier rdfs:label \"Kikirikou\". " + 5.457 -// "FILTER(strdf:distance(?capitalGeo,?pierGeo) > 3.7) " + 5.458 - " FILTER NOT EXISTS { ?pier rdfs:label ?label2. FILTER(?label2 != ?pierLabel)" + 5.459 - "}"+ 5.460 - "} "; 5.461 - 5.462 - //TODO At some point I should also add a test where the 3rd argument of strdf:relate is a variable 5.463 - 5.464 - @Test 5.465 - public void testQuery1() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.466 - { 5.467 - strabon.query(query1,strabon.getSailRepoConnection()); 5.468 - 5.469 - } 5.470 - 5.471 - @Test 5.472 - public void testQuery2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.473 - { 5.474 - strabon.query(query2,strabon.getSailRepoConnection()); 5.475 - 5.476 - } 5.477 - 5.478 - @Test 5.479 - public void testQuery3() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.480 - { 5.481 - strabon.query(query3,strabon.getSailRepoConnection()); 5.482 - 5.483 - } 5.484 - 5.485 - @Test 5.486 - public void testQuery4() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.487 - { 5.488 - strabon.query(query4,strabon.getSailRepoConnection()); 5.489 - 5.490 - } 5.491 - 5.492 - @Test 5.493 - public void testQuery5() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.494 - { 5.495 - strabon.query(query5,strabon.getSailRepoConnection()); 5.496 - 5.497 - } 5.498 - 5.499 - @Test 5.500 - public void testQuery6() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.501 - { 5.502 - strabon.query(query6,strabon.getSailRepoConnection()); 5.503 - 5.504 - } 5.505 - 5.506 - @Test 5.507 - public void testQuery7() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.508 - { 5.509 - strabon.query(query7,strabon.getSailRepoConnection()); 5.510 - 5.511 - } 5.512 - 5.513 - @Test 5.514 - public void testQuery8() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.515 - { 5.516 - strabon.query(query8,strabon.getSailRepoConnection()); 5.517 - 5.518 - } 5.519 - 5.520 - @Test 5.521 - public void testQueryBufferVar() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.522 - { 5.523 - strabon.query(queryBufferVar,strabon.getSailRepoConnection()); 5.524 - 5.525 - } 5.526 - 5.527 - @Test 5.528 - public void testQueryBufferConst() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.529 - { 5.530 - strabon.query(queryBufferConst,strabon.getSailRepoConnection()); 5.531 - 5.532 - } 5.533 - 5.534 - @Test 5.535 - public void testQueryBufferConst2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.536 - { 5.537 - strabon.query(queryBufferConst2,strabon.getSailRepoConnection()); 5.538 - 5.539 - } 5.540 - 5.541 - @Test 5.542 - public void testQueryBufferConstInSelect() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.543 - { 5.544 - strabon.query(queryBufferConstInSelect,strabon.getSailRepoConnection()); 5.545 - 5.546 - } 5.547 - 5.548 - @Test 5.549 - public void testQueryBufferSelectFilterA() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.550 - { 5.551 - strabon.query(queryBufferSelectFilterA,strabon.getSailRepoConnection()); 5.552 - 5.553 - } 5.554 - 5.555 - @Test 5.556 - public void testQueryBufferSelectFilterB() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.557 - { 5.558 - strabon.query(queryBufferSelectFilterB,strabon.getSailRepoConnection()); 5.559 - 5.560 - } 5.561 - 5.562 - @Test 5.563 - public void testQueryEnvelopeConvexHull() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.564 - { 5.565 - strabon.query(queryBufferSelectFilterB,strabon.getSailRepoConnection()); 5.566 - 5.567 - } 5.568 - 5.569 - @Test 5.570 - public void testQueryMetrics1() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.571 - { 5.572 - strabon.query(queryMetrics1,strabon.getSailRepoConnection()); 5.573 - 5.574 - } 5.575 - 5.576 - @Test 5.577 - public void testQueryMetricsLightOptimized() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.578 - { 5.579 - strabon.query(queryMetricsLightOptimized,strabon.getSailRepoConnection()); 5.580 - 5.581 - } 5.582 - 5.583 - @Test 5.584 - public void testQueryMetricsAreaMustNotBeOptimized() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.585 - { 5.586 - strabon.query(queryMetricsLightOptimized,strabon.getSailRepoConnection()); 5.587 - 5.588 - } 5.589 - 5.590 - @Test 5.591 - public void testQueryMetricsMathInSelect() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.592 - { 5.593 - strabon.query(queryMetricsMathInSelect,strabon.getSailRepoConnection()); 5.594 - 5.595 - } 5.596 - 5.597 - @Test 5.598 - // MonetDB has not function Dimension 5.599 - abstract public void testQuerySpatialProperties() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException ; 5.600 - 5.601 - @Test 5.602 - // MonetDB has not function Dimension 5.603 - abstract public void testQuerySpatialPropertiesConst() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException ; 5.604 - 5.605 - @Test 5.606 - public void testQueryRelate() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.607 - { 5.608 - strabon.query(queryRelate,strabon.getSailRepoConnection()); 5.609 - 5.610 - } 5.611 - 5.612 - @Test 5.613 - public void testQueryThematicUnion() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.614 - { 5.615 - strabon.query(queryThematicUnion,strabon.getSailRepoConnection()); 5.616 - 5.617 - } 5.618 - 5.619 - @Test 5.620 - public void testQuery6_real() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.621 - { 5.622 - strabon.query(query6_real,strabon.getSailRepoConnection()); 5.623 - 5.624 - } 5.625 - 5.626 - @Test 5.627 - public void testQuery6_real_union() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.628 - { 5.629 - strabon.query(query6_real_union,strabon.getSailRepoConnection()); 5.630 - 5.631 - } 5.632 - @Test 5.633 - public void testQueryNegation() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.634 - { 5.635 - strabon.query(queryNegation,strabon.getSailRepoConnection()); 5.636 - 5.637 - } 5.638 - @Test 5.639 - public void testQueryNegation2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 5.640 - { 5.641 - strabon.query(queryNegation2,strabon.getSailRepoConnection()); 5.642 - 5.643 - } 5.644 - 5.645 -// @Test 5.646 -// public void testPrintDataset() throws MalformedQueryException 5.647 -// { 5.648 -// String query = "SELECT ?s ?p ?o WHERE { ?s ?p ?o }"; 5.649 -// strabon.query(query,strabon.getSailRepoConnection()); 5.650 -// 5.651 -// } 5.652 -}
6.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/HavingTests.java Thu May 14 11:24:32 2015 +0300 6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 6.3 @@ -1,124 +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 HavingTests { 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 - // @BeforeClass 6.35 - // public abstract static void initialize() throws SQLException, ClassNotFoundException 6.36 - // { 6.37 - // strabon = new Strabon("cco2","postgres","p1r3as", 5432, "localhost", true); 6.38 - // } 6.39 - 6.40 - 6.41 - 6.42 - String prefixes = 6.43 - " PREFIX noa:<http://www.earthobservatory.eu/ontologies/noaOntology.owl#>"+ 6.44 - " PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+ 6.45 - " PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "; 6.46 - 6.47 - 6.48 - 6.49 - 6.50 - String query1Having = prefixes + 6.51 - "SELECT ?burntArea ?baGeo "+ 6.52 - "WHERE { "+ 6.53 - "?burntArea a noa:BurntArea; "+ 6.54 - "strdf:hasGeometry ?baGeo. "+ 6.55 - "?urbanArea a noa:UrbanArea; "+ 6.56 - "strdf:hasGeometry ?uaGeo; "+ 6.57 - "FILTER(strdf:mbbIntersects(?baGeo,?uaGeo)). "+ 6.58 - "} "+ 6.59 - "GROUP BY ?burntArea ?baGeo "+ 6.60 - "HAVING (strdf:area(strdf:union(?uaGeo)) > 8) "; 6.61 - 6.62 - String query2HavingA = prefixes + 6.63 - "SELECT ?burntArea ?baGeo (strdf:extent(?uaGeo) AS ?totalMBB) "+ 6.64 - "WHERE { "+ 6.65 - "?burntArea a noa:BurntArea; "+ 6.66 - "strdf:hasGeometry ?baGeo. "+ 6.67 - "?urbanArea a noa:UrbanArea; "+ 6.68 - "strdf:hasGeometry ?uaGeo; "+ 6.69 - "FILTER(strdf:mbbIntersects(?baGeo,?uaGeo)). "+ 6.70 - "} "+ 6.71 - "GROUP BY ?burntArea ?baGeo "+ 6.72 - "HAVING (strdf:area(strdf:extent(?uaGeo)) > 8) "; 6.73 - 6.74 - String query2HavingB = prefixes + 6.75 - "SELECT ?burntArea ?baGeo (strdf:difference(strdf:extent(?uaGeo),strdf:union(?uaGeo)) AS ?MBBdiff) "+ 6.76 - "WHERE { "+ 6.77 - "?burntArea a noa:BurntArea; "+ 6.78 - "strdf:hasGeometry ?baGeo. "+ 6.79 - "?urbanArea a noa:UrbanArea; "+ 6.80 - "strdf:hasGeometry ?uaGeo; "+ 6.81 - "FILTER(strdf:mbbIntersects(?baGeo,?uaGeo)). "+ 6.82 - "} "+ 6.83 - "GROUP BY ?burntArea ?baGeo "+ 6.84 - "HAVING (strdf:area(strdf:extent(?uaGeo)) > 8) "; 6.85 - 6.86 - String query2HavingC = prefixes + 6.87 - "SELECT ?burntArea (strdf:extent(?uaGeo) AS ?totalMBB) "+ 6.88 - "WHERE { "+ 6.89 - "?burntArea a noa:BurntArea; "+ 6.90 - "strdf:hasGeometry ?baGeo. "+ 6.91 - "?urbanArea a noa:UrbanArea; "+ 6.92 - "strdf:hasGeometry ?uaGeo; "+ 6.93 - "FILTER(strdf:mbbIntersects(?baGeo,?uaGeo)). "+ 6.94 - "} "+ 6.95 - "GROUP BY ?burntArea "+ 6.96 - "HAVING (strdf:area(strdf:extent(?uaGeo)) < 8) "; 6.97 - 6.98 - @Test 6.99 - public void testQuery1Having() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 6.100 - { 6.101 - strabon.query(query1Having,strabon.getSailRepoConnection()); 6.102 - 6.103 - } 6.104 - 6.105 - @Test 6.106 - public void testQuery2HavingA() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 6.107 - { 6.108 - strabon.query(query2HavingA,strabon.getSailRepoConnection()); 6.109 - 6.110 - } 6.111 - 6.112 - @Test 6.113 - public void testQuery2HavingB() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 6.114 - { 6.115 - strabon.query(query2HavingB,strabon.getSailRepoConnection()); 6.116 - 6.117 - } 6.118 - 6.119 - @Test 6.120 - public void testQuery2HavingC() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 6.121 - { 6.122 - strabon.query(query2HavingC,strabon.getSailRepoConnection()); 6.123 - 6.124 - } 6.125 - 6.126 - 6.127 -}
7.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/JoinTests.java Thu May 14 11:24:32 2015 +0300 7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 7.3 @@ -1,207 +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 java.io.IOException; 7.16 - 7.17 -import org.junit.Test; 7.18 -import org.openrdf.query.MalformedQueryException; 7.19 -import org.openrdf.query.QueryEvaluationException; 7.20 -import org.openrdf.query.TupleQueryResultHandlerException; 7.21 - 7.22 -public class JoinTests { 7.23 - 7.24 - public static Strabon strabon; 7.25 - 7.26 - protected static String jdbcDriver= "org.postgresql.Driver"; 7.27 - protected static String serverName = "localhost"; 7.28 - protected static String username = "postgres"; 7.29 - protected static String password = "postgres"; 7.30 - protected static Integer port = 5432; 7.31 - protected static java.sql.Connection conn = null; 7.32 - protected static String databaseName = null; 7.33 - 7.34 - 7.35 -// @BeforeClass 7.36 -// public static void initialize() throws SQLException, ClassNotFoundException 7.37 -// { 7.38 -// strabon = new Strabon("join-tests","postgres","p1r3as", 5432, "localhost", true); 7.39 -// 7.40 -// } 7.41 - 7.42 - 7.43 - 7.44 - String query5a = 7.45 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 7.46 - "SELECT ?sensor ?place WHERE "+ 7.47 - "{"+ 7.48 - "?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 7.49 - "?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 7.50 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 7.51 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 7.52 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 7.53 - "?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 7.54 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 7.55 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 7.56 - "?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 7.57 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?areaGeo) && strdf:mbbIntersects(?sensorsGeo,?placeGeo)) . "+ 7.58 - "}"; 7.59 - 7.60 - String query5b = 7.61 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 7.62 - "SELECT ?sensor ?place WHERE "+ 7.63 - "{ "+ 7.64 - "?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 7.65 - "?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 7.66 - "?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 7.67 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 7.68 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 7.69 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 7.70 - "?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 7.71 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 7.72 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 7.73 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?areaGeo)) . "+ 7.74 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?placeGeo)). }"; 7.75 - 7.76 - String query5c = 7.77 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 7.78 - "SELECT ?sensor ?place WHERE "+ 7.79 - "{ "+ 7.80 - "?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 7.81 - "?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 7.82 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 7.83 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 7.84 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 7.85 - "?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 7.86 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 7.87 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 7.88 - "?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 7.89 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?areaGeo)) . "+ 7.90 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?placeGeo)). }"; 7.91 - 7.92 - String query9a = 7.93 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> " + 7.94 - "SELECT ?populatedArea ?sensor ?portArea " + 7.95 - "WHERE " + 7.96 - "{ " + 7.97 - "?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . " + 7.98 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . " + 7.99 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . " + 7.100 - " ?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . " + 7.101 - " ?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . " + 7.102 - " ?portArea <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasLandUse> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#portAreas> . " + 7.103 - " ?portArea a <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#Area> . " + 7.104 - " ?portArea <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeometry> ?seaGeo . " + 7.105 - " ?populatedArea <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/PopulatedPlace> . " + 7.106 - " ?populatedAreaGeoNames <http://www.w3.org/2002/07/owl#sameAs> ?populatedArea . " + 7.107 - " ?populatedAreaGeoNames <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . " + 7.108 - " FILTER( strdf:mbbIntersects(?areaGeo,?sensorsGeo) ) . " + 7.109 - " FILTER( strdf:mbbIntersects(?seaGeo,?sensorsGeo) ) . " + 7.110 - "}"; 7.111 - 7.112 - String query3way = 7.113 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 7.114 - "SELECT ?sensor ?place WHERE "+ 7.115 - "{ "+ 7.116 - "?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 7.117 - "?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 7.118 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 7.119 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 7.120 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 7.121 - "?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 7.122 - "?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 7.123 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 7.124 - "?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 7.125 - "FILTER(strdf:mbbIntersects(?sensorsGeo,strdf:union(?areaGeo,?placeGeo)) " + 7.126 - "&& strdf:mbbIntersects(?sensorsGeo,?placeGeo) && ?place = ?spaceRegion) . "+ 7.127 - "}"; 7.128 - 7.129 - String query5_3filters = 7.130 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 7.131 - "SELECT ?sensor ?place WHERE "+ 7.132 - "{ "+ 7.133 - " ?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 7.134 - " ?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 7.135 - " ?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 7.136 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 7.137 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 7.138 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 7.139 - " ?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 7.140 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 7.141 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 7.142 - " FILTER(strdf:mbbIntersects(?sensorsGeo,?areaGeo)) . "+ 7.143 - "FILTER(strdf:mbbIntersects(?sensorsGeo,?placeGeo)). "+ 7.144 - " FILTER(strdf:mbbIntersects(?areaGeo,?placeGeo)).}"; 7.145 - 7.146 - String query5_properties = 7.147 - "PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "+ 7.148 - "SELECT ?sensor ?place WHERE "+ 7.149 - "{ "+ 7.150 - " ?place a <http://linkedgeodata.org/ontology/NaturalWood> . "+ 7.151 - " ?place <http://www.w3.org/2003/01/geo/wgs84_pos#geometry> ?placeGeo. "+ 7.152 - " ?sensorSystem <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> ?sensor . "+ 7.153 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> ?sensorSystem . "+ 7.154 - " ?sensorsDeployment <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> ?sensorPlatform . "+ 7.155 - "?sensorPlatform <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> ?spaceRegion . "+ 7.156 - " ?spaceRegion <http://dbpedia.org/property/hasGeometry> ?sensorsGeo . "+ 7.157 - "?areaOfInterest <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeography> ?areaGeo . "+ 7.158 - "?areaOfInterest <http://www.geonames.org/ontology#name> \"London\". "+ 7.159 - " FILTER(strdf:mbbIntersects(?sensorsGeo,?areaGeo)) . "+ 7.160 - "FILTER(strdf:dimension(?sensorsGeo) = strdf:dimension(?placeGeo)). }"; 7.161 - 7.162 - @Test 7.163 - public void testQuery5a() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.164 - { 7.165 - strabon.query(query5a,strabon.getSailRepoConnection()); 7.166 - 7.167 - } 7.168 - 7.169 - @Test 7.170 - public void testQuery5b() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.171 - { 7.172 - strabon.query(query5b,strabon.getSailRepoConnection()); 7.173 - 7.174 - } 7.175 - 7.176 - @Test 7.177 - public void testQuery5c() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.178 - { 7.179 - strabon.query(query5c,strabon.getSailRepoConnection()); 7.180 - 7.181 - } 7.182 - 7.183 - @Test 7.184 - public void testQuery9a() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.185 - { 7.186 - strabon.query(query9a,strabon.getSailRepoConnection()); 7.187 - 7.188 - } 7.189 - 7.190 - @Test 7.191 - public void testQuery3way() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.192 - { 7.193 - strabon.query(query3way,strabon.getSailRepoConnection()); 7.194 - 7.195 - } 7.196 - 7.197 - @Test 7.198 - public void testQuery5_3filters() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.199 - { 7.200 - strabon.query(query5_3filters,strabon.getSailRepoConnection()); 7.201 - 7.202 - } 7.203 - 7.204 - @Test 7.205 - public void testQuery5_properties() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 7.206 - { 7.207 - strabon.query(query5_properties,strabon.getSailRepoConnection()); 7.208 - 7.209 - } 7.210 -}
8.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/MeaningfulAggregateTests.java Thu May 14 11:24:32 2015 +0300 8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 8.3 @@ -1,193 +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 java.io.IOException; 8.16 - 8.17 -import org.junit.Test; 8.18 -import org.openrdf.query.MalformedQueryException; 8.19 -import org.openrdf.query.QueryEvaluationException; 8.20 -import org.openrdf.query.TupleQueryResultHandlerException; 8.21 - 8.22 -public class MeaningfulAggregateTests { 8.23 - public static Strabon strabon; 8.24 - 8.25 - protected static String jdbcDriver= "org.postgresql.Driver"; 8.26 - protected static String serverName = "localhost"; 8.27 - protected static String username = "postgres"; 8.28 - protected static String password = "postgres"; 8.29 - protected static Integer port = 5432; 8.30 - protected static java.sql.Connection conn = null; 8.31 - protected static String databaseName = null; 8.32 - 8.33 - 8.34 -// @BeforeClass 8.35 -// public abstract static void initialize() throws SQLException, ClassNotFoundException 8.36 -// { 8.37 -// strabon = new Strabon("cco2","postgres","p1r3as", 5432, "localhost", true); 8.38 -// } 8.39 - 8.40 - 8.41 - 8.42 - String prefixes = 8.43 - " PREFIX noa:<http://www.earthobservatory.eu/ontologies/noaOntology.owl#>"+ 8.44 - " PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+ 8.45 - " PREFIX strdf:<http://strdf.di.uoa.gr/ontology#> "; 8.46 - 8.47 - 8.48 - /** 8.49 - * May seem like this query has a spatial dimension, 8.50 - * but since the spatial literal is not involved in any 8.51 - * spatial operations, it is evaluated as a plain literal 8.52 - */ 8.53 - String query1NotSpatial = prefixes + 8.54 - "SELECT ( COUNT(?hotspot) AS ?count) ?geo "+ 8.55 - "WHERE " + 8.56 - "{ " + 8.57 - " ?hotspot a noa:Hotspot;" + 8.58 - " strdf:hasGeometry ?geo. " + 8.59 - "}"+ 8.60 - "GROUP BY ?geo"; 8.61 - 8.62 - /** 8.63 - * Current results: 6 - 4 - 2 8.64 - */ 8.65 - String query1Spatial = prefixes + 8.66 - "SELECT ( COUNT(?hotspot) AS ?count) ?geo "+ 8.67 - "WHERE " + 8.68 - "{ " + 8.69 - " ?hotspot a noa:Hotspot;" + 8.70 - " strdf:hasGeometry ?geo. " + 8.71 - " ?urbanArea a noa:UrbanArea; " + 8.72 - " strdf:hasGeometry ?uaGeo."+ 8.73 - " FILTER(strdf:disjoint(?geo,?uaGeo)) "+ 8.74 - "}"+ 8.75 - "GROUP BY ?geo"; 8.76 - 8.77 - 8.78 - /** 8.79 - * Functionality seems ok 8.80 - */ 8.81 - String query2simple = prefixes + 8.82 - "SELECT ?burntArea ?baGeo " + 8.83 - "(strdf:union(?uaGeo) AS ?urban) "+ 8.84 - "WHERE { " + 8.85 - " ?burntArea a noa:BurntArea; " + 8.86 - " strdf:hasGeometry ?baGeo. " + 8.87 - " ?urbanArea a noa:UrbanArea; " + 8.88 - " strdf:hasGeometry ?uaGeo. " + 8.89 - " FILTER(strdf:mbbIntersects(?baGeo,?uaGeo))" + 8.90 - " } " + 8.91 - " GROUP BY ?burntArea ?baGeo "+ 8.92 - " "; 8.93 - 8.94 - String query2complexA = prefixes + 8.95 - "SELECT ?burntArea " + 8.96 -// "?baGeo " + 8.97 - "(strdf:difference(?baGeo, strdf:union(?uaGeo)) AS ?urbanPiece) "+ 8.98 - " WHERE { " + 8.99 - " ?burntArea a noa:BurntArea; " + 8.100 - " strdf:hasGeometry ?baGeo. " + 8.101 - " ?urbanArea a noa:UrbanArea; " + 8.102 - " strdf:hasGeometry ?uaGeo. " + 8.103 - " FILTER(strdf:mbbIntersects(?baGeo,?uaGeo))" + 8.104 - " } " + 8.105 - " GROUP BY ?burntArea" + 8.106 -// " ?baGeo "+ 8.107 - " "; 8.108 - 8.109 - String query2complexB = prefixes + 8.110 - "SELECT ?burntArea ?baGeo " + 8.111 - "(strdf:difference(strdf:union(?uaGeo) , ?baGeo) AS ?urbanPiece) "+ 8.112 - " WHERE { " + 8.113 - " ?burntArea a noa:BurntArea; " + 8.114 - " strdf:hasGeometry ?baGeo. " + 8.115 - " ?urbanArea a noa:UrbanArea; " + 8.116 - " strdf:hasGeometry ?uaGeo. " + 8.117 - " FILTER(strdf:mbbIntersects(?baGeo,?uaGeo))" + 8.118 - " } " + 8.119 - " GROUP BY ?burntArea ?baGeo "+ 8.120 - " "; 8.121 - 8.122 - String query2complexC = prefixes + 8.123 - "SELECT ?burntArea ?baGeo " + 8.124 - "(strdf:buffer(strdf:union(?uaGeo) , 5) AS ?urbanPiece) "+ 8.125 - " WHERE { " + 8.126 - " ?burntArea a noa:BurntArea; " + 8.127 - " strdf:hasGeometry ?baGeo. " + 8.128 - " ?urbanArea a noa:UrbanArea; " + 8.129 - " strdf:hasGeometry ?uaGeo. " + 8.130 - " FILTER(strdf:mbbIntersects(?baGeo,?uaGeo))" + 8.131 - " } " + 8.132 - " GROUP BY ?burntArea ?baGeo "+ 8.133 - " "; 8.134 - 8.135 - String query2complexD = prefixes + 8.136 - "SELECT " + 8.137 - " ?burntArea " + 8.138 -// " ?baGeo " + 8.139 -// " (strdf:union(?uaGeo) AS ?urban) " + 8.140 - " (COUNT(?uaGeo) AS ?urbanNo) "+ 8.141 - "WHERE { " + 8.142 - " ?burntArea a noa:BurntArea; " + 8.143 - " strdf:hasGeometry ?baGeo. " + 8.144 - " ?urbanArea a noa:UrbanArea; " + 8.145 - " strdf:hasGeometry ?uaGeo. " + 8.146 - " FILTER(strdf:mbbIntersects(?baGeo,?uaGeo))" + 8.147 - " } " + 8.148 - " GROUP BY ?burntArea ?baGeo "+ 8.149 - " HAVING (COUNT(?uaGeo) > 1 )"+ 8.150 - " " 8.151 - ; 8.152 - 8.153 - @Test 8.154 - public void testQuery1NotSpatial() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 8.155 - { 8.156 - strabon.query(query1NotSpatial,strabon.getSailRepoConnection()); 8.157 - 8.158 - } 8.159 - @Test 8.160 - public void testQuery1Spatial() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 8.161 - { 8.162 - strabon.query(query1Spatial,strabon.getSailRepoConnection()); 8.163 - 8.164 - } 8.165 - @Test 8.166 - public void testQuery2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 8.167 - { 8.168 - strabon.query(query2simple,strabon.getSailRepoConnection()); 8.169 - 8.170 - } 8.171 - @Test 8.172 - public void testQuery2complexA() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 8.173 - { 8.174 - strabon.query(query2complexA,strabon.getSailRepoConnection()); 8.175 - 8.176 - } 8.177 - @Test 8.178 - public void testQuery2complexB() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 8.179 - { 8.180 - strabon.query(query2complexB,strabon.getSailRepoConnection()); 8.181 - 8.182 - } 8.183 - @Test 8.184 - public void testQuery2complexC() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 8.185 - { 8.186 - strabon.query(query2complexC,strabon.getSailRepoConnection()); 8.187 - 8.188 - } 8.189 - @Test 8.190 - public void testQuery2complexD() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 8.191 - { 8.192 - strabon.query(query2complexD,strabon.getSailRepoConnection()); 8.193 - 8.194 - } 8.195 - 8.196 -}
9.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/NOATests.java Thu May 14 11:24:32 2015 +0300 9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 9.3 @@ -1,167 +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 java.io.IOException; 9.16 - 9.17 -import org.junit.Test; 9.18 -import org.openrdf.query.MalformedQueryException; 9.19 -import org.openrdf.query.QueryEvaluationException; 9.20 -import org.openrdf.query.TupleQueryResultHandlerException; 9.21 - 9.22 -public class NOATests { 9.23 - public static Strabon strabon; 9.24 - 9.25 - 9.26 - protected static String jdbcDriver= "org.postgresql.Driver"; 9.27 - protected static String serverName = "localhost"; 9.28 - protected static String username = "postgres"; 9.29 - protected static String password = "postgres"; 9.30 - protected static Integer port = 5432; 9.31 - protected static java.sql.Connection conn = null; 9.32 - protected static String databaseName = null; 9.33 - 9.34 - 9.35 - 9.36 - String prefixes = 9.37 - "PREFIX imAn: <http://teleios.di.uoa.gr/ontologies/imageAnnotationOntology.owl#> "+ 9.38 - "PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> "+ 9.39 - "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "+ 9.40 - "PREFIX eolo:<http://www.dlr.de/ontologies/EOLO.owl#> "+ 9.41 - "PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> "+ 9.42 - "PREFIX base: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> "+ 9.43 - "PREFIX ex: <http://www.example.org/ontology#> "+ 9.44 - "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> "; 9.45 - 9.46 - String query1 = prefixes+ 9.47 - "SELECT ?FILENAME { "+ 9.48 - "?COLLECTION rdf:type imAn:NOA-UC . "+ 9.49 - "?FILE noa:belongToCollection ?COLLECTION . "+ 9.50 - "?FILE noa:hasFilename ?FILENAME .}"; 9.51 - 9.52 - String query2 = prefixes+ 9.53 - "SELECT ?FILENAME { "+ 9.54 - "?COLLECTION rdf:type imAn:NOA-UC . "+ 9.55 - "?FILE noa:belongToCollection ?COLLECTION . "+ 9.56 - "?FILE noa:hasFilename ?FILENAME . "+ 9.57 - "?COLLECTION eolo:hasProcessingLevel eolo:L1 . "+ 9.58 - "?COLLECTION eolo:hasResolution eolo:LowResolution .}"; 9.59 - 9.60 - String query3 = prefixes+ 9.61 - "SELECT ?FILENAME "+ 9.62 - "WHERE { ?FILE rdf:type noa:ShpFile . "+ 9.63 - "?FILE noa:hasFilename ?FILENAME . "+ 9.64 - "?FILE noa:hasAcquisitionTime ?SENSING_TIME . "+ 9.65 - "FILTER( str(?SENSING_TIME) > \"2010-08-21T20:00:00\" ) . "+ 9.66 - "FILTER( str(?SENSING_TIME) < \"2010-08-21T20:30:00\" ) . "+ 9.67 - "?FILE noa:isDerivedFromSensor ?SENSOR . "+ 9.68 - "FILTER( str(?SENSOR) = \"MSG1_RSS\" ) . }"; 9.69 - 9.70 - 9.71 - protected String query4 = prefixes+ 9.72 - "SELECT DISTINCT ?H1 ?HGEO1 ?CONFIRMATION1 ?SATTELITE1 ?HCONF1 ?PC1 "+ 9.73 - "WHERE { "+ 9.74 - "?H1 rdf:type noa:Hotspot . "+ 9.75 - "?H1 noa:hasConfidence ?HCONF1 . "+ 9.76 - "?H1 noa:hasGeometry ?HGEO1 . "+ 9.77 - "?H1 noa:hasAcquisitionTime ?HAT1 . "+ 9.78 - "?H1 noa:isDerivedFromSensor ?SENSOR1 . "+ 9.79 - "?H1 noa:isDerivedFromSatellite ?SATTELITE1 . "+ 9.80 - "?H1 noa:producedFromProcessingChain ?PC1 . "+ 9.81 - "?H1 noa:hasConfirmation ?CONFIRMATION1 . "+ 9.82 - "FILTER( \"2010-08-22T15:35:00\" < str(?HAT1) " + 9.83 - "&& str(?HAT1) < \"2010-08-22T16:10:00\" && str(?SENSOR1) = \"MSG1_RSS\" && str(?PC1) = \"plain\" ) . "+ 9.84 - "OPTIONAL { "+ 9.85 - "?H2 rdf:type noa:Hotspot . "+ 9.86 - "?H2 noa:hasGeometry ?HGEO2 . "+ 9.87 - "?H2 noa:hasAcquisitionTime ?HAT2 . "+ 9.88 - "?H2 noa:isDerivedFromSensor ?SENSOR2 . "+ 9.89 - "?H2 noa:producedFromProcessingChain ?PC2 . "+ 9.90 - "FILTER( strdf:equals(?HGEO1 , ?HGEO2) ) . "+ 9.91 - "FILTER( str(?HAT2) = \"2010-08-22T16:10:00\" && str(?SENSOR2) = \"MSG1_RSS\" " + 9.92 - "&& str(?PC2) = \"plain\" ) . "+ 9.93 - "} . "+ 9.94 - "FILTER (!bound(?H2)) .} "; 9.95 - 9.96 - String query5 = prefixes+ 9.97 - "SELECT DISTINCT ?H "+ 9.98 - "WHERE { "+ 9.99 - "?H rdf:type noa:Hotspot . "+ 9.100 - "?H noa:hasGeometry ?HGEO . "+ 9.101 - "?H noa:isDerivedFromSensor ?HS . "+ 9.102 - "FILTER( str(?HS) = \"MSG2\" ) . "+ 9.103 - "?H noa:hasAcquisitionTime ?HAT . "+ 9.104 - "FILTER(str(?HAT) = \"2007-08-24T12:45:00\") . "+ 9.105 - "OPTIONAL { "+ 9.106 - "?C rdf:type noa:Coastline . "+ 9.107 - "?C noa:hasGeometry ?CGEO . "+ 9.108 - "filter ( strdf:mbbIntersects(?HGEO , ?CGEO) ) . "+ 9.109 - "} FILTER( !bound(?C) ) "+ 9.110 - "}"; 9.111 - 9.112 - protected String query6 = prefixes+ 9.113 - "SELECT ?H (strdf:intersection(?HGEO, ?CGEO) AS ?REFINEDGEO) "+ 9.114 - "WHERE { "+ 9.115 - "?H rdf:type noa:Hotspot . "+ 9.116 - "?H noa:hasGeometry ?HGEO . "+ 9.117 - "?H noa:isDerivedFromSensor ?HS . "+ 9.118 - "FILTER( str(?HS) = \"MSG2\" ) . "+ 9.119 - "?H noa:hasAcquisitionTime ?HAT . "+ 9.120 - "FILTER(str(?HAT) = \"2007-08-24T12:45:00\") . "+ 9.121 - "?C rdf:type noa:Coastline . "+ 9.122 - "?C noa:hasGeometry ?CGEO . "+ 9.123 - "FILTER( strdf:overlap(?HGEO,?CGEO) ) . "+ 9.124 - "} ORDER BY ?H "; 9.125 - 9.126 - protected String query7 = prefixes+ 9.127 - //"SELECT ?H (strdf:intersection(?HGEO, ?CGEO) AS ?REFINEDGEO) "+ 9.128 - "INSERT {?H noa:hasGeometry (strdf:intersection(?HGEO, ?CGEO) AS ?REFINEDGEO)} \n"+ 9.129 - "WHERE { "+ 9.130 - "?H rdf:type noa:Hotspot . "+ 9.131 - "?H noa:hasGeometry ?HGEO . "+ 9.132 - "?H noa:isDerivedFromSensor ?HS . "+ 9.133 - "FILTER( str(?HS) = \"MSG2\" ) . "+ 9.134 - "?H noa:hasAcquisitionTime ?HAT . "+ 9.135 - "FILTER(str(?HAT) = \"2007-08-24T12:45:00\") . "+ 9.136 - "?C rdf:type noa:Coastline . "+ 9.137 - "?C noa:hasGeometry ?CGEO . "+ 9.138 - "FILTER( strdf:overlap(?HGEO,?CGEO) ) . "+ 9.139 - "} "; 9.140 - 9.141 - 9.142 - @Test 9.143 - public void testQuery1() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.144 - { 9.145 - strabon.query(query1,strabon.getSailRepoConnection()); 9.146 - 9.147 - } 9.148 - 9.149 - @Test 9.150 - public void testQuery2() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.151 - { 9.152 - strabon.query(query2,strabon.getSailRepoConnection()); 9.153 - 9.154 - } 9.155 - 9.156 - @Test 9.157 - public void testQuery3() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 9.158 - { 9.159 - strabon.query(query3,strabon.getSailRepoConnection()); 9.160 - 9.161 - } 9.162 - 9.163 - @Test 9.164 - public void testQuery7() throws MalformedQueryException 9.165 - { 9.166 - strabon.update(query7,strabon.getSailRepoConnection()); 9.167 - 9.168 - } 9.169 - 9.170 -}
10.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SPARQL11Tests.java Thu May 14 11:24:32 2015 +0300 10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 10.3 @@ -1,356 +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 -import static org.junit.Assert.assertEquals; 10.16 -import static org.junit.Assert.assertTrue; 10.17 - 10.18 -import java.io.IOException; 10.19 -import java.util.ArrayList; 10.20 - 10.21 -import org.junit.BeforeClass; 10.22 -import org.junit.Test; 10.23 -import org.openrdf.model.vocabulary.RDF; 10.24 -import org.openrdf.model.vocabulary.XMLSchema; 10.25 -import org.openrdf.query.MalformedQueryException; 10.26 -import org.openrdf.query.QueryEvaluationException; 10.27 -import org.openrdf.query.TupleQueryResultHandlerException; 10.28 -import org.openrdf.repository.RepositoryException; 10.29 - 10.30 -public class SPARQL11Tests { 10.31 - public static Strabon strabon; 10.32 - 10.33 - public String FOAF_NS = "http://xmlns.com/foaf/0.1/", 10.34 - DT_NS = "http://example.org/datatype#", 10.35 - NS_NS = "http://example.org/ns#", 10.36 - DEF_NS = "http://example.org#", 10.37 - ORG_NS = "http://example.com/org#", 10.38 - DC_NS = "http://purl.org/dc/elements/1.1/", 10.39 - DC10_NS = "http://purl.org/dc/elements/1.0/", 10.40 - DC11_NS = "http://purl.org/dc/elements/1.1/"; 10.41 - 10.42 - protected String prefixes = 10.43 - "PREFIX rdf: <"+RDF.NAMESPACE+"> \n" + 10.44 - "PREFIX xsd: <"+XMLSchema.NAMESPACE+"> \n" + 10.45 - "PREFIX foaf: <"+FOAF_NS+"> \n" + 10.46 - "PREFIX dt: <"+DT_NS+"> "+ 10.47 - "PREFIX ns: <"+NS_NS+"> \n" + 10.48 - "PREFIX def: <"+DEF_NS+"> \n" + 10.49 - "PREFIX org: <"+ORG_NS+"> \n" + 10.50 - "PREFIX dc: <"+DC_NS+"> \n" + 10.51 - "PREFIX dc10: <"+DC10_NS+"> \n" + 10.52 - "PREFIX dc11: <"+DC11_NS+"> \n"; 10.53 - 10.54 -// @BeforeClass 10.55 -// public static void initialize() throws Exception 10.56 -// { 10.57 -// strabon = new eu.earthobservatory.runtime.postgis.Strabon("test", "postgres", "postgres", 5432, "localhost", true); 10.58 -// 10.59 -// } 10.60 - 10.61 - @Test 10.62 - public void testRetrieveEveryEntry() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.63 - { 10.64 - String queryString = prefixes+ 10.65 - "SELECT ?s ?p ?o \n" + 10.66 - "WHERE \n" + 10.67 - "{ ?s ?p ?o . } \n"; 10.68 - 10.69 - @SuppressWarnings("unchecked") 10.70 - ArrayList<String> results = (ArrayList <String>)strabon.query(queryString, strabon.getSailRepoConnection()); 10.71 - assertEquals(62, results.size()); 10.72 - } 10.73 - 10.74 - @Test 10.75 - public void testMultipleMatches() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.76 - { 10.77 - String queryString = prefixes+ 10.78 - "SELECT DISTINCT ?name ?mbox \n" + 10.79 - "WHERE \n" + 10.80 - "{ ?x foaf:name ?name . \n" + 10.81 - " ?x foaf:mbox ?mbox ." + 10.82 - " } \n"; 10.83 - 10.84 - @SuppressWarnings("unchecked") 10.85 - ArrayList<String> results = (ArrayList <String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.86 - assertEquals(11, results.size()); 10.87 - } 10.88 - 10.89 - @Test 10.90 - public void testMatchingLiterals() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.91 - { 10.92 - String queryString = prefixes+ 10.93 - "SELECT ?v WHERE { ?v ns:p ?s . FILTER(str(?s) = \"cat\") } \n"; 10.94 -// "SELECT ?v WHERE { ?v ns:p \"cat\" } \n"; 10.95 - 10.96 - @SuppressWarnings("unchecked") 10.97 - ArrayList<String> results = (ArrayList <String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.98 - assertEquals(1, results.size()); 10.99 - assertTrue(-1<results.indexOf("[v=http://example.org#x]")); 10.100 - } 10.101 - 10.102 - @Test 10.103 - public void testMatchingLiteralsWithLanguage() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.104 - { 10.105 - String queryString = prefixes+ 10.106 - "SELECT ?v WHERE { ?v ns:p \"cat\"@en } \n"; 10.107 - 10.108 - @SuppressWarnings("unchecked") 10.109 - ArrayList<String> results = (ArrayList <String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.110 - assertEquals(1, results.size()); 10.111 - assertTrue(-1<results.indexOf("[v=http://example.org#x]")); 10.112 - } 10.113 - 10.114 - @Test 10.115 - public void testMatchingLiteralsWithNumericTypes() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.116 - { 10.117 - String queryString = prefixes+ 10.118 - "SELECT ?v WHERE { ?v ns:p 42 } \n"; 10.119 - 10.120 - @SuppressWarnings("unchecked") 10.121 - ArrayList<String> results = (ArrayList <String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.122 - assertEquals(1, results.size()); 10.123 - assertTrue(-1<results.indexOf("[v=http://example.org#y]")); 10.124 - } 10.125 - 10.126 - @Test 10.127 - public void testMatchingLiteralWithArbitraryTypes() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.128 - { 10.129 - String queryString = prefixes+ 10.130 - "SELECT ?v WHERE { ?v ?p \"abc\"^^dt:specialDatatype } \n"; 10.131 - 10.132 - @SuppressWarnings("unchecked") 10.133 - ArrayList<String> results = (ArrayList <String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.134 - assertEquals(1, results.size()); 10.135 - assertTrue(-1<results.indexOf("[v=http://example.org#z]")); 10.136 - } 10.137 - 10.138 - @Test 10.139 - public void testBind() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.140 - { 10.141 - String queryString = prefixes+ 10.142 - "SELECT ?name \n" + 10.143 - "WHERE { \n" + 10.144 - " ?P foaf:givenName ?G . \n" + 10.145 - " ?P foaf:surname ?S . \n" + 10.146 - " BIND( CONCAT(?G, \" \", ?S) AS ?name ) . \n"+ 10.147 - "} \n"; 10.148 - 10.149 - @SuppressWarnings("unchecked") 10.150 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.151 - assertEquals(1, results.size()); 10.152 - assertTrue(-1<results.indexOf("[name=\"John Doe\"]")); 10.153 - } 10.154 - 10.155 - 10.156 - @Test 10.157 - public void testConcat() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.158 - { 10.159 - String queryString = prefixes+ 10.160 - "SELECT ( CONCAT(?G, \" \", ?S) AS ?name ) \n" + 10.161 - "WHERE { ?P foaf:givenName ?G ; foaf:surname ?S } \n"; 10.162 - 10.163 - @SuppressWarnings("unchecked") 10.164 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.165 - assertEquals(1, results.size()); 10.166 - assertTrue(-1<results.indexOf("[name=\"John Doe\"]")); 10.167 - } 10.168 - 10.169 - @Test 10.170 - public void testOptional() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.171 - { 10.172 - String queryString = prefixes+ 10.173 - "SELECT ?name ?mbox \n"+ 10.174 - "WHERE { ?x foaf:name ?name . \n"+ 10.175 - " OPTIONAL { ?x foaf:mbox ?mbox } \n"+ 10.176 - "} \n"; 10.177 - 10.178 - @SuppressWarnings("unchecked") 10.179 - ArrayList<String> results = (ArrayList<String>)strabon.query(queryString, strabon.getSailRepoConnection()); 10.180 - assertEquals(13, results.size()); 10.181 - assertTrue(-1<results.indexOf("[name=\"Alice\";mbox=mailto:alice@example.com]")); 10.182 - assertTrue(-1<results.indexOf("[name=\"Alice\";mbox=mailto:alice@work.example]")); 10.183 - assertTrue(-1<results.indexOf("[name=\"Carol Baz\"]")); 10.184 - } 10.185 - 10.186 - @Test 10.187 - public void testOptionalFilter() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.188 - { 10.189 - String queryString = prefixes+ 10.190 - "SELECT ?title ?price \n"+ 10.191 - "WHERE { ?x dc:title ?title . \n"+ 10.192 - " OPTIONAL { ?x ns:price ?price . FILTER (?price < 30) } \n"+ 10.193 - "}\n"; 10.194 - 10.195 - @SuppressWarnings("unchecked") 10.196 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.197 - assertEquals(4, results.size()); 10.198 - assertTrue(-1<results.indexOf("[title=\"SPARQL Tutorial\"]")); 10.199 - assertTrue(-1<results.indexOf("[title=\"SPARQL Protocol Tutorial\"]")); 10.200 - assertTrue(-1<results.indexOf("[title=\"SPARQL (updated)\"]")); 10.201 - assertTrue(-1<results.indexOf("[title=\"The Semantic Web\";price=\"23\"^^<http://www.w3.org/2001/XMLSchema#integer>]")); 10.202 - } 10.203 - 10.204 - @Test 10.205 - public void testTwoOptionals() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.206 - { 10.207 - String queryString = prefixes+ 10.208 - "SELECT ?name ?mbox ?hpage \n"+ 10.209 - "WHERE { ?x foaf:name ?name \n"+ 10.210 - " OPTIONAL { ?x foaf:mbox ?mbox } . \n"+ 10.211 - " OPTIONAL { ?x foaf:homepage ?hpage } . \n"+ 10.212 - "} ORDER BY ?name \n"; 10.213 - 10.214 - @SuppressWarnings("unchecked") 10.215 - ArrayList<String> results = (ArrayList<String>)strabon.query(queryString, strabon.getSailRepoConnection()); 10.216 - 10.217 - assertEquals(13, results.size()); 10.218 - assertTrue(-1<results.indexOf("[hpage=http://work.example.org/alice/;name=\"A. Foo\";mbox=mailto:alice@example.com]")); 10.219 - assertTrue(-1<results.indexOf("[name=\"Bob\";mbox=mailto:bob@work.example]")); 10.220 - assertTrue(-1<results.indexOf("[name=\"C. Baz\"]")); 10.221 - } 10.222 - 10.223 - 10.224 - @Test 10.225 - public void testFilterNotExists() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.226 - { 10.227 - String queryString = prefixes+ 10.228 - "SELECT ?person \n"+ 10.229 - "WHERE { \n"+ 10.230 - " ?person rdf:type foaf:Person . \n"+ 10.231 - " FILTER NOT EXISTS { ?person foaf:name ?name } . \n"+ 10.232 - "} \n"; 10.233 - 10.234 - @SuppressWarnings("unchecked") 10.235 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.236 - assertEquals(0, results.size()); // TODO add such an item 10.237 - } 10.238 - 10.239 - @Test 10.240 - public void testFilterExists() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.241 - { 10.242 - String queryString = prefixes+ 10.243 - "SELECT ?person \n"+ 10.244 - "WHERE { \n"+ 10.245 - " ?person rdf:type foaf:Person . \n"+ 10.246 - " FILTER EXISTS { ?person foaf:name ?name } \n"+ 10.247 - "} \n"; 10.248 - 10.249 - @SuppressWarnings("unchecked") 10.250 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.251 - assertEquals(2, results.size()); 10.252 - assertTrue(-1<results.indexOf("[person=http://example.org#bob]")); 10.253 - assertTrue(-1<results.indexOf("[person=http://example.org#alice]")); 10.254 - } 10.255 - 10.256 - @Test 10.257 - public void testMinus() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.258 - { 10.259 - String queryString = prefixes+ 10.260 - "SELECT DISTINCT ?s \n"+ 10.261 - "WHERE { \n"+ 10.262 - " ?s ?p ?o . \n"+ 10.263 - "MINUS { \n"+ 10.264 - " ?s foaf:givenName \"Bob\" . \n"+ 10.265 - "} } \n"; 10.266 - 10.267 - @SuppressWarnings("unchecked") 10.268 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.269 - assertEquals(19, results.size()); 10.270 - } 10.271 - 10.272 - @Test 10.273 - public void testQuerySumGroupByHaving() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.274 - { 10.275 - String queryString = prefixes+ 10.276 - "SELECT (SUM(?lprice) AS ?totalPrice) \n"+ 10.277 - "WHERE { \n"+ 10.278 - " ?org def:affiliates ?auth . \n"+ 10.279 - " ?auth def:writesBook ?book . \n"+ 10.280 - " ?book def:price ?lprice . \n"+ 10.281 - "} \n" 10.282 - +"GROUP BY ?org HAVING (SUM(?lprice) > 10) \n" 10.283 - ; 10.284 - 10.285 - @SuppressWarnings("unchecked") 10.286 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.287 - assertEquals(1, results.size()); 10.288 - assertTrue(-1<results.indexOf("[totalPrice=\"21\"^^<http://www.w3.org/2001/XMLSchema#integer>]")); 10.289 - } 10.290 - 10.291 - @Test 10.292 - public void testRegex() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.293 - { 10.294 - String queryString = prefixes+ 10.295 - "SELECT ?title \n"+ 10.296 - "WHERE { ?x dc:title ?title \n"+ 10.297 - " FILTER regex(?title, \"^SPARQL\") \n"+ 10.298 - "} ORDER BY ?title\n"; 10.299 - 10.300 - @SuppressWarnings("unchecked") 10.301 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.302 - assertEquals(3, results.size()); 10.303 - assertTrue(-1<results.indexOf("[title=\"SPARQL Protocol Tutorial\"]")); 10.304 - assertTrue(-1<results.indexOf("[title=\"SPARQL Tutorial\"]")); 10.305 - assertTrue(-1<results.indexOf("[title=\"SPARQL (updated)\"]")); 10.306 - } 10.307 - 10.308 - @Test 10.309 - public void testRegexI() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.310 - { 10.311 - String queryString = prefixes+ 10.312 - "SELECT ?title \n"+ 10.313 - "WHERE { ?x dc:title ?title . \n"+ 10.314 - " FILTER regex(?title, \"web\", \"i\" ) ."+ 10.315 - "} \n"; 10.316 - 10.317 - @SuppressWarnings("unchecked") 10.318 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.319 - assertEquals(1, results.size()); 10.320 - assertTrue(-1<results.indexOf("[title=\"The Semantic Web\"]")); 10.321 - } 10.322 - 10.323 - @Test 10.324 - public void testUnionWithCommonObject() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.325 - { 10.326 - String queryString = prefixes+ 10.327 - "SELECT ?title \n"+ 10.328 - "WHERE { { ?book dc10:title ?title } UNION { ?book dc11:title ?title } } \n"; 10.329 - 10.330 - @SuppressWarnings("unchecked") 10.331 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.332 - assertEquals(6, results.size()); 10.333 - assertTrue(-1<results.indexOf("[title=\"SPARQL Query Language Tutorial\"]")); 10.334 - assertTrue(-1<results.indexOf("[title=\"SPARQL\"]")); 10.335 - assertTrue(-1<results.indexOf("[title=\"SPARQL Tutorial\"]")); 10.336 - assertTrue(-1<results.indexOf("[title=\"The Semantic Web\"]")); 10.337 - assertTrue(-1<results.indexOf("[title=\"SPARQL Protocol Tutorial\"]")); 10.338 - assertTrue(-1<results.indexOf("[title=\"SPARQL (updated)\"]")); 10.339 - } 10.340 - 10.341 - @Test 10.342 - public void testUnionWithDifferentObject() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 10.343 - { 10.344 - String queryString = prefixes+ 10.345 - "SELECT ?x ?y \n"+ 10.346 - "WHERE { { ?book dc10:title ?x } UNION { ?book dc11:title ?y } } \n"; 10.347 - 10.348 - @SuppressWarnings("unchecked") 10.349 - ArrayList<String> results = (ArrayList<String>) strabon.query(queryString, strabon.getSailRepoConnection()); 10.350 - assertEquals(6, results.size()); 10.351 - assertTrue(-1<results.indexOf("[x=\"SPARQL Query Language Tutorial\"]")); 10.352 - assertTrue(-1<results.indexOf("[x=\"SPARQL\"]")); 10.353 - assertTrue(-1<results.indexOf("[y=\"SPARQL Tutorial\"]")); 10.354 - assertTrue(-1<results.indexOf("[y=\"The Semantic Web\"]")); 10.355 - assertTrue(-1<results.indexOf("[y=\"SPARQL Protocol Tutorial\"]")); 10.356 - assertTrue(-1<results.indexOf("[y=\"SPARQL (updated)\"]")); 10.357 - } 10.358 - 10.359 -} 10.360 \ No newline at end of file
11.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SimpleTests.java Thu May 14 11:24:32 2015 +0300 11.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 11.3 @@ -1,129 +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.generaldb; 11.14 - 11.15 -import static org.junit.Assert.assertEquals; 11.16 -import static org.junit.Assert.assertTrue; 11.17 - 11.18 -import java.io.IOException; 11.19 -import java.util.ArrayList; 11.20 - 11.21 -import org.junit.Test; 11.22 -import org.openrdf.model.vocabulary.RDF; 11.23 -import org.openrdf.model.vocabulary.XMLSchema; 11.24 -import org.openrdf.query.MalformedQueryException; 11.25 -import org.openrdf.query.QueryEvaluationException; 11.26 -import org.openrdf.query.TupleQueryResultHandlerException; 11.27 - 11.28 -/** 11.29 - * A set of simple tests on SPARQL query functionality 11.30 - * 11.31 - * @author George Garbis <ggarbis@di.uoa.gr> 11.32 - */ 11.33 -public class SimpleTests { 11.34 - 11.35 - protected static Strabon strabon; 11.36 - 11.37 - protected static java.sql.Connection conn = null; 11.38 - protected static String databaseName = null; 11.39 - 11.40 - protected static String jdbcDriver = null; 11.41 - protected static String serverName = null; 11.42 - protected static String username = null; 11.43 - protected static String password = null; 11.44 - protected static Integer port = null; 11.45 - 11.46 - protected static final String 11.47 - STRDF_NS = "http://strdf.di.uoa.gr/ontology#", 11.48 - EX_NS = "http://example.org/", 11.49 - NOA_NS = "http://teleios.di.uoa.gr/ontologies/noaOntology.owl#"; 11.50 - 11.51 - 11.52 - protected static final String prefixes = 11.53 - "PREFIX rdf: <"+RDF.NAMESPACE+"> \n" + 11.54 - "PREFIX strdf: <"+STRDF_NS+"> \n" + 11.55 - "PREFIX xsd: <"+XMLSchema.NAMESPACE+"> \n" + 11.56 - "PREFIX ex: <"+EX_NS+"> \n" + 11.57 - "PREFIX noa: <"+NOA_NS+"> \n"; 11.58 - 11.59 - @Test 11.60 - public void testSimpleFilter() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, QueryEvaluationException 11.61 - { 11.62 - 11.63 - String query = 11.64 - prefixes+ 11.65 - "SELECT ?id "+ 11.66 - "WHERE { "+ 11.67 - "?s ex:id ?id . "+ 11.68 - "?s ex:value ?value . "+ 11.69 - "FILTER( ?id<2 ) . " + 11.70 - "}"; 11.71 - 11.72 - @SuppressWarnings("unchecked") 11.73 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 11.74 - 11.75 - assertEquals(1, bindings.size()); 11.76 - assertTrue(-1<bindings.indexOf("[id=\"1\"^^<http://www.w3.org/2001/XMLSchema#int>]")); 11.77 - } 11.78 - 11.79 - @Test 11.80 - public void testMatchLiteralWithWKTType() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, QueryEvaluationException 11.81 - { 11.82 - String query = 11.83 - prefixes+ 11.84 - "SELECT ?s2 "+ 11.85 - "WHERE { "+ 11.86 - " ?s2 noa:hasGeometry \"POINT(1 0)\"^^strdf:WKT . "+ 11.87 - "}"; 11.88 - 11.89 - @SuppressWarnings("unchecked") 11.90 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 11.91 - 11.92 - assertEquals(1, bindings.size()); 11.93 - assertTrue(-1<bindings.indexOf("[s2=http://example.org/item1]")); 11.94 - } 11.95 - 11.96 - @Test 11.97 - public void testComplexFilter() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, QueryEvaluationException 11.98 - { 11.99 - 11.100 - String query = 11.101 - prefixes+ 11.102 - "SELECT ?s ?id "+ 11.103 - "WHERE { "+ 11.104 - "?s ex:id ?id . "+ 11.105 - "FILTER( ?id>20 || ?id<2 ) . " + 11.106 - "}"; 11.107 - 11.108 - @SuppressWarnings("unchecked") 11.109 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 11.110 - 11.111 - assertEquals(1, bindings.size()); 11.112 - assertTrue(-1<bindings.indexOf("[id=\"1\"^^<http://www.w3.org/2001/XMLSchema#int>;s=http://example.org/item1]")); 11.113 - } 11.114 - 11.115 - @Test 11.116 - public void testNotExistingPredicate() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, QueryEvaluationException 11.117 - { 11.118 - 11.119 - String query = 11.120 - prefixes+ 11.121 - "SELECT ?s ?o "+ 11.122 - "WHERE { "+ 11.123 - "?s ex:notExisting ?o . "+ 11.124 - "}"; 11.125 - 11.126 - @SuppressWarnings("unchecked") 11.127 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 11.128 - 11.129 - assertEquals(0, bindings.size()); 11.130 - } 11.131 - 11.132 -}
12.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SpatialTests.java Thu May 14 11:24:32 2015 +0300 12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 12.3 @@ -1,1242 +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.generaldb; 12.14 - 12.15 -import static org.junit.Assert.assertEquals; 12.16 -import static org.junit.Assert.assertTrue; 12.17 -import static org.junit.Assert.fail; 12.18 - 12.19 -import java.io.IOException; 12.20 -import java.util.ArrayList; 12.21 - 12.22 -import org.junit.Test; 12.23 -import org.openrdf.model.vocabulary.RDF; 12.24 -import org.openrdf.model.vocabulary.XMLSchema; 12.25 -import org.openrdf.query.MalformedQueryException; 12.26 -import org.openrdf.query.QueryEvaluationException; 12.27 -import org.openrdf.query.TupleQueryResultHandlerException; 12.28 - 12.29 -public class SpatialTests { 12.30 - public static Strabon strabon; 12.31 - 12.32 - public String STRDF_NS = "http://strdf.di.uoa.gr/ontology#", 12.33 - EX_NS = "http://example.org/", 12.34 - NOA_NS = "http://teleios.di.uoa.gr/ontologies/noaOntology.owl#", 12.35 - GEOF_NS ="http://www.opengis.net/def/function/geosparql/"; 12.36 - 12.37 - protected String prefixes = 12.38 - "PREFIX rdf: <"+RDF.NAMESPACE+"> \n" + 12.39 - "PREFIX strdf: <"+STRDF_NS+"> \n" + 12.40 - "PREFIX xsd: <"+XMLSchema.NAMESPACE+"> \n" + 12.41 - "PREFIX ex: <"+EX_NS+"> \n" + 12.42 - "PREFIX noa: <"+NOA_NS+"> \n" + 12.43 - "PREFIX geof: <"+GEOF_NS+"> \n"; 12.44 - 12.45 - // -- Spatial Relationships -- // 12.46 - 12.47 - @Test 12.48 - public void testStrdfEquals() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.49 - { 12.50 - String query = 12.51 - prefixes+ 12.52 - "SELECT DISTINCT ?s1 ?s2 \n"+ 12.53 - "WHERE { \n" + 12.54 - " ?s1 ex:geometry ?g1 . \n"+ 12.55 - " ?s2 ex:geometry ?g2 . \n" + 12.56 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 12.57 - " FILTER( strdf:equals(?g1, ?g2 )) . \n"+ 12.58 - "}"; 12.59 - 12.60 - @SuppressWarnings("unchecked") 12.61 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.62 - assertEquals(1, bindings.size()); 12.63 - assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 12.64 - } 12.65 - 12.66 - @Test 12.67 - public void testStrdfDisjoint() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.68 - { 12.69 - String query = 12.70 - prefixes+ 12.71 - "SELECT DISTINCT ?s1 ?s2 \n"+ 12.72 - "WHERE { \n" + 12.73 - " ?s1 ex:geometry ?g1 . \n"+ 12.74 - " ?s2 ex:geometry ?g2 . \n" + 12.75 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 12.76 - " FILTER( strdf:disjoint(?g1, ?g2 )) . \n"+ 12.77 - "}"; 12.78 - 12.79 - @SuppressWarnings("unchecked") 12.80 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.81 - assertEquals(60, bindings.size()); 12.82 - // too many results 12.83 - //assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 12.84 - } 12.85 - 12.86 - @Test 12.87 - public void testStrdfIntesects() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.88 - { 12.89 - String query = 12.90 - prefixes+ 12.91 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.92 - "WHERE { \n" + 12.93 - " ?s1 ex:id ?id1 . \n"+ 12.94 - " ?s2 ex:id ?id2 . \n"+ 12.95 - " FILTER( str(?id1) < str(?id2) ) . \n"+ 12.96 - " ?s2 ex:geometry ?g2 . \n" + 12.97 - " ?s1 ex:geometry ?g1 . \n"+ 12.98 - " FILTER( strdf:intersects(?g1, ?g2 )) . \n"+ 12.99 - "}"; 12.100 - 12.101 - @SuppressWarnings("unchecked") 12.102 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.103 - assertEquals(5, bindings.size()); 12.104 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.105 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.106 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.107 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.108 - assertTrue(-1<bindings.indexOf("[id2=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.109 - } 12.110 - 12.111 - @Test 12.112 - public void testStrdfTouches() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.113 - { 12.114 - String query = 12.115 - prefixes+ 12.116 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.117 - "WHERE { \n" + 12.118 - " ?s1 ex:id ?id1 . \n"+ 12.119 - " ?s2 ex:id ?id2 . \n"+ 12.120 - " FILTER( str(?id1) < str(?id2) ) . \n"+ 12.121 - " ?s2 ex:geometry ?g2 . \n" + 12.122 - " ?s1 ex:geometry ?g1 . \n"+ 12.123 - " FILTER( strdf:touches(?g1, ?g2 )) . \n"+ 12.124 - "}"; 12.125 - 12.126 - @SuppressWarnings("unchecked") 12.127 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.128 - assertEquals(1, bindings.size()); 12.129 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.130 - } 12.131 - 12.132 - @Test 12.133 - public void testStrdfCrosses() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.134 - { 12.135 - String query = 12.136 - prefixes+ 12.137 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.138 - "WHERE { \n" + 12.139 - " ?s1 ex:id ?id1 . \n"+ 12.140 - " ?s2 ex:id ?id2 . \n"+ 12.141 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.142 - " ?s2 ex:geometry ?g2 . \n" + 12.143 - " ?s1 ex:geometry ?g1 . \n"+ 12.144 - " FILTER( strdf:crosses(?g1, ?g2 )) . \n"+ 12.145 - "}"; 12.146 - 12.147 - @SuppressWarnings("unchecked") 12.148 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.149 - assertEquals(2, bindings.size()); 12.150 - assertTrue(-1<bindings.indexOf("[id2=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.151 - assertTrue(-1<bindings.indexOf("[id2=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.152 - } 12.153 - 12.154 - @Test 12.155 - public void testStrdfWithin() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.156 - { 12.157 - String query = 12.158 - prefixes+ 12.159 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.160 - "WHERE { \n" + 12.161 - " ?s1 ex:id ?id1 . \n"+ 12.162 - " ?s2 ex:id ?id2 . \n"+ 12.163 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.164 - " ?s2 ex:geometry ?g2 . \n" + 12.165 - " ?s1 ex:geometry ?g1 . \n"+ 12.166 - " FILTER( strdf:within(?g1, ?g2)) . \n"+ 12.167 - "}"; 12.168 - 12.169 - @SuppressWarnings("unchecked") 12.170 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.171 - assertEquals(2, bindings.size()); 12.172 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.173 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.174 - } 12.175 - 12.176 - @Test 12.177 - public void testStrdfContains() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.178 - { 12.179 - String query = 12.180 - prefixes+ 12.181 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.182 - "WHERE { \n" + 12.183 - " ?s1 ex:id ?id1 . \n"+ 12.184 - " ?s2 ex:id ?id2 . \n"+ 12.185 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.186 - " ?s2 ex:geometry ?g2 . \n" + 12.187 - " ?s1 ex:geometry ?g1 . \n"+ 12.188 - " FILTER( strdf:contains(?g1, ?g2 )) . \n"+ 12.189 - "}"; 12.190 - 12.191 - @SuppressWarnings("unchecked") 12.192 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.193 - assertEquals(2, bindings.size()); 12.194 - assertTrue(-1<bindings.indexOf("[id2=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.195 - assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.196 - } 12.197 - 12.198 - @Test 12.199 - public void testStrdfOverlaps() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.200 - { 12.201 - String query = 12.202 - prefixes+ 12.203 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.204 - "WHERE { \n" + 12.205 - " ?s1 ex:id ?id1 . \n"+ 12.206 - " ?s2 ex:id ?id2 . \n"+ 12.207 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.208 - " ?s2 ex:geometry ?g2 . \n" + 12.209 - " ?s1 ex:geometry ?g1 . \n"+ 12.210 - " FILTER( strdf:overlaps(?g1, ?g2 )) . \n"+ 12.211 - "}"; 12.212 - 12.213 - @SuppressWarnings("unchecked") 12.214 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.215 - assertEquals(2, bindings.size()); 12.216 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.217 - assertTrue(-1<bindings.indexOf("[id2=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.218 - } 12.219 - 12.220 - @Test 12.221 - public void testStrdfmbbIntersects() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.222 - { 12.223 - String query = 12.224 - prefixes+ 12.225 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.226 - "WHERE { \n" + 12.227 - " ?s1 ex:id ?id1 . \n"+ 12.228 - " ?s2 ex:id ?id2 . \n"+ 12.229 - " FILTER( str(?id1) < str(?id2) ) . \n"+ 12.230 - " ?s2 ex:geometry ?g2 . \n" + 12.231 - " ?s1 ex:geometry ?g1 . \n"+ 12.232 - " FILTER( strdf:mbbIntersects(?g1, ?g2 ) ) . \n"+ 12.233 - "}"; 12.234 - 12.235 - @SuppressWarnings("unchecked") 12.236 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.237 - 12.238 - assertEquals(5, bindings.size()); 12.239 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.240 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.241 - assertTrue(-1<bindings.indexOf("[id2=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.242 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.243 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.244 - } 12.245 - 12.246 -// @Test 12.247 -// public void testStrdfCovers() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.248 -// { 12.249 -// String query = 12.250 -// prefixes+ 12.251 -// "SELECT DISTINCT ?id1 ?id2 \n"+ 12.252 -// "WHERE { \n" + 12.253 -// " ?s1 ex:id ?id1 . \n"+ 12.254 -// " ?s2 ex:id ?id2 . \n"+ 12.255 -// " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.256 -// " ?s2 ex:geometry ?g2 . \n" + 12.257 -// " ?s1 ex:geometry ?g1 . \n"+ 12.258 -// " FILTER( strdf:covers(?g1, ?g2 )) . \n"+ 12.259 -// "}"; 12.260 -// 12.261 -// @SuppressWarnings("unchecked") 12.262 -// ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.263 -// assertEquals(2, bindings.size()); 12.264 -// assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.265 -// assertTrue(-1<bindings.indexOf("[id2=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.266 -// } 12.267 -// 12.268 -// @Test 12.269 -// public void testStrdfCoveredBy() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.270 -// { 12.271 -// String query = 12.272 -// prefixes+ 12.273 -// "SELECT DISTINCT ?id1 ?id2 \n"+ 12.274 -// "WHERE { \n" + 12.275 -// " ?s1 ex:id ?id1 . \n"+ 12.276 -// " ?s2 ex:id ?id2 . \n"+ 12.277 -// " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.278 -// " ?s2 ex:geometry ?g2 . \n" + 12.279 -// " ?s1 ex:geometry ?g1 . \n"+ 12.280 -// " FILTER( strdf:coveredBy(?g1, ?g2 )) . \n"+ 12.281 -// "}"; 12.282 -// 12.283 -// @SuppressWarnings("unchecked") 12.284 -// ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.285 -// assertEquals(2, bindings.size()); 12.286 -// assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.287 -// assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.288 -// } 12.289 - 12.290 - @Test 12.291 - public void testStrdfRelate() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.292 - { 12.293 - String query = 12.294 - prefixes+ 12.295 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.296 - "WHERE { \n" + 12.297 - " ?s1 ex:id ?id1 . \n"+ 12.298 - " ?s2 ex:id ?id2 . \n"+ 12.299 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.300 - " ?s2 ex:geometry ?g2 . \n" + 12.301 - " ?s1 ex:geometry ?g1 . \n"+ 12.302 - " FILTER( strdf:relate(?g1, ?g2, \"T*F**F***\" )) . \n"+ 12.303 - "}"; 12.304 - 12.305 - @SuppressWarnings("unchecked") 12.306 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.307 - assertEquals(2, bindings.size()); 12.308 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.309 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.310 - } 12.311 - 12.312 -// TODO these tests run only in postgis 12.313 -// @Test 12.314 -// public void testStrdfLeft() throws MalformedQueryException, QueryEvaluationException 12.315 -// @Test 12.316 -// public void testStrdfRight() throws MalformedQueryException, QueryEvaluationException 12.317 -// @Test 12.318 -// public void testStrdfAbove() throws MalformedQueryException, QueryEvaluationException 12.319 -// @Test 12.320 -// public void testStrdfBelow() throws MalformedQueryException, QueryEvaluationException 12.321 - 12.322 - // -- Spatial Constructs -- // 12.323 - @Test 12.324 - public void testStrdfUnion() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.325 - { 12.326 - String query = 12.327 - prefixes+ 12.328 - "SELECT DISTINCT ( strdf:union(?g, \"POLYGON((5 3, 10 3, 10 8, 5 8, 5 3))\"^^strdf:WKT) AS ?ret ) \n"+ 12.329 - "WHERE { \n" + 12.330 - " ?s ex:id ?id . \n"+ 12.331 - " ?s ex:geometry ?g . \n" + 12.332 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 12.333 - "}"; 12.334 - 12.335 - @SuppressWarnings("unchecked") 12.336 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.337 - 12.338 - assertEquals(1, bindings.size()); 12.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>]")); 12.340 - } 12.341 - 12.342 - @Test 12.343 - public void testStrdfEnvelopeBuffer() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.344 - { 12.345 - String query = 12.346 - prefixes+ 12.347 - "SELECT DISTINCT ( strdf:envelope(strdf:buffer(?g, \"0.5\"^^xsd:float)) AS ?ret ) \n"+ 12.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"+ 12.349 - "WHERE { \n" + 12.350 - " ?s ex:id ?id . \n"+ 12.351 - " ?s ex:geometry ?g . \n" + 12.352 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.353 - "}"; 12.354 - 12.355 - @SuppressWarnings("unchecked") 12.356 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.357 - 12.358 - assertEquals(1, bindings.size()); 12.359 - 12.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>]") || 12.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>]") 12.362 - ) 12.363 - assertTrue(true); 12.364 - else 12.365 - fail(); 12.366 - } 12.367 - 12.368 - @Test 12.369 - public void testStrdfConvexHull() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.370 - { 12.371 - String query = 12.372 - prefixes+ 12.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"+ 12.374 - "WHERE { \n" + 12.375 - " ?s ex:id ?id . \n"+ 12.376 - " ?s ex:geometry ?g . \n" + 12.377 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.378 - "}"; 12.379 - 12.380 - @SuppressWarnings("unchecked") 12.381 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.382 - 12.383 - assertEquals(1, bindings.size()); 12.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>]")); 12.385 - } 12.386 - 12.387 - @Test 12.388 - public void testStrdfBoundary() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.389 - { 12.390 - String query = 12.391 - prefixes+ 12.392 - "SELECT DISTINCT ( strdf:boundary(?g) AS ?ret ) \n"+ 12.393 - "WHERE { \n" + 12.394 - " ?s ex:id ?id . \n"+ 12.395 - " ?s ex:geometry ?g . \n" + 12.396 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.397 - "}"; 12.398 - 12.399 - @SuppressWarnings("unchecked") 12.400 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.401 - 12.402 - assertEquals(1, bindings.size()); 12.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>]")); } 12.404 - 12.405 - @Test 12.406 - public void testStrdfIntersection() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.407 - { 12.408 - String query = 12.409 - prefixes+ 12.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"+ 12.411 - "WHERE { \n" + 12.412 - " ?s ex:id ?id . \n"+ 12.413 - " ?s ex:geometry ?g . \n" + 12.414 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 12.415 - "}"; 12.416 - 12.417 - @SuppressWarnings("unchecked") 12.418 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.419 - 12.420 - assertEquals(1, bindings.size()); 12.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>]")); 12.422 - } 12.423 - 12.424 - @Test 12.425 - public void testStrdfDifference() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.426 - { 12.427 - String query = 12.428 - prefixes+ 12.429 - "SELECT DISTINCT ( strdf:difference(?g, \"POLYGON((5 3, 10 3, 10 8, 5 8, 5 3))\"^^strdf:WKT) AS ?ret ) \n"+ 12.430 - "WHERE { \n" + 12.431 - " ?s ex:id ?id . \n"+ 12.432 - " ?s ex:geometry ?g . \n" + 12.433 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 12.434 - "}"; 12.435 - 12.436 - @SuppressWarnings("unchecked") 12.437 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.438 - 12.439 - assertEquals(1, bindings.size()); 12.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>]")); 12.441 - } 12.442 - 12.443 - @Test 12.444 - public void testStrdfSymDifference() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.445 - { 12.446 - String query = 12.447 - prefixes+ 12.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"+ 12.449 - "WHERE { \n" + 12.450 - " ?s ex:id ?id . \n"+ 12.451 - " ?s ex:geometry ?g . \n" + 12.452 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 12.453 - "}"; 12.454 - 12.455 - @SuppressWarnings("unchecked") 12.456 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.457 - 12.458 - assertEquals(1, bindings.size()); 12.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>]")); 12.460 - } 12.461 - 12.462 -// // -- Spatial Metric Functions -- // 12.463 - 12.464 - @Test 12.465 - public void testStrdfDistance() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.466 - { 12.467 - String query = 12.468 - prefixes+ 12.469 - "SELECT DISTINCT ( strdf:distance(?g, \"POINT( 10 1 )\"^^strdf:WKT) AS ?ret ) \n"+ 12.470 - "WHERE { \n" + 12.471 - " ?s ex:id ?id . \n"+ 12.472 - " ?s ex:geometry ?g . \n" + 12.473 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.474 - "}"; 12.475 - 12.476 - @SuppressWarnings("unchecked") 12.477 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.478 - 12.479 - assertEquals(1, bindings.size()); 12.480 - assertTrue(-1<bindings.indexOf("[ret=\"1.0\"^^<http://www.w3.org/2001/XMLSchema#double>]")); 12.481 - } 12.482 - 12.483 - @Test 12.484 - public void testStrdfArea() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.485 - { 12.486 - String query = 12.487 - prefixes+ 12.488 - "SELECT DISTINCT ( strdf:area(?g) AS ?ret ) \n"+ 12.489 - "WHERE { \n" + 12.490 - " ?s ex:id ?id . \n"+ 12.491 - " ?s ex:geometry ?g . \n" + 12.492 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.493 - "}"; 12.494 - 12.495 - @SuppressWarnings("unchecked") 12.496 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.497 - 12.498 - assertEquals(1, bindings.size()); 12.499 - assertTrue(-1<bindings.indexOf("[ret=\"1.0\"^^<http://www.w3.org/2001/XMLSchema#double>]")); 12.500 - } 12.501 - 12.502 - @Test 12.503 - public void testStrdfDimension() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.504 - { 12.505 - String query = 12.506 - prefixes+ 12.507 - "SELECT DISTINCT (strdf:dimension(?g) AS ?ret2) " + 12.508 - "(strdf:dimension(strdf:boundary(?g)) AS ?ret1) " + 12.509 - "(strdf:dimension(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 12.510 - "WHERE { \n" + 12.511 - " ?s ex:id ?id . \n"+ 12.512 - " ?s ex:geometry ?g . \n" + 12.513 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.514 - "}"; 12.515 - 12.516 - @SuppressWarnings("unchecked") 12.517 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.518 - 12.519 - assertEquals(1, bindings.size()); 12.520 - // TODO monetdb returns as dimension only 3 (because of GEOS lib) 12.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>]") || 12.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>]") ) 12.523 - assertTrue(true); 12.524 - else 12.525 - fail(); 12.526 - 12.527 - } 12.528 - 12.529 - @Test 12.530 - public void testStrdfGeometryType() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.531 - { 12.532 - String query = 12.533 - prefixes+ 12.534 - "SELECT DISTINCT (strdf:geometryType(?g) AS ?ret2) " + 12.535 - "(strdf:geometryType(strdf:boundary(?g)) AS ?ret1) " + 12.536 - "(strdf:geometryType(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 12.537 - "WHERE { \n" + 12.538 - " ?s ex:id ?id . \n"+ 12.539 - " ?s ex:geometry ?g . \n" + 12.540 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.541 - "}"; 12.542 - 12.543 - @SuppressWarnings("unchecked") 12.544 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.545 - 12.546 - assertEquals(1, bindings.size()); 12.547 - // TODO different results between dbms in strdf:geometryType 12.548 - if ( -1<bindings.indexOf("[ret2=\"3\";ret1=\"1\";ret0=\"0\"]") || 12.549 - -1<bindings.indexOf("[ret2=\"ST_Polygon\";ret1=\"ST_LineString\";ret0=\"ST_Point\"]") 12.550 - ) 12.551 - assertTrue(true); 12.552 - else 12.553 - fail(); 12.554 - } 12.555 - 12.556 - @Test 12.557 - public void testStrdfAsText() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.558 - { 12.559 - String query = 12.560 - prefixes+ 12.561 - "SELECT DISTINCT (strdf:asText(?g) AS ?ret2) " + 12.562 - "(strdf:asText(strdf:boundary(?g)) AS ?ret1) " + 12.563 - "(strdf:asText(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 12.564 - "WHERE { \n" + 12.565 - " ?s ex:id ?id . \n"+ 12.566 - " ?s ex:geometry ?g . \n" + 12.567 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.568 - "}"; 12.569 - 12.570 - @SuppressWarnings("unchecked") 12.571 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.572 - 12.573 - assertEquals(1, bindings.size()); 12.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)\"]") || 12.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)\"]") 12.576 - ) 12.577 - assertTrue(true); 12.578 - else 12.579 - fail(); 12.580 - 12.581 - } 12.582 - 12.583 - @Test 12.584 - public void testStrdfSrid() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.585 - { 12.586 - String query = 12.587 - prefixes+ 12.588 - "SELECT DISTINCT (strdf:srid(?g) AS ?ret2) " + 12.589 - "(strdf:srid(strdf:boundary(?g)) AS ?ret1) " + 12.590 - "(strdf:srid(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 12.591 - "WHERE { \n" + 12.592 - " ?s ex:id ?id . \n"+ 12.593 - " ?s ex:geometry ?g . \n" + 12.594 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.595 - "}"; 12.596 - 12.597 - @SuppressWarnings("unchecked") 12.598 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.599 - // TODO test srid uri arguments 12.600 - assertEquals(1, bindings.size()); 12.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>]") || 12.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>]") 12.603 - ) 12.604 - assertTrue(true); 12.605 - else 12.606 - fail(); 12.607 - } 12.608 - 12.609 - @Test 12.610 - public void testStrdfIsEmpty() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.611 - { 12.612 - String query = 12.613 - prefixes+ 12.614 - "SELECT DISTINCT (strdf:isEmpty(?g) AS ?ret2) " + 12.615 - "(strdf:isEmpty(strdf:boundary(?g)) AS ?ret1) " + 12.616 - "(strdf:isEmpty(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 12.617 - "WHERE { \n" + 12.618 - " ?s ex:id ?id . \n"+ 12.619 - " ?s ex:geometry ?g . \n" + 12.620 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.621 - "}"; 12.622 - 12.623 - @SuppressWarnings("unchecked") 12.624 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.625 - 12.626 - assertEquals(1, bindings.size()); 12.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>]")); 12.628 - } 12.629 - 12.630 - @Test 12.631 - public void testStrdfIsSimple() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.632 - { 12.633 - String query = 12.634 - prefixes+ 12.635 - "SELECT DISTINCT (strdf:isSimple(?g) AS ?ret2) " + 12.636 - "(strdf:isSimple(strdf:boundary(?g)) AS ?ret1) " + 12.637 - "(strdf:isSimple(\"POINT(0 0)\"^^strdf:WKT) AS ?ret0) \n"+ 12.638 - "WHERE { \n" + 12.639 - " ?s ex:id ?id . \n"+ 12.640 - " ?s ex:geometry ?g . \n" + 12.641 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.642 - "}"; 12.643 - 12.644 - @SuppressWarnings("unchecked") 12.645 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.646 - 12.647 - assertEquals(1, bindings.size()); 12.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>]")); 12.649 - } 12.650 - 12.651 - // -- GEOSPARQL -- // 12.652 - 12.653 - // -- Non-topological -- // 12.654 - 12.655 - @Test 12.656 - public void testGeofConvexHull() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.657 - { 12.658 - String query = 12.659 - prefixes+ 12.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"+ 12.661 - "WHERE { \n" + 12.662 - " ?s ex:id ?id . \n"+ 12.663 - " ?s ex:geometry ?g . \n" + 12.664 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.665 - "}"; 12.666 - 12.667 - @SuppressWarnings("unchecked") 12.668 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.669 - 12.670 - assertEquals(1, bindings.size()); 12.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>]")); 12.672 - } 12.673 - 12.674 - @Test 12.675 - public void testGeofIntersection() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.676 - { 12.677 - String query = 12.678 - prefixes+ 12.679 - "SELECT DISTINCT ( geof:intersection(?g, \"POLYGON((5 3, 10 3, 10 8, 5 8, 5 3))\"^^strdf:WKT) AS ?ret ) \n"+ 12.680 - "WHERE { \n" + 12.681 - " ?s ex:id ?id . \n"+ 12.682 - " ?s ex:geometry ?g . \n" + 12.683 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 12.684 - "}"; 12.685 - 12.686 - @SuppressWarnings("unchecked") 12.687 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.688 - 12.689 - assertEquals(1, bindings.size()); 12.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>]")); 12.691 - } 12.692 - 12.693 - @Test 12.694 - public void testGeofDifference() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.695 - { 12.696 - String query = 12.697 - prefixes+ 12.698 - "SELECT DISTINCT ( geof:difference(?g, \"POLYGON((5 3, 10 3, 10 8, 5 8, 5 3))\"^^strdf:WKT) AS ?ret ) \n"+ 12.699 - "WHERE { \n" + 12.700 - " ?s ex:id ?id . \n"+ 12.701 - " ?s ex:geometry ?g . \n" + 12.702 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 12.703 - "}"; 12.704 - 12.705 - @SuppressWarnings("unchecked") 12.706 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.707 - 12.708 - assertEquals(1, bindings.size()); 12.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>]")); 12.710 - } 12.711 - 12.712 - @Test 12.713 - public void testGeofSymDifference() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.714 - { 12.715 - String query = 12.716 - prefixes+ 12.717 - "SELECT DISTINCT ( geof:symmetricDifference(?g, \"POLYGON((5 3, 12 3, 12 8, 5 8, 5 3))\"^^strdf:WKT) AS ?ret ) \n"+ 12.718 - "WHERE { \n" + 12.719 - " ?s ex:id ?id . \n"+ 12.720 - " ?s ex:geometry ?g . \n" + 12.721 - " FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" + 12.722 - "}"; 12.723 - 12.724 - @SuppressWarnings("unchecked") 12.725 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.726 - 12.727 - assertEquals(1, bindings.size()); 12.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>]")); 12.729 - } 12.730 - 12.731 - @Test 12.732 - public void testGeofEnvelope() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.733 - { 12.734 - String query = 12.735 - prefixes+ 12.736 - "SELECT DISTINCT ( strdf:envelope(strdf:buffer(?g, \"0.5\"^^xsd:float)) AS ?ret ) \n"+ 12.737 - "WHERE { \n" + 12.738 - " ?s ex:id ?id . \n"+ 12.739 - " ?s ex:geometry ?g . \n" + 12.740 - " FILTER( str(?id) = \"C\"^^xsd:string ) . \n" + 12.741 - "}"; 12.742 - 12.743 - @SuppressWarnings("unchecked") 12.744 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.745 - 12.746 - assertEquals(1, bindings.size()); 12.747 - 12.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>]") || 12.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>]") 12.750 - ) 12.751 - assertTrue(true); 12.752 - else 12.753 - fail(); 12.754 - } 12.755 - 12.756 -// @Test 12.757 -// public void testGeofEnvelopeBuffer() throws MalformedQueryException, QueryEvaluationException 12.758 -// { // TODO 3 arguments 12.759 -// String query = 12.760 -// prefixes+ 12.761 -// "SELECT DISTINCT ( geof:envelope(geof:buffer(?g, \"1.0\"^^xsd:float)) AS ?ret ) \n"+ 12.762 -// "WHERE { \n" + 12.763 -// " ?s noa:hasGeometry ?g . \n"+ 12.764 -// " ?s ex:id ?id . \n"+ 12.765 -// "}"; 12.766 -// 12.767 -// ArrayList<String> bindings = strabon.query(query,strabon.getSailRepoConnection()); 12.768 -// 12.769 -// assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((0 -1, 0 1, 2 1, 2 -1, 0 -1))\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 12.770 -// assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((1 -1, 1 1, 3 1, 3 -1, 1 -1))\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 12.771 -// assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((2 -1, 2 1, 4 1, 4 -1, 2 -1))\"^^<http://strdf.di.uoa.gr/ontology#WKT>]")); 12.772 -// } 12.773 - 12.774 - //Simple Features - 8 functions - all with 2 arguments + boolean 12.775 - 12.776 - @Test 12.777 - public void testGeofSfEquals() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.778 - { 12.779 - String query = 12.780 - prefixes+ 12.781 - "SELECT DISTINCT ?s1 ?s2 \n"+ 12.782 - "WHERE { \n" + 12.783 - " ?s1 ex:geometry ?g1 . \n"+ 12.784 - " ?s2 ex:geometry ?g2 . \n" + 12.785 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 12.786 - " FILTER( geof:sfEquals(?g1, ?g2 )) . \n"+ 12.787 - "}"; 12.788 - 12.789 - @SuppressWarnings("unchecked") 12.790 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.791 - assertEquals(1, bindings.size()); 12.792 - assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 12.793 - } 12.794 - 12.795 - @Test 12.796 - public void testGeofSfDisjoint() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.797 - { 12.798 - String query = 12.799 - prefixes+ 12.800 - "SELECT DISTINCT ?s1 ?s2 \n"+ 12.801 - "WHERE { \n" + 12.802 - " ?s1 ex:geometry ?g1 . \n"+ 12.803 - " ?s2 ex:geometry ?g2 . \n" + 12.804 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 12.805 - " FILTER( geof:sfDisjoint(?g1, ?g2 )) . \n"+ 12.806 - "}"; 12.807 - 12.808 - @SuppressWarnings("unchecked") 12.809 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.810 - assertEquals(60, bindings.size()); 12.811 - // too many results :) 12.812 -// assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 12.813 - } 12.814 - 12.815 - @Test 12.816 - public void testGeofSfIntesects() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.817 - { 12.818 - String query = 12.819 - prefixes+ 12.820 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.821 - "WHERE { \n" + 12.822 - " ?s1 ex:id ?id1 . \n"+ 12.823 - " ?s2 ex:id ?id2 . \n"+ 12.824 - " FILTER( str(?id1) < str(?id2) ) . \n"+ 12.825 - " ?s2 ex:geometry ?g2 . \n" + 12.826 - " ?s1 ex:geometry ?g1 . \n"+ 12.827 - " FILTER( geof:sfIntersects(?g1, ?g2 )) . \n"+ 12.828 - "}"; 12.829 - 12.830 - @SuppressWarnings("unchecked") 12.831 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.832 - assertEquals(5, bindings.size()); 12.833 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.834 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.835 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.836 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.837 - assertTrue(-1<bindings.indexOf("[id2=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.838 - } 12.839 - 12.840 - @Test 12.841 - public void testGeofSfTouches() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.842 - { 12.843 - String query = 12.844 - prefixes+ 12.845 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.846 - "WHERE { \n" + 12.847 - " ?s1 ex:id ?id1 . \n"+ 12.848 - " ?s2 ex:id ?id2 . \n"+ 12.849 - " FILTER( str(?id1) < str(?id2) ) . \n"+ 12.850 - " ?s2 ex:geometry ?g2 . \n" + 12.851 - " ?s1 ex:geometry ?g1 . \n"+ 12.852 - " FILTER( geof:sfTouches(?g1, ?g2 )) . \n"+ 12.853 - "}"; 12.854 - 12.855 - @SuppressWarnings("unchecked") 12.856 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.857 - assertEquals(1, bindings.size()); 12.858 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.859 - } 12.860 - 12.861 - @Test 12.862 - public void testGeofSfCrosses() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.863 - { 12.864 - String query = 12.865 - prefixes+ 12.866 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.867 - "WHERE { \n" + 12.868 - " ?s1 ex:id ?id1 . \n"+ 12.869 - " ?s2 ex:id ?id2 . \n"+ 12.870 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.871 - " ?s2 ex:geometry ?g2 . \n" + 12.872 - " ?s1 ex:geometry ?g1 . \n"+ 12.873 - " FILTER( geof:sfCrosses(?g1, ?g2 )) . \n"+ 12.874 - "}"; 12.875 - 12.876 - @SuppressWarnings("unchecked") 12.877 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.878 - assertEquals(2, bindings.size()); 12.879 - assertTrue(-1<bindings.indexOf("[id2=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.880 - assertTrue(-1<bindings.indexOf("[id2=\"L2\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"L1\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.881 - } 12.882 - 12.883 - @Test 12.884 - public void testGeofSfWithin() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.885 - { 12.886 - String query = 12.887 - prefixes+ 12.888 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.889 - "WHERE { \n" + 12.890 - " ?s1 ex:id ?id1 . \n"+ 12.891 - " ?s2 ex:id ?id2 . \n"+ 12.892 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.893 - " ?s2 ex:geometry ?g2 . \n" + 12.894 - " ?s1 ex:geometry ?g1 . \n"+ 12.895 - " FILTER( geof:sfWithin(?g1, ?g2 )) . \n"+ 12.896 - "}"; 12.897 - 12.898 - @SuppressWarnings("unchecked") 12.899 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.900 - assertEquals(2, bindings.size()); 12.901 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.902 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.903 - } 12.904 - 12.905 - @Test 12.906 - public void testGeofSfContains() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.907 - { 12.908 - String query = 12.909 - prefixes+ 12.910 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.911 - "WHERE { \n" + 12.912 - " ?s1 ex:id ?id1 . \n"+ 12.913 - " ?s2 ex:id ?id2 . \n"+ 12.914 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.915 - " ?s2 ex:geometry ?g2 . \n" + 12.916 - " ?s1 ex:geometry ?g1 . \n"+ 12.917 - " FILTER( geof:sfContains(?g1, ?g2 )) . \n"+ 12.918 - "}"; 12.919 - 12.920 - @SuppressWarnings("unchecked") 12.921 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.922 - assertEquals(2, bindings.size()); 12.923 - assertTrue(-1<bindings.indexOf("[id2=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.924 - assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.925 - } 12.926 - 12.927 - @Test 12.928 - public void testGeofSfOverlaps() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.929 - { 12.930 - String query = 12.931 - prefixes+ 12.932 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.933 - "WHERE { \n" + 12.934 - " ?s1 ex:id ?id1 . \n"+ 12.935 - " ?s2 ex:id ?id2 . \n"+ 12.936 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.937 - " ?s2 ex:geometry ?g2 . \n" + 12.938 - " ?s1 ex:geometry ?g1 . \n"+ 12.939 - " FILTER( geof:sfOverlaps(?g1, ?g2 )) . \n"+ 12.940 - "}"; 12.941 - 12.942 - @SuppressWarnings("unchecked") 12.943 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.944 - assertEquals(2, bindings.size()); 12.945 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.946 - assertTrue(-1<bindings.indexOf("[id2=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.947 - } 12.948 - 12.949 - //Egenhofer - 8 functions - all with 2 arguments + boolean 12.950 - 12.951 - @Test 12.952 - public void testGeofEhEquals() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.953 - { 12.954 - String query = 12.955 - prefixes+ 12.956 - "SELECT DISTINCT ?s1 ?s2 \n"+ 12.957 - "WHERE { \n" + 12.958 - " ?s1 ex:geometry ?g1 . \n"+ 12.959 - " ?s2 ex:geometry ?g2 . \n" + 12.960 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 12.961 - " FILTER( geof:ehEquals(?g1, ?g2 )) . \n"+ 12.962 - "}"; 12.963 - 12.964 - @SuppressWarnings("unchecked") 12.965 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.966 - assertEquals(1, bindings.size()); 12.967 - assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 12.968 - } 12.969 - 12.970 - @Test 12.971 - public void testGeofEhDisjoint() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.972 - { 12.973 - String query = 12.974 - prefixes+ 12.975 - "SELECT DISTINCT ?s1 ?s2 \n"+ 12.976 - "WHERE { \n" + 12.977 - " ?s1 ex:geometry ?g1 . \n"+ 12.978 - " ?s2 ex:geometry ?g2 . \n" + 12.979 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 12.980 - " FILTER( geof:ehDisjoint(?g1, ?g2 )) . \n"+ 12.981 - "}"; 12.982 - 12.983 - @SuppressWarnings("unchecked") 12.984 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.985 - assertEquals(60, bindings.size()); 12.986 - // too many results :) 12.987 -// assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 12.988 - } 12.989 - 12.990 - @Test 12.991 - public void testGeofEhMeet() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.992 - { 12.993 - String query = 12.994 - prefixes+ 12.995 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.996 - "WHERE { \n" + 12.997 - " ?s1 ex:id ?id1 . \n"+ 12.998 - " ?s2 ex:id ?id2 . \n"+ 12.999 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.1000 - " ?s2 ex:geometry ?g2 . \n" + 12.1001 - " ?s1 ex:geometry ?g1 . \n"+ 12.1002 - " FILTER( geof:ehMeet(?g1, ?g2 )) . \n"+ 12.1003 - "}"; 12.1004 - 12.1005 - @SuppressWarnings("unchecked") 12.1006 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1007 - assertEquals(2, bindings.size()); 12.1008 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1009 - assertTrue(-1<bindings.indexOf("[id2=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1010 - } 12.1011 - 12.1012 - @Test 12.1013 - public void testGeofEhOverlap() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.1014 - { 12.1015 - String query = 12.1016 - prefixes+ 12.1017 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.1018 - "WHERE { \n" + 12.1019 - " ?s1 ex:id ?id1 . \n"+ 12.1020 - " ?s2 ex:id ?id2 . \n"+ 12.1021 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.1022 - " ?s2 ex:geometry ?g2 . \n" + 12.1023 - " ?s1 ex:geometry ?g1 . \n"+ 12.1024 - " FILTER( geof:ehOverlap(?g1, ?g2 )) . \n"+ 12.1025 - "}"; 12.1026 - 12.1027 - @SuppressWarnings("unchecked") 12.1028 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1029 - assertEquals(2, bindings.size()); 12.1030 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1031 - assertTrue(-1<bindings.indexOf("[id2=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1032 - } 12.1033 - 12.1034 - @Test 12.1035 - public void testGeofEhCovers() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.1036 - { 12.1037 - String query = 12.1038 - prefixes+ 12.1039 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.1040 - "WHERE { \n" + 12.1041 - " ?s1 ex:id ?id1 . \n"+ 12.1042 - " ?s2 ex:id ?id2 . \n"+ 12.1043 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.1044 - " ?s2 ex:geometry ?g2 . \n" + 12.1045 - " ?s1 ex:geometry ?g1 . \n"+ 12.1046 - " FILTER( geof:ehCovers(?g1, ?g2 )) . \n"+ 12.1047 - "}"; 12.1048 - 12.1049 - @SuppressWarnings("unchecked") 12.1050 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1051 - assertEquals(1, bindings.size()); 12.1052 - assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1053 - } 12.1054 - 12.1055 - @Test 12.1056 - public void testGeofEhCoveredBy() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.1057 - { 12.1058 - String query = 12.1059 - prefixes+ 12.1060 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.1061 - "WHERE { \n" + 12.1062 - " ?s1 ex:id ?id1 . \n"+ 12.1063 - " ?s2 ex:id ?id2 . \n"+ 12.1064 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.1065 - " ?s2 ex:geometry ?g2 . \n" + 12.1066 - " ?s1 ex:geometry ?g1 . \n"+ 12.1067 - " FILTER( geof:ehCoveredBy(?g1, ?g2 )) . \n"+ 12.1068 - "}"; 12.1069 - 12.1070 - @SuppressWarnings("unchecked") 12.1071 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1072 - assertEquals(1, bindings.size()); 12.1073 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1074 - } 12.1075 - 12.1076 - @Test 12.1077 - public void testGeofEhInside() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.1078 - { 12.1079 - String query = 12.1080 - prefixes+ 12.1081 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.1082 - "WHERE { \n" + 12.1083 - " ?s1 ex:id ?id1 . \n"+ 12.1084 - " ?s2 ex:id ?id2 . \n"+ 12.1085 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.1086 - " ?s2 ex:geometry ?g2 . \n" + 12.1087 - " ?s1 ex:geometry ?g1 . \n"+ 12.1088 - " FILTER( geof:ehInside(?g1, ?g2 )) . \n"+ 12.1089 - "}"; 12.1090 - 12.1091 - @SuppressWarnings("unchecked") 12.1092 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1093 - assertEquals(1, bindings.size()); 12.1094 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1095 - } 12.1096 - 12.1097 - @Test 12.1098 - public void testGeofEhContains() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.1099 - { 12.1100 - String query = 12.1101 - prefixes+ 12.1102 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.1103 - "WHERE { \n" + 12.1104 - " ?s1 ex:id ?id1 . \n"+ 12.1105 - " ?s2 ex:id ?id2 . \n"+ 12.1106 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.1107 - " ?s2 ex:geometry ?g2 . \n" + 12.1108 - " ?s1 ex:geometry ?g1 . \n"+ 12.1109 - " FILTER( geof:ehContains(?g1, ?g2 )) . \n"+ 12.1110 - "}"; 12.1111 - 12.1112 - @SuppressWarnings("unchecked") 12.1113 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1114 - assertEquals(1, bindings.size()); 12.1115 - assertTrue(-1<bindings.indexOf("[id2=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1116 - } 12.1117 - 12.1118 - //RCC8 - 8 functions - all with 2 arguments + boolean 12.1119 - 12.1120 - @Test 12.1121 - public void testGeofRcc8Dc() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.1122 - { 12.1123 - String query = 12.1124 - prefixes+ 12.1125 - "SELECT DISTINCT ?s1 ?s2 \n"+ 12.1126 - "WHERE { \n" + 12.1127 - " ?s1 ex:geometry ?g1 . \n"+ 12.1128 - " ?s2 ex:geometry ?g2 . \n" + 12.1129 - " FILTER( str(?s1) < str(?s2) ) . \n"+ 12.1130 - " FILTER( geof:rcc8dc(?g1, ?g2 )) . \n"+ 12.1131 - "}"; 12.1132 - 12.1133 - @SuppressWarnings("unchecked") 12.1134 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1135 - assertEquals(60, bindings.size()); 12.1136 - // too many results :) 12.1137 -// assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]")); 12.1138 - } 12.1139 - 12.1140 - @Test 12.1141 - public void testGeofRcc8Ec() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.1142 - { 12.1143 - String query = 12.1144 - prefixes+ 12.1145 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.1146 - "WHERE { \n" + 12.1147 - " ?s1 ex:id ?id1 . \n"+ 12.1148 - " ?s2 ex:id ?id2 . \n"+ 12.1149 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.1150 - " ?s2 ex:geometry ?g2 . \n" + 12.1151 - " ?s1 ex:geometry ?g1 . \n"+ 12.1152 - " FILTER( geof:rcc8po(?g1, ?g2 )) . \n"+ 12.1153 - "}"; 12.1154 - 12.1155 - @SuppressWarnings("unchecked") 12.1156 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1157 - assertEquals(2, bindings.size()); 12.1158 - assertTrue(-1<bindings.indexOf("[id2=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1159 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1160 - } 12.1161 - 12.1162 - @Test 12.1163 - public void testGeofRcc8Tppi() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.1164 - { 12.1165 - String query = 12.1166 - prefixes+ 12.1167 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.1168 - "WHERE { \n" + 12.1169 - " ?s1 ex:id ?id1 . \n"+ 12.1170 - " ?s2 ex:id ?id2 . \n"+ 12.1171 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.1172 - " ?s2 ex:geometry ?g2 . \n" + 12.1173 - " ?s1 ex:geometry ?g1 . \n"+ 12.1174 - " FILTER( geof:rcc8tppi(?g1, ?g2 )) . \n"+ 12.1175 - "}"; 12.1176 - 12.1177 - @SuppressWarnings("unchecked") 12.1178 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1179 - assertEquals(1, bindings.size()); 12.1180 - assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1181 - } 12.1182 - 12.1183 - @Test 12.1184 - public void testGeofRcc8Tpp() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.1185 - { 12.1186 - String query = 12.1187 - prefixes+ 12.1188 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.1189 - "WHERE { \n" + 12.1190 - " ?s1 ex:id ?id1 . \n"+ 12.1191 - " ?s2 ex:id ?id2 . \n"+ 12.1192 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.1193 - " ?s2 ex:geometry ?g2 . \n" + 12.1194 - " ?s1 ex:geometry ?g1 . \n"+ 12.1195 - " FILTER( geof:rcc8tpp(?g1, ?g2 )) . \n"+ 12.1196 - "}"; 12.1197 - 12.1198 - @SuppressWarnings("unchecked") 12.1199 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1200 - assertEquals(1, bindings.size()); 12.1201 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1202 - } 12.1203 - 12.1204 - 12.1205 - @Test 12.1206 - public void testGeofRcc8Ntpp() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.1207 - { 12.1208 - String query = 12.1209 - prefixes+ 12.1210 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.1211 - "WHERE { \n" + 12.1212 - " ?s1 ex:id ?id1 . \n"+ 12.1213 - " ?s2 ex:id ?id2 . \n"+ 12.1214 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.1215 - " ?s2 ex:geometry ?g2 . \n" + 12.1216 - " ?s1 ex:geometry ?g1 . \n"+ 12.1217 - " FILTER( geof:rcc8ntpp(?g1, ?g2 )) . \n"+ 12.1218 - "}"; 12.1219 - 12.1220 - @SuppressWarnings("unchecked") 12.1221 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1222 - assertEquals(1, bindings.size()); 12.1223 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1224 - } 12.1225 - @Test 12.1226 - public void testGeofRcc8Ntppi() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 12.1227 - { 12.1228 - String query = 12.1229 - prefixes+ 12.1230 - "SELECT DISTINCT ?id1 ?id2 \n"+ 12.1231 - "WHERE { \n" + 12.1232 - " ?s1 ex:id ?id1 . \n"+ 12.1233 - " ?s2 ex:id ?id2 . \n"+ 12.1234 - " FILTER( str(?id1) != str(?id2) ) . \n"+ 12.1235 - " ?s2 ex:geometry ?g2 . \n" + 12.1236 - " ?s1 ex:geometry ?g1 . \n"+ 12.1237 - " FILTER( geof:rcc8ntpp(?g1, ?g2 )) . \n"+ 12.1238 - "}"; 12.1239 - 12.1240 - @SuppressWarnings("unchecked") 12.1241 - ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection()); 12.1242 - assertEquals(1, bindings.size()); 12.1243 - assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]")); 12.1244 - } 12.1245 -}
13.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/TransformTests.java Thu May 14 11:24:32 2015 +0300 13.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 13.3 @@ -1,85 +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.generaldb; 13.14 - 13.15 -public class TransformTests { 13.16 - 13.17 - public static Strabon strabon; 13.18 - 13.19 - protected static String jdbcDriver= "org.postgresql.Driver"; 13.20 - protected static String serverName = "localhost"; 13.21 - protected static String username = "postgres"; 13.22 - protected static String password = "postgres"; 13.23 - protected static Integer port = 5432; 13.24 - protected static java.sql.Connection conn = null; 13.25 - protected static String databaseName = null; 13.26 - 13.27 - 13.28 - 13.29 - String prefixes = "PREFIX gag: <http://www.semanticweb.org/ontologies/2011/gagKallikratis.rdf#> \n"+ 13.30 - "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n"+ 13.31 - "PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> \n"+ 13.32 - "PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> \n"+ 13.33 - "PREFIX base: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> \n"+ 13.34 - "PREFIX ex: <http://www.example.org/ontology#> \n"+ 13.35 - "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + 13.36 - "PREFIX geof: <http://www.opengis.net/def/function/geosparql/> \n"; 13.37 - 13.38 - protected String query1 = prefixes + 13.39 - "SELECT ?H1 ?HAT1 ?HGEO1 " + 13.40 - "(strdf:transform(?HGEO1, <http://www.opengis.net/def/crs/EPSG/0/4326> ) AS ?converted)" + 13.41 - "(strdf:transform(strdf:union(?HGEO1,?HGEO1),<http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?united) " + 13.42 - "WHERE { \n"+ 13.43 - "?H1 rdf:type noa:Hotspot . \n"+ 13.44 - "?H1 noa:hasConfidence ?HCONF1 . \n"+ 13.45 - "?H1 noa:hasGeometry ?HGEO1 . \n"+ 13.46 - "?H1 noa:hasAcquisitionTime ?HAT1 . \n"+ 13.47 -// " FILTER(strdf:mbbIntersects(?HGEO1,?HGEO1)) "+ 13.48 - "}" + 13.49 - " LIMIT 5 \n"; 13.50 - 13.51 -// protected String query2 = prefixes + 13.52 -// "SELECT ?H1 ?H2 (strdf:transform(strdf:union(?HGEO1,?HGEO2),<http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?united)" + 13.53 -// "WHERE { \n"+ 13.54 -//// "?H1 rdf:type noa:Hotspot . \n"+ 13.55 -//// "?H2 rdf:type noa:Hotspot . \n"+ 13.56 -// "?H1 noa:hasGeometry ?HGEO1 . \n"+ 13.57 -// "?H2 noa:hasGeometry ?HGEO2 . \n"+ 13.58 -//// "?H1 noa:producedFromProcessingChain ?PC1 . \n"+ 13.59 -//// "?H2 noa:producedFromProcessingChain ?PC2 . \n"+ 13.60 -//// " FILTER(strdf:mbbIntersects(?HGEO1,?HGEO2)) "+ 13.61 -// " FILTER(?H1 != ?H2) "+ 13.62 -// "}" + 13.63 -// " LIMIT 5 \n"; 13.64 - 13.65 - 13.66 - 13.67 - protected String query3= prefixes + 13.68 - "SELECT ?H ?HGEO ?HAT " + 13.69 - "(strdf:transform(strdf:intersection(?HGEO, strdf:union(?CGEO)),<http://www.opengis.net/def/crs/EPSG/0/4326>) AS ?DIF) \n"+ 13.70 - "WHERE { \n"+ 13.71 - " ?H rdf:type noa:Hotspot ; \n"+ 13.72 - " noa:hasAcquisitionTime ?HAT ; \n"+ 13.73 - " noa:isDerivedFromSensor ?HS ; \n"+ 13.74 - " noa:hasGeometry ?HGEO . \n"+ 13.75 - " FILTER(str(?HS) = \"MSG2\") . \n"+ 13.76 - " FILTER(str(?HAT) = \"2007-08-24T14:45:00\") . \n"+ 13.77 - " ?C rdf:type noa:Coastline ; \n"+ 13.78 - " noa:hasGeometry ?CGEO . \n"+ 13.79 - " FILTER( strdf:mbbIntersects(?HGEO, ?CGEO) ) . \n"+ 13.80 - "} \n"+ 13.81 - "GROUP BY ?H ?HAT ?HGEO\n"+ 13.82 - "HAVING strdf:overlap(strdf:union(?CGEO), ?HGEO) " + 13.83 - " "; 13.84 - 13.85 - 13.86 - 13.87 - 13.88 -}
14.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/AggregateTests.java Thu May 14 11:24:32 2015 +0300 14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 14.3 @@ -1,38 +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 - * A set of simple tests on SPARQL query functionality 14.22 - * 14.23 - * @author George Garbis <ggarbis@di.uoa.gr> 14.24 - */ 14.25 -public class AggregateTests extends eu.earthobservatory.runtime.generaldb.AggregateTests { 14.26 - 14.27 - @BeforeClass 14.28 - public static void beforeClass(String inputfile) throws Exception 14.29 - { 14.30 - strabon = TemplateTests.beforeClass("/aggregate-tests-srid.nt"); 14.31 - 14.32 - } 14.33 - 14.34 - @AfterClass 14.35 - public static void afterClass() throws SQLException 14.36 - { 14.37 - TemplateTests.afterClass(strabon); 14.38 - } 14.39 - 14.40 - 14.41 -}
15.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/GeneralTests.java Thu May 14 11:24:32 2015 +0300 15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 15.3 @@ -1,87 +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.io.IOException; 15.16 -import java.sql.SQLException; 15.17 - 15.18 -import org.junit.AfterClass; 15.19 -import org.junit.BeforeClass; 15.20 -import org.junit.Test; 15.21 -import org.openrdf.query.MalformedQueryException; 15.22 -import org.openrdf.query.QueryEvaluationException; 15.23 -import org.openrdf.query.TupleQueryResultHandlerException; 15.24 - 15.25 -/** 15.26 - * A set of simple tests on SPARQL query functionality 15.27 - * 15.28 - * @author George Garbis <ggarbis@di.uoa.gr> 15.29 - */ 15.30 -public class GeneralTests extends eu.earthobservatory.runtime.generaldb.GeneralTests { 15.31 - 15.32 - @BeforeClass 15.33 - public static void beforeClass() throws Exception 15.34 - { 15.35 - strabon = TemplateTests.beforeClass("/more-tests.nt"); 15.36 - } 15.37 - 15.38 - @AfterClass 15.39 - public static void afterClass() throws SQLException 15.40 - { 15.41 - TemplateTests.afterClass(strabon); 15.42 - } 15.43 - 15.44 - @Test 15.45 - public void testQuerySpatialProperties() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 15.46 - { 15.47 - strabon.query(querySpatialPropertiesMonetDB,strabon.getSailRepoConnection()); 15.48 - 15.49 - } 15.50 - 15.51 - @Test 15.52 - public void testQuerySpatialPropertiesConst() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 15.53 - { 15.54 - strabon.query(querySpatialPropertiesConstMonetDB,strabon.getSailRepoConnection()); 15.55 - 15.56 - } 15.57 - 15.58 -// /** 15.59 -// * @throws java.lang.Exception 15.60 -// */ 15.61 -// @Before 15.62 -// public void before() 15.63 -// throws Exception 15.64 -// { 15.65 -// 15.66 -// } 15.67 -// 15.68 -// /** 15.69 -// * @throws java.lang.Exception 15.70 -// */ 15.71 -// @After 15.72 -// public void after() 15.73 -// throws Exception 15.74 -// { 15.75 -// // Clean database 15.76 -// Statement stmt = conn.createStatement(); 15.77 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 15.78 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 15.79 -// "and table_name <> 'geometry_columns' and " + 15.80 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 15.81 -// while (results.next()) { 15.82 -// String table_name = results.getString("table_name"); 15.83 -// Statement stmt2 = conn.createStatement(); 15.84 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 15.85 -// stmt2.close(); 15.86 -// } 15.87 -// 15.88 -// stmt.close(); 15.89 -// } 15.90 -}
16.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/HavingTests.java Thu May 14 11:24:32 2015 +0300 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 - * 16.22 - * @author George Garbis <ggarbis@di.uoa.gr> 16.23 - * 16.24 - */ 16.25 -public class HavingTests extends eu.earthobservatory.runtime.generaldb.HavingTests { 16.26 - 16.27 - @BeforeClass 16.28 - public static void beforeClass() throws Exception 16.29 - { 16.30 - strabon = TemplateTests.beforeClass("/having-tests-srid.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/JoinTests.java Thu May 14 11:24:32 2015 +0300 17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 17.3 @@ -1,36 +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 - * 17.22 - * @author George Garbis <ggarbis@di.uoa.gr> 17.23 - * 17.24 - */ 17.25 -public class JoinTests extends eu.earthobservatory.runtime.generaldb.JoinTests { 17.26 - 17.27 - @BeforeClass 17.28 - public static void beforeClass() throws Exception 17.29 - { 17.30 - strabon = TemplateTests.beforeClass("/join-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 -}
18.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/MeaningfulAggregateTests.java Thu May 14 11:24:32 2015 +0300 18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 18.3 @@ -1,32 +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.sql.SQLException; 18.16 - 18.17 -import org.junit.AfterClass; 18.18 -import org.junit.BeforeClass; 18.19 - 18.20 -public class MeaningfulAggregateTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 18.21 - 18.22 - @BeforeClass 18.23 - public static void beforeClass() throws Exception 18.24 - { 18.25 - strabon = TemplateTests.beforeClass("/more-tests.nt"); 18.26 - } 18.27 - 18.28 - @AfterClass 18.29 - public static void afterClass() throws SQLException 18.30 - { 18.31 - TemplateTests.afterClass(strabon); 18.32 - } 18.33 - 18.34 - 18.35 -}
19.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SimpleTests.java Thu May 14 11:24:32 2015 +0300 19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 19.3 @@ -1,68 +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 SimpleTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 19.26 - 19.27 - @BeforeClass 19.28 - public static void beforeClass() throws Exception 19.29 - { 19.30 - strabon = TemplateTests.beforeClass("/simple-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 -// /** 19.40 -// * @throws java.lang.Exception 19.41 -// */ 19.42 -// @Before 19.43 -// public void before() 19.44 -// throws Exception 19.45 -// { 19.46 -// 19.47 -// } 19.48 -// 19.49 -// /** 19.50 -// * @throws java.lang.Exception 19.51 -// */ 19.52 -// @After 19.53 -// public void after() 19.54 -// throws Exception 19.55 -// { 19.56 -// // Clean database 19.57 -// Statement stmt = conn.createStatement(); 19.58 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 19.59 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 19.60 -// "and table_name <> 'geometry_columns' and " + 19.61 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 19.62 -// while (results.next()) { 19.63 -// String table_name = results.getString("table_name"); 19.64 -// Statement stmt2 = conn.createStatement(); 19.65 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 19.66 -// stmt2.close(); 19.67 -// } 19.68 -// 19.69 -// stmt.close(); 19.70 -// } 19.71 -}
20.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/SpatialTests.java Thu May 14 11:24:32 2015 +0300 20.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 20.3 @@ -1,68 +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.monetdb; 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 - * A set of simple tests on SPARQL query functionality 20.22 - * 20.23 - * @author George Garbis <ggarbis@di.uoa.gr> 20.24 - */ 20.25 -public class SpatialTests extends eu.earthobservatory.runtime.generaldb.SpatialTests { 20.26 - 20.27 - @BeforeClass 20.28 - public static void beforeClass() throws Exception 20.29 - { 20.30 - strabon = TemplateTests.beforeClass("/spatial-tests-srid.nt"); 20.31 - } 20.32 - 20.33 - @AfterClass 20.34 - public static void afterClass() throws SQLException 20.35 - { 20.36 - TemplateTests.afterClass(strabon); 20.37 - } 20.38 - 20.39 -// /** 20.40 -// * @throws java.lang.Exception 20.41 -// */ 20.42 -// @Before 20.43 -// public void before() 20.44 -// throws Exception 20.45 -// { 20.46 -// 20.47 -// } 20.48 -// 20.49 -// /** 20.50 -// * @throws java.lang.Exception 20.51 -// */ 20.52 -// @After 20.53 -// public void after() 20.54 -// throws Exception 20.55 -// { 20.56 -// // Clean database 20.57 -// Statement stmt = conn.createStatement(); 20.58 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 20.59 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 20.60 -// "and table_name <> 'geometry_columns' and " + 20.61 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 20.62 -// while (results.next()) { 20.63 -// String table_name = results.getString("table_name"); 20.64 -// Statement stmt2 = conn.createStatement(); 20.65 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 20.66 -// stmt2.close(); 20.67 -// } 20.68 -// 20.69 -// stmt.close(); 20.70 -// } 20.71 -}
21.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TemplateTests.java Thu May 14 11:24:32 2015 +0300 21.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 21.3 @@ -1,143 +0,0 @@ 21.4 -/** 21.5 - * This Source Code Form is subject to the terms of the Mozilla Public 21.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 21.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 21.8 - * 21.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 21.10 - * 21.11 - * http://www.strabon.di.uoa.gr/ 21.12 - */ 21.13 -package eu.earthobservatory.runtime.monetdb; 21.14 - 21.15 -import java.io.IOException; 21.16 -import java.io.InputStream; 21.17 -import java.sql.DriverManager; 21.18 -import java.sql.ResultSet; 21.19 -import java.sql.SQLException; 21.20 -import java.sql.Statement; 21.21 -import java.util.Properties; 21.22 - 21.23 -import org.junit.AfterClass; 21.24 -import org.junit.BeforeClass; 21.25 -import org.openrdf.repository.RepositoryException; 21.26 -import org.openrdf.rio.RDFHandlerException; 21.27 -import org.openrdf.rio.RDFParseException; 21.28 - 21.29 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 21.30 -import eu.earthobservatory.runtime.generaldb.Strabon; 21.31 - 21.32 -/** 21.33 - * A set of simple tests on SPARQL query functionality 21.34 - * 21.35 - * @author George Garbis <ggarbis@di.uoa.gr> 21.36 - */ 21.37 -public class TemplateTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 21.38 - 21.39 - @BeforeClass 21.40 - public static Strabon beforeClass(String inputfile) throws Exception 21.41 - { 21.42 - // Read properties 21.43 - Properties properties = new Properties(); 21.44 - InputStream propertiesStream = TemplateTests.class.getResourceAsStream("/databases.properties"); 21.45 - properties.load(propertiesStream); 21.46 - 21.47 - serverName = properties.getProperty("monetdb.serverName"); 21.48 - databaseName = properties.getProperty("monetdb.databaseName"); 21.49 - port = Integer.parseInt(properties.getProperty("monetdb.port")); 21.50 - username = properties.getProperty("monetdb.username"); 21.51 - password = properties.getProperty("monetdb.password"); 21.52 - 21.53 - // Connect to database 21.54 - Class.forName("nl.cwi.monetdb.jdbc.MonetDriver"); 21.55 - String url = "jdbc:monetdb://"+serverName+":"+port+"/"+databaseName; 21.56 - conn = DriverManager.getConnection(url, username, password); 21.57 - 21.58 -// // Clean database 21.59 - Statement stmt = conn.createStatement(); 21.60 - ResultSet results = stmt.executeQuery("SELECT name FROM tables WHERE system=false AND name <> 'locked'"); 21.61 - while (results.next()) { 21.62 - String table_name = results.getString("name"); 21.63 - Statement stmt2 = conn.createStatement(); 21.64 - stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 21.65 - stmt2.close(); 21.66 - } 21.67 - stmt.close(); 21.68 - 21.69 - Strabon strabon = new eu.earthobservatory.runtime.monetdb.Strabon(databaseName, username, password, port, serverName, true); 21.70 - 21.71 - TemplateTests.loadTestData(inputfile, strabon); 21.72 - 21.73 - // This is a workaround for http://bug.strabon.di.uoa.gr/ticket/1 21.74 - strabon.close(); 21.75 - strabon = new eu.earthobservatory.runtime.monetdb.Strabon(databaseName, username, password, port, serverName, true); 21.76 - // 21.77 - 21.78 - return strabon; 21.79 - } 21.80 - 21.81 - @AfterClass 21.82 - public static void afterClass(Strabon strabon) throws SQLException 21.83 - { 21.84 - strabon.close(); 21.85 - } 21.86 - 21.87 - protected static void loadTestData(String inputfile, Strabon strabon) 21.88 - throws RDFParseException, RepositoryException, IOException, RDFHandlerException, InvalidDatasetFormatFault 21.89 - { 21.90 - strabon.storeInRepo(inputfile, "NTRIPLES", false); 21.91 - } 21.92 - 21.93 -// /** 21.94 -// * @throws java.lang.Exception 21.95 -// */ 21.96 -// @Before 21.97 -// public void before() 21.98 -// throws Exception 21.99 -// { 21.100 -// 21.101 -// } 21.102 -// 21.103 -// /** 21.104 -// * @throws java.lang.Exception 21.105 -// */ 21.106 -// @After 21.107 -// public void after() 21.108 -// throws Exception 21.109 -// { 21.110 -// // Clean database 21.111 -// Statement stmt = conn.createStatement(); 21.112 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 21.113 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 21.114 -// "and table_name <> 'geometry_columns' and " + 21.115 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 21.116 -// while (results.next()) { 21.117 -// String table_name = results.getString("table_name"); 21.118 -// Statement stmt2 = conn.createStatement(); 21.119 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 21.120 -// stmt2.close(); 21.121 -// } 21.122 -// 21.123 -// stmt.close(); 21.124 -// } 21.125 -} 21.126 -// */ 21.127 -// @After 21.128 -// public void after() 21.129 -// throws Exception 21.130 -// { 21.131 -// // Clean database 21.132 -// Statement stmt = conn.createStatement(); 21.133 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 21.134 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 21.135 -// "and table_name <> 'geometry_columns' and " + 21.136 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 21.137 -// while (results.next()) { 21.138 -// String table_name = results.getString("table_name"); 21.139 -// Statement stmt2 = conn.createStatement(); 21.140 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 21.141 -// stmt2.close(); 21.142 -// } 21.143 -// 21.144 -// stmt.close(); 21.145 -// } 21.146 -
22.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/monetdb/TransformTests.java Thu May 14 11:24:32 2015 +0300 22.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 22.3 @@ -1,36 +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.monetdb; 22.14 - 22.15 -import java.sql.SQLException; 22.16 - 22.17 -import org.junit.AfterClass; 22.18 -import org.junit.BeforeClass; 22.19 - 22.20 -/** 22.21 - * A set of simple tests on SPARQL query functionality 22.22 - * 22.23 - * @author George Garbis <ggarbis@di.uoa.gr> 22.24 - */ 22.25 -public class TransformTests extends eu.earthobservatory.runtime.generaldb.TransformTests { 22.26 - 22.27 - @BeforeClass 22.28 - public static void beforeClass() throws Exception 22.29 - { 22.30 - strabon = TemplateTests.beforeClass("/transform-tests.nt"); 22.31 - } 22.32 - 22.33 - @AfterClass 22.34 - public static void afterClass() throws SQLException 22.35 - { 22.36 - TemplateTests.afterClass(strabon); 22.37 - } 22.38 - 22.39 -}
23.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/AggregateTests.java Thu May 14 11:24:32 2015 +0300 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 AggregateTests extends eu.earthobservatory.runtime.generaldb.AggregateTests { 23.22 - 23.23 - @BeforeClass 23.24 - public static void beforeClass() throws Exception 23.25 - { 23.26 - strabon = TemplateTests.beforeClass("/aggregate-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/AllTests.java Thu May 14 11:24:32 2015 +0300 24.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 24.3 @@ -1,13 +0,0 @@ 24.4 -package eu.earthobservatory.runtime.postgis; 24.5 - 24.6 -import org.junit.runner.RunWith; 24.7 -import org.junit.runners.Suite; 24.8 -import org.junit.runners.Suite.SuiteClasses; 24.9 - 24.10 -@RunWith(Suite.class) 24.11 -@SuiteClasses({ AggregateTests.class, GeneralTests.class, HavingTests.class, 24.12 - JoinTests.class, MeaningfulAggregateTests.class, SimpleTests.class, 24.13 - SPARQL11Tests.class, SpatialTests.class }) 24.14 -public class AllTests { 24.15 - 24.16 -}
25.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/GeneralTests.java Thu May 14 11:24:32 2015 +0300 25.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 25.3 @@ -1,88 +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.io.IOException; 25.16 -import java.sql.SQLException; 25.17 - 25.18 -import org.junit.AfterClass; 25.19 -import org.junit.BeforeClass; 25.20 -import org.junit.Test; 25.21 -import org.openrdf.query.MalformedQueryException; 25.22 -import org.openrdf.query.QueryEvaluationException; 25.23 -import org.openrdf.query.TupleQueryResultHandlerException; 25.24 - 25.25 -/** 25.26 - * A set of simple tests on SPARQL query functionality 25.27 - * 25.28 - * @author George Garbis <ggarbis@di.uoa.gr> 25.29 - */ 25.30 -public class GeneralTests extends eu.earthobservatory.runtime.generaldb.GeneralTests { 25.31 - 25.32 - @BeforeClass 25.33 - public static void beforeClass() throws Exception 25.34 - { 25.35 - strabon = TemplateTests.beforeClass("/more-tests.nt"); 25.36 - } 25.37 - 25.38 - @AfterClass 25.39 - public static void afterClass() throws SQLException 25.40 - { 25.41 - TemplateTests.afterClass(strabon); 25.42 - } 25.43 - 25.44 - @Test 25.45 - public void testQuerySpatialProperties() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 25.46 - { 25.47 - strabon.query(querySpatialPropertiesPostGIS,strabon.getSailRepoConnection()); 25.48 - 25.49 - } 25.50 - 25.51 - @Test 25.52 - public void testQuerySpatialPropertiesConst() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException 25.53 - { 25.54 - strabon.query(querySpatialPropertiesConstPostGIS,strabon.getSailRepoConnection()); 25.55 - 25.56 - } 25.57 - 25.58 - 25.59 -// /** 25.60 -// * @throws java.lang.Exception 25.61 -// */ 25.62 -// @Before 25.63 -// public void before() 25.64 -// throws Exception 25.65 -// { 25.66 -// 25.67 -// } 25.68 -// 25.69 -// /** 25.70 -// * @throws java.lang.Exception 25.71 -// */ 25.72 -// @After 25.73 -// public void after() 25.74 -// throws Exception 25.75 -// { 25.76 -// // Clean database 25.77 -// Statement stmt = conn.createStatement(); 25.78 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 25.79 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 25.80 -// "and table_name <> 'geometry_columns' and " + 25.81 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 25.82 -// while (results.next()) { 25.83 -// String table_name = results.getString("table_name"); 25.84 -// Statement stmt2 = conn.createStatement(); 25.85 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 25.86 -// stmt2.close(); 25.87 -// } 25.88 -// 25.89 -// stmt.close(); 25.90 -// } 25.91 -}
26.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/HavingTests.java Thu May 14 11:24:32 2015 +0300 26.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 26.3 @@ -1,32 +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 -public class HavingTests extends eu.earthobservatory.runtime.generaldb.HavingTests { 26.22 - 26.23 - @BeforeClass 26.24 - public static void beforeClass() throws Exception 26.25 - { 26.26 - strabon = TemplateTests.beforeClass("/having-tests-srid.nt"); 26.27 - } 26.28 - 26.29 - @AfterClass 26.30 - public static void afterClass() throws SQLException 26.31 - { 26.32 - TemplateTests.afterClass(strabon); 26.33 - } 26.34 - 26.35 -}
27.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/JoinTests.java Thu May 14 11:24:32 2015 +0300 27.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 27.3 @@ -1,31 +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 -public class JoinTests extends eu.earthobservatory.runtime.generaldb.JoinTests { 27.21 - 27.22 - @BeforeClass 27.23 - public static void beforeClass() throws Exception 27.24 - { 27.25 - strabon = TemplateTests.beforeClass("/join-tests-srid.nt"); 27.26 - } 27.27 - 27.28 - @AfterClass 27.29 - public static void afterClass() throws SQLException 27.30 - { 27.31 - TemplateTests.afterClass(strabon); 27.32 - } 27.33 - 27.34 -}
28.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/MeaningfulAggregateTests.java Thu May 14 11:24:32 2015 +0300 28.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 28.3 @@ -1,35 +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 -public class MeaningfulAggregateTests extends eu.earthobservatory.runtime.generaldb.MeaningfulAggregateTests { 28.22 - 28.23 - 28.24 - @BeforeClass 28.25 - public static void beforeClass() throws Exception 28.26 - { 28.27 - strabon = TemplateTests.beforeClass("/group-tests-srid.nt"); 28.28 - } 28.29 - 28.30 - @AfterClass 28.31 - public static void afterClass() throws SQLException 28.32 - { 28.33 - TemplateTests.afterClass(strabon); 28.34 - } 28.35 - 28.36 - 28.37 - 28.38 -} 28.39 \ No newline at end of file
29.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SPARQL11Tests.java Thu May 14 11:24:32 2015 +0300 29.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 29.3 @@ -1,71 +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 java.sql.SQLException; 29.16 - 29.17 -import org.junit.AfterClass; 29.18 -import org.junit.BeforeClass; 29.19 - 29.20 -/** 29.21 - * A set of simple tests on SPARQL query functionality 29.22 - * 29.23 - * @author George Garbis <ggarbis@di.uoa.gr> 29.24 - */ 29.25 - 29.26 -public class SPARQL11Tests extends eu.earthobservatory.runtime.generaldb.SPARQL11Tests { 29.27 - 29.28 - @BeforeClass 29.29 - public static void beforeClass() throws Exception 29.30 - { 29.31 - strabon = TemplateTests.beforeClass("/sparql11-tests.nt"); 29.32 - } 29.33 - 29.34 - @AfterClass 29.35 - public static void afterClass() throws SQLException 29.36 - { 29.37 - TemplateTests.afterClass(strabon); 29.38 - } 29.39 - 29.40 - 29.41 - 29.42 -// /** 29.43 -// * @throws java.lang.Exception 29.44 -// */ 29.45 -// @Before 29.46 -// public void before() 29.47 -// throws Exception 29.48 -// { 29.49 -// 29.50 -// } 29.51 -// 29.52 -// /** 29.53 -// * @throws java.lang.Exception 29.54 -// */ 29.55 -// @After 29.56 -// public void after() 29.57 -// throws Exception 29.58 -// { 29.59 -// // Clean database 29.60 -// Statement stmt = conn.createStatement(); 29.61 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 29.62 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 29.63 -// "and table_name <> 'geometry_columns' and " + 29.64 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 29.65 -// while (results.next()) { 29.66 -// String table_name = results.getString("table_name"); 29.67 -// Statement stmt2 = conn.createStatement(); 29.68 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 29.69 -// stmt2.close(); 29.70 -// } 29.71 -// 29.72 -// stmt.close(); 29.73 -// } 29.74 -}
30.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SimpleTests.java Thu May 14 11:24:32 2015 +0300 30.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 30.3 @@ -1,68 +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 -public class SimpleTests extends eu.earthobservatory.runtime.generaldb.SimpleTests { 30.26 - 30.27 - @BeforeClass 30.28 - public static void beforeClass() throws Exception 30.29 - { 30.30 - strabon = TemplateTests.beforeClass("/simple-tests.nt"); 30.31 - } 30.32 - 30.33 - @AfterClass 30.34 - public static void afterClass() throws SQLException 30.35 - { 30.36 - TemplateTests.afterClass(strabon); 30.37 - } 30.38 - 30.39 -// /** 30.40 -// * @throws java.lang.Exception 30.41 -// */ 30.42 -// @Before 30.43 -// public void before() 30.44 -// throws Exception 30.45 -// { 30.46 -// 30.47 -// } 30.48 -// 30.49 -// /** 30.50 -// * @throws java.lang.Exception 30.51 -// */ 30.52 -// @After 30.53 -// public void after() 30.54 -// throws Exception 30.55 -// { 30.56 -// // Clean database 30.57 -// Statement stmt = conn.createStatement(); 30.58 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 30.59 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 30.60 -// "and table_name <> 'geometry_columns' and " + 30.61 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 30.62 -// while (results.next()) { 30.63 -// String table_name = results.getString("table_name"); 30.64 -// Statement stmt2 = conn.createStatement(); 30.65 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 30.66 -// stmt2.close(); 30.67 -// } 30.68 -// 30.69 -// stmt.close(); 30.70 -// } 30.71 -}
31.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SpatialTests.java Thu May 14 11:24:32 2015 +0300 31.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 31.3 @@ -1,69 +0,0 @@ 31.4 -/** 31.5 - * This Source Code Form is subject to the terms of the Mozilla Public 31.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 31.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 31.8 - * 31.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 31.10 - * 31.11 - * http://www.strabon.di.uoa.gr/ 31.12 - */ 31.13 -package eu.earthobservatory.runtime.postgis; 31.14 - 31.15 -import java.sql.SQLException; 31.16 - 31.17 -import org.junit.AfterClass; 31.18 -import org.junit.BeforeClass; 31.19 - 31.20 -/** 31.21 - * A set of simple tests on SPARQL query functionality 31.22 - * 31.23 - * @author George Garbis <ggarbis@di.uoa.gr> 31.24 - */ 31.25 - 31.26 -public class SpatialTests extends eu.earthobservatory.runtime.generaldb.SpatialTests { 31.27 - 31.28 - @BeforeClass 31.29 - public static void beforeClass() throws Exception 31.30 - { 31.31 - strabon = TemplateTests.beforeClass("/spatial-tests-srid.nt"); 31.32 - } 31.33 - 31.34 - @AfterClass 31.35 - public static void afterClass() throws SQLException 31.36 - { 31.37 - TemplateTests.afterClass(strabon); 31.38 - } 31.39 - 31.40 -// /** 31.41 -// * @throws java.lang.Exception 31.42 -// */ 31.43 -// @Before 31.44 -// public void before() 31.45 -// throws Exception 31.46 -// { 31.47 -// 31.48 -// } 31.49 -// 31.50 -// /** 31.51 -// * @throws java.lang.Exception 31.52 -// */ 31.53 -// @After 31.54 -// public void after() 31.55 -// throws Exception 31.56 -// { 31.57 -// // Clean database 31.58 -// Statement stmt = conn.createStatement(); 31.59 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 31.60 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 31.61 -// "and table_name <> 'geometry_columns' and " + 31.62 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 31.63 -// while (results.next()) { 31.64 -// String table_name = results.getString("table_name"); 31.65 -// Statement stmt2 = conn.createStatement(); 31.66 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 31.67 -// stmt2.close(); 31.68 -// } 31.69 -// 31.70 -// stmt.close(); 31.71 -// } 31.72 -}
32.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TemplateTests.java Thu May 14 11:24:32 2015 +0300 32.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 32.3 @@ -1,180 +0,0 @@ 32.4 -/** 32.5 - * This Source Code Form is subject to the terms of the Mozilla Public 32.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 32.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 32.8 - * 32.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 32.10 - * 32.11 - * http://www.strabon.di.uoa.gr/ 32.12 - */ 32.13 -package eu.earthobservatory.runtime.postgis; 32.14 - 32.15 -import static org.junit.Assert.assertNull; 32.16 - 32.17 -import java.io.IOException; 32.18 -import java.io.InputStream; 32.19 -import java.sql.Connection; 32.20 -import java.sql.DriverManager; 32.21 -import java.sql.PreparedStatement; 32.22 -import java.sql.ResultSet; 32.23 -import java.sql.SQLException; 32.24 -import java.util.ArrayList; 32.25 -import java.util.Properties; 32.26 - 32.27 -import org.junit.AfterClass; 32.28 -import org.junit.BeforeClass; 32.29 -import org.openrdf.repository.RepositoryException; 32.30 -import org.openrdf.rio.RDFHandlerException; 32.31 -import org.openrdf.rio.RDFParseException; 32.32 - 32.33 -import eu.earthobservatory.runtime.generaldb.InvalidDatasetFormatFault; 32.34 -import eu.earthobservatory.runtime.generaldb.SimpleTests; 32.35 -import eu.earthobservatory.runtime.generaldb.Strabon; 32.36 - 32.37 -/** 32.38 - * A set of simple tests on SPARQL query functionality 32.39 - * 32.40 - * @author George Garbis <ggarbis@di.uoa.gr> 32.41 - * @author Panayiotis Smeros <psmeros@di.uoa.gr> 32.42 - */ 32.43 -public class TemplateTests { 32.44 - 32.45 - public static String databaseTemplateName = null; 32.46 - public static String defaultUser = null; 32.47 - public static String serverName = null; 32.48 - public static String username = null; 32.49 - public static String password = null; 32.50 - public static Integer port = null; 32.51 - 32.52 - public static Connection conn = null; 32.53 - public static String databaseName = null; 32.54 - 32.55 - @BeforeClass 32.56 - public static Strabon beforeClass(String inputFile) throws Exception 32.57 - { 32.58 - String url=""; 32.59 - ArrayList<String> databases=new ArrayList<String>(); 32.60 - PreparedStatement pst = null; 32.61 - 32.62 - // Read properties 32.63 - Properties properties = new Properties(); 32.64 - InputStream propertiesStream = SimpleTests.class.getResourceAsStream("/databases.properties"); 32.65 - properties.load(propertiesStream); 32.66 - 32.67 - databaseTemplateName = properties.getProperty("postgis.databaseTemplateName");; 32.68 - defaultUser = properties.getProperty("postgis.defaultUser"); 32.69 - serverName = properties.getProperty("postgis.serverName"); 32.70 - username = properties.getProperty("postgis.username"); 32.71 - password = properties.getProperty("postgis.password"); 32.72 - port = Integer.parseInt(properties.getProperty("postgis.port")); 32.73 - 32.74 - //Connect to server and create the temp database 32.75 - url = "jdbc:postgresql://"+serverName+":"+port+"/"+defaultUser; 32.76 - conn = DriverManager.getConnection(url, username, password); 32.77 - assertNull(conn.getWarnings()); 32.78 - 32.79 - pst = conn.prepareStatement("SELECT * FROM pg_catalog.pg_database"); 32.80 - ResultSet rs = pst.executeQuery(); 32.81 - 32.82 - while (rs.next()) { 32.83 - databases.add(rs.getString(1)); 32.84 - } 32.85 - rs.close(); 32.86 - pst.close(); 32.87 - 32.88 - databaseName="teststrabon"+(int)(Math.random()*10000); 32.89 - while(databases.contains(databaseName)){ 32.90 - databaseName+="0"; 32.91 - } 32.92 - 32.93 - 32.94 - pst = conn.prepareStatement("CREATE DATABASE "+databaseName+" TEMPLATE " + databaseTemplateName); 32.95 - pst.executeUpdate(); 32.96 - pst.close(); 32.97 - conn.close(); 32.98 - 32.99 - url = "jdbc:postgresql://"+serverName+":"+port+"/"+databaseName; 32.100 - conn = DriverManager.getConnection(url, username, password); 32.101 - assertNull(conn.getWarnings()); 32.102 - 32.103 - Strabon strabon = new eu.earthobservatory.runtime.postgis.Strabon(databaseName, username, password, port, serverName, true); 32.104 - 32.105 - loadTestData(inputFile, strabon); 32.106 - 32.107 - return strabon; 32.108 - } 32.109 - 32.110 - 32.111 - @AfterClass 32.112 - public static void afterClass(Strabon strabon) throws SQLException 32.113 - { 32.114 - strabon.close(); 32.115 - 32.116 - //Drop the temp database 32.117 - conn.close(); 32.118 - String url = "jdbc:postgresql://"+serverName+":"+port+"/"+defaultUser; 32.119 - conn = DriverManager.getConnection(url, username, password); 32.120 - assertNull(conn.getWarnings()); 32.121 - 32.122 - PreparedStatement pst = conn.prepareStatement("DROP DATABASE "+databaseName); 32.123 - pst.executeUpdate(); 32.124 - pst.close(); 32.125 - conn.close(); 32.126 - } 32.127 - 32.128 - protected static void loadTestData(String inputfile, Strabon strabon) 32.129 - throws RDFParseException, RepositoryException, IOException, RDFHandlerException, InvalidDatasetFormatFault 32.130 - { 32.131 - strabon.storeInRepo(inputfile, "NTRIPLES", false); 32.132 - } 32.133 - 32.134 - 32.135 - // Clean database 32.136 -// Statement stmt = conn.createStatement(); 32.137 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 32.138 -// "table_schema='public' AND table_name <> 'spatial_ref_sys' " + 32.139 -// "AND table_name <> 'geometry_columns' AND table_name <> 'geography_columns' " + 32.140 -// "AND table_name <> 'raster_columns' AND table_name <> 'raster_overviews' " + 32.141 -// "AND table_name <> 'locked'" 32.142 -// ); 32.143 -// while (results.next()) { 32.144 -// String table_name = results.getString("table_name"); 32.145 -// Statement stmt2 = conn.createStatement(); 32.146 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 32.147 -// stmt2.close(); 32.148 -// } 32.149 -// stmt.close(); 32.150 - 32.151 -// /** 32.152 -// * @throws java.lang.Exception 32.153 -// */ 32.154 -// @Before 32.155 -// public void before() 32.156 -// throws Exception 32.157 -// { 32.158 -// 32.159 -// } 32.160 -// 32.161 -// /** 32.162 -// * @throws java.lang.Exception 32.163 -// */ 32.164 -// @After 32.165 -// public void after() 32.166 -// throws Exception 32.167 -// { 32.168 -// // Clean database 32.169 -// Statement stmt = conn.createStatement(); 32.170 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 32.171 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 32.172 -// "and table_name <> 'geometry_columns' and " + 32.173 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 32.174 -// while (results.next()) { 32.175 -// String table_name = results.getString("table_name"); 32.176 -// Statement stmt2 = conn.createStatement(); 32.177 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 32.178 -// stmt2.close(); 32.179 -// } 32.180 -// 32.181 -// stmt.close(); 32.182 -// } 32.183 -}
33.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/TransformTests.java Thu May 14 11:24:32 2015 +0300 33.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 33.3 @@ -1,69 +0,0 @@ 33.4 -/** 33.5 - * This Source Code Form is subject to the terms of the Mozilla Public 33.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this 33.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/. 33.8 - * 33.9 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team 33.10 - * 33.11 - * http://www.strabon.di.uoa.gr/ 33.12 - */ 33.13 -package eu.earthobservatory.runtime.postgis; 33.14 - 33.15 -import java.sql.SQLException; 33.16 - 33.17 -import org.junit.AfterClass; 33.18 -import org.junit.BeforeClass; 33.19 - 33.20 -/** 33.21 - * A set of simple tests on SPARQL query functionality 33.22 - * 33.23 - * @author George Garbis <ggarbis@di.uoa.gr> 33.24 - */ 33.25 - 33.26 -public class TransformTests extends eu.earthobservatory.runtime.generaldb.TransformTests { 33.27 - 33.28 - @BeforeClass 33.29 - public static void beforeClass() throws Exception 33.30 - { 33.31 - strabon = TemplateTests.beforeClass("/transform-tests.nt"); 33.32 - } 33.33 - 33.34 - @AfterClass 33.35 - public static void afterClass() throws SQLException 33.36 - { 33.37 - TemplateTests.afterClass(strabon); 33.38 - } 33.39 - 33.40 -// /** 33.41 -// * @throws java.lang.Exception 33.42 -// */ 33.43 -// @Before 33.44 -// public void before() 33.45 -// throws Exception 33.46 -// { 33.47 -// 33.48 -// } 33.49 -// 33.50 -// /** 33.51 -// * @throws java.lang.Exception 33.52 -// */ 33.53 -// @After 33.54 -// public void after() 33.55 -// throws Exception 33.56 -// { 33.57 -// // Clean database 33.58 -// Statement stmt = conn.createStatement(); 33.59 -// ResultSet results = stmt.executeQuery("SELECT table_name FROM information_schema.tables WHERE " + 33.60 -// "table_schema='public' and table_name <> 'spatial_ref_sys' " + 33.61 -// "and table_name <> 'geometry_columns' and " + 33.62 -// "table_name <> 'geography_columns' and table_name <> 'locked'"); 33.63 -// while (results.next()) { 33.64 -// String table_name = results.getString("table_name"); 33.65 -// Statement stmt2 = conn.createStatement(); 33.66 -// stmt2.executeUpdate("DROP TABLE \""+table_name+"\""); 33.67 -// stmt2.close(); 33.68 -// } 33.69 -// 33.70 -// stmt.close(); 33.71 -// } 33.72 -}
34.1 --- a/runtime/src/test/resources/aggregate-tests-srid.nt Thu May 14 11:24:32 2015 +0300 34.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 34.3 @@ -1,46 +0,0 @@ 34.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>. 34.5 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2000/01/rdf-schema#label> "Rosie's". 34.6 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2000/01/rdf-schema#label> "Coffee Republic". 34.7 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2000/01/rdf-schema#label> "Norwegian Wood". 34.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>. 34.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>. 34.10 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 34.11 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 34.12 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 34.13 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 34.14 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 34.15 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 34.16 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 34.17 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 34.18 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 34.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>. 34.20 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2000/01/rdf-schema#label> "The Clock Café". 34.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>. 34.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>. 34.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>. 34.24 -<http://linkedgeodata.org/ontology/Node122> <http://linkedgeodata.org/ontology/bufferExtent> "2"^^<http://www.w3.org/2001/XMLSchema#integer>. 34.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>. 34.26 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2000/01/rdf-schema#label> "Café Riva". 34.27 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2000/01/rdf-schema#label> "Curzon Diner". 34.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>. 34.29 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2000/01/rdf-schema#label> "Boscanova". 34.30 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2000/01/rdf-schema#label> "Caffe Nero". 34.31 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2000/01/rdf-schema#label> "Costa". 34.32 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 34.33 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 34.34 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 34.35 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 34.36 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 34.37 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 34.38 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 34.39 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 34.40 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 34.41 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 34.42 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 34.43 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 34.44 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 34.45 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 34.46 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 34.47 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 34.48 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 34.49 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>.
35.1 --- a/runtime/src/test/resources/cco2.nt Thu May 14 11:24:32 2015 +0300 35.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 35.3 @@ -1,46 +0,0 @@ 35.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>. 35.5 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2000/01/rdf-schema#label> "Rosie's". 35.6 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2000/01/rdf-schema#label> "Coffee Republic". 35.7 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2000/01/rdf-schema#label> "Norwegian Wood". 35.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>. 35.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>. 35.10 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 35.11 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 35.12 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 35.13 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 35.14 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 35.15 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 35.16 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 35.17 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 35.18 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 35.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>. 35.20 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2000/01/rdf-schema#label> "The Clock Café". 35.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>. 35.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>. 35.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>. 35.24 -<http://linkedgeodata.org/ontology/Node122> <http://linkedgeodata.org/ontology/bufferExtent> "2"^^<http://www.w3.org/2001/XMLSchema#integer>. 35.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>. 35.26 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2000/01/rdf-schema#label> "Café Riva". 35.27 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2000/01/rdf-schema#label> "Curzon Diner". 35.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>. 35.29 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2000/01/rdf-schema#label> "Boscanova". 35.30 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2000/01/rdf-schema#label> "Caffe Nero". 35.31 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2000/01/rdf-schema#label> "Costa". 35.32 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 35.33 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 35.34 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 35.35 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 35.36 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 35.37 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 35.38 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 35.39 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 35.40 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 35.41 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 35.42 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 35.43 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 35.44 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 35.45 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 35.46 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 35.47 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 35.48 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 35.49 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>.
36.1 --- a/runtime/src/test/resources/databases.properties Thu May 14 11:24:32 2015 +0300 36.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 36.3 @@ -1,14 +0,0 @@ 36.4 -# PostGIS 36.5 -postgis.databaseTemplateName = template_postgis 36.6 -postgis.defaultUser = postgres 36.7 -postgis.serverName = localhost 36.8 -postgis.username = postgres 36.9 -postgis.password = postgres 36.10 -postgis.port = 5432 36.11 - 36.12 -! MonetDB 36.13 -monetdb.databaseName = strabon-test 36.14 -monetdb.serverName = localhost 36.15 -monetdb.username = monetdb 36.16 -monetdb.password = monetdb 36.17 -monetdb.port = 50000
37.1 --- a/runtime/src/test/resources/group-tests-srid.nt Thu May 14 11:24:32 2015 +0300 37.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 37.3 @@ -1,22 +0,0 @@ 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>. 37.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>.
38.1 --- a/runtime/src/test/resources/having-tests-srid.nt Thu May 14 11:24:32 2015 +0300 38.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 38.3 @@ -1,26 +0,0 @@ 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>. 38.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>.
39.1 --- a/runtime/src/test/resources/join-tests-srid.nt Thu May 14 11:24:32 2015 +0300 39.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 39.3 @@ -1,20 +0,0 @@ 39.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>. 39.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>. 39.6 -<http://dbpedia.org/ontology/PopulatedPlaceGeoNames> <http://www.w3.org/2002/07/owl#sameAs> <http://dbpedia.org/ontology/PopulatedPlace9>. 39.7 -<http://linkedgeodata.org/ontology/Node1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/NaturalWood>. 39.8 -<http://dbpedia.org/ontology/PopulatedPlace9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/PopulatedPlace>. 39.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>. 39.10 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#Area88> <http://www.geonames.org/ontology#name> "London". 39.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>. 39.12 -<http://pachube.org/ontology/SensorSystem1> <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> <http://pachube.org/ontology/System1>. 39.13 -<http://pachube.org/ontology/SensorSystem9> <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> <http://pachube.org/ontology/System9>. 39.14 -<http://pachube.org/ontology/SensorDeployment1> <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> <http://pachube.org/ontology/SensorSystem1>. 39.15 -<http://pachube.org/ontology/SensorDeployment9> <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> <http://pachube.org/ontology/SensorSystem9>. 39.16 -<http://pachube.org/ontology/SensorDeployment1> <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> <http://pachube.org/ontology/SensorPlatform1>. 39.17 -<http://pachube.org/ontology/SensorDeployment9> <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> <http://pachube.org/ontology/SensorPlatform9>. 39.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>. 39.19 -<http://pachube.org/ontology/SensorPlatform1> <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> <http://pachube.org/ontology/Tajikistan>. 39.20 -<http://pachube.org/ontology/SensorPlatform9> <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> <http://pachube.org/ontology/Kikirikistan>. 39.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>. 39.22 -<http://pachube.org/ontology/Tajikistan> <http://dbpedia.org/property/hasGeometry> "POINT(0 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 39.23 -<http://pachube.org/ontology/Kikirikistan> <http://dbpedia.org/property/hasGeometry> "POINT(2 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>.
40.1 --- a/runtime/src/test/resources/join-tests.nt Thu May 14 11:24:32 2015 +0300 40.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 40.3 @@ -1,20 +0,0 @@ 40.4 -<http://pachube.org/ontology/Tajikistan> <http://dbpedia.org/property/hasGeometry> "POINT(0 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 40.5 -<http://pachube.org/ontology/SensorDeployment9> <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> <http://pachube.org/ontology/SensorPlatform9>. 40.6 -<http://pachube.org/ontology/SensorPlatform9> <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> <http://pachube.org/ontology/Kikirikistan>. 40.7 -<http://dbpedia.org/ontology/PopulatedPlace9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/PopulatedPlace>. 40.8 -<http://pachube.org/ontology/SensorDeployment1> <http://purl.oclc.org/NET/ssnx/ssn#deployedOnPlatform> <http://pachube.org/ontology/SensorPlatform1>. 40.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>. 40.10 -<http://pachube.org/ontology/Kikirikistan> <http://dbpedia.org/property/hasGeometry> "POINT(2 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 40.11 -<http://dbpedia.org/ontology/PopulatedPlaceGeoNames> <http://www.w3.org/2002/07/owl#sameAs> <http://dbpedia.org/ontology/PopulatedPlace9>. 40.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>. 40.13 -<http://pachube.org/ontology/SensorSystem1> <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> <http://pachube.org/ontology/System1>. 40.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>. 40.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>. 40.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>. 40.17 -<http://teleios.di.uoa.gr/ontologies/noaOntology.owl#Area88> <http://www.geonames.org/ontology#name> "London". 40.18 -<http://pachube.org/ontology/SensorDeployment1> <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> <http://pachube.org/ontology/SensorSystem1>. 40.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>. 40.20 -<http://pachube.org/ontology/SensorSystem9> <http://purl.oclc.org/NET/ssnx/ssn#hasSubSystem> <http://pachube.org/ontology/System9>. 40.21 -<http://pachube.org/ontology/SensorDeployment9> <http://purl.oclc.org/NET/ssnx/ssn#deployedSystem> <http://pachube.org/ontology/SensorSystem9>. 40.22 -<http://linkedgeodata.org/ontology/Node1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/NaturalWood>. 40.23 -<http://pachube.org/ontology/SensorPlatform1> <http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation> <http://pachube.org/ontology/Tajikistan>.
41.1 --- a/runtime/src/test/resources/more-tests-srid.nt Thu May 14 11:24:32 2015 +0300 41.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 41.3 @@ -1,58 +0,0 @@ 41.4 -<http://www.geonames.org/ontology/Athens> <http://www.w3.org/2002/07/owl#sameAs> <http://dbpedia.org/resource/Athens>. 41.5 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 41.6 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 41.7 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 41.8 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 41.9 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 41.10 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 41.11 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 41.12 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 41.13 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 41.14 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 41.15 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 41.16 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 41.17 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 41.18 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 41.19 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 41.20 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 41.21 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 41.22 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 41.23 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 41.24 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 41.25 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 41.26 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 41.27 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 41.28 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 41.29 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 41.30 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 41.31 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 41.32 -<http://linkedgeodata.org/triplify#way4020526> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology#Harbour>. 41.33 -<http://linkedgeodata.org/triplify#way4020525> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology#Pier>. 41.34 -<http://dbpedia.org/resource/Greece> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/resource/Country>. 41.35 -<http://linkedgeodata.org/ontology/Node122> <http://linkedgeodata.org/ontology/bufferExtent> "2"^^<http://www.w3.org/2001/XMLSchema#integer>. 41.36 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2000/01/rdf-schema#label> "Rosie's". 41.37 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2000/01/rdf-schema#label> "Curzon Diner". 41.38 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2000/01/rdf-schema#label> "Café Riva". 41.39 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2000/01/rdf-schema#label> "The Clock Café". 41.40 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2000/01/rdf-schema#label> "Costa". 41.41 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2000/01/rdf-schema#label> "Coffee Republic". 41.42 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2000/01/rdf-schema#label> "Caffe Nero". 41.43 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2000/01/rdf-schema#label> "Norwegian Wood". 41.44 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2000/01/rdf-schema#label> "Boscanova". 41.45 -<http://dbpedia.org/resource/Athens> <http://www.w3.org/2000/01/rdf-schema#label> "Athens". 41.46 -<http://linkedgeodata.org/triplify#way4020525> <http://www.w3.org/2000/01/rdf-schema#label> "Piraeus Pier". 41.47 -<http://linkedgeodata.org/triplify#way4020526> <http://www.w3.org/2000/01/rdf-schema#label> "Pearl Harbor". 41.48 -<http://dbpedia.org/resource/Greece> <http://dbpedia.org/property/capital> "Athens". 41.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>. 41.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>. 41.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>. 41.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>. 41.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>. 41.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>. 41.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>. 41.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>. 41.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>. 41.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>. 41.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>. 41.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>. 41.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>.
42.1 --- a/runtime/src/test/resources/more-tests.nt Thu May 14 11:24:32 2015 +0300 42.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 42.3 @@ -1,58 +0,0 @@ 42.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>. 42.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>. 42.6 -<http://dbpedia.org/resource/Greece> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/resource/Country>. 42.7 -<http://linkedgeodata.org/triplify#way4020525> <http://www.w3.org/2000/01/rdf-schema#label> "Piraeus Pier". 42.8 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/2000/01/rdf-schema#label> "Rosie's". 42.9 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/2000/01/rdf-schema#label> "Coffee Republic". 42.10 -<http://linkedgeodata.org/triplify#way4020525> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology#Pier>. 42.11 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/2000/01/rdf-schema#label> "Norwegian Wood". 42.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>. 42.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>. 42.14 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 42.15 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 42.16 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 42.17 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 42.18 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 42.19 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 42.20 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 42.21 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 42.22 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Cafe>. 42.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>. 42.24 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/2000/01/rdf-schema#label> "The Clock Café". 42.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>. 42.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>. 42.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>. 42.28 -<http://linkedgeodata.org/triplify#way4020526> <http://www.w3.org/2000/01/rdf-schema#label> "Pearl Harbor". 42.29 -<http://linkedgeodata.org/ontology/Node122> <http://linkedgeodata.org/ontology/bufferExtent> "2"^^<http://www.w3.org/2001/XMLSchema#integer>. 42.30 -<http://www.geonames.org/ontology/Athens> <http://www.w3.org/2002/07/owl#sameAs> <http://dbpedia.org/resource/Athens>. 42.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>. 42.32 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/2000/01/rdf-schema#label> "Café Riva". 42.33 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/2000/01/rdf-schema#label> "Curzon Diner". 42.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>. 42.35 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/2000/01/rdf-schema#label> "Boscanova". 42.36 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/2000/01/rdf-schema#label> "Caffe Nero". 42.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>. 42.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>. 42.39 -<http://linkedgeodata.org/triplify#way4020526> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology#Harbour>. 42.40 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/2000/01/rdf-schema#label> "Costa". 42.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>. 42.42 -<http://dbpedia.org/resource/Athens> <http://www.w3.org/2000/01/rdf-schema#label> "Athens". 42.43 -<http://dbpedia.org/resource/Greece> <http://dbpedia.org/property/capital> "Athens". 42.44 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 42.45 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 42.46 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 42.47 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 42.48 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 42.49 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 42.50 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 42.51 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 42.52 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Node>. 42.53 -<http://linkedgeodata.org/triplify/node817345828> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 42.54 -<http://linkedgeodata.org/triplify/node344800922> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 42.55 -<http://linkedgeodata.org/triplify/node278571210> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 42.56 -<http://linkedgeodata.org/triplify/node278982153> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 42.57 -<http://linkedgeodata.org/triplify/node742231354> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 42.58 -<http://linkedgeodata.org/triplify/node666779036> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 42.59 -<http://linkedgeodata.org/triplify/node742231352> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 42.60 -<http://linkedgeodata.org/triplify/node823767430> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>. 42.61 -<http://linkedgeodata.org/triplify/node823767435> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://linkedgeodata.org/ontology/Amenity>.
43.1 --- a/runtime/src/test/resources/simple-tests.nt Thu May 14 11:24:32 2015 +0300 43.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 43.3 @@ -1,8 +0,0 @@ 43.4 -<http://example.org/item1> <http://example.org/id> "1"^^<http://www.w3.org/2001/XMLSchema#int>. 43.5 -<http://example.org/item2> <http://example.org/id> "2"^^<http://www.w3.org/2001/XMLSchema#int>. 43.6 -<http://example.org/item3> <http://example.org/id> "3"^^<http://www.w3.org/2001/XMLSchema#int>. 43.7 -<http://example.org/item1> <http://example.org/value> "10"^^<http://www.w3.org/2001/XMLSchema#int>. 43.8 -<http://example.org/item2> <http://example.org/value> "20"^^<http://www.w3.org/2001/XMLSchema#int>. 43.9 -<http://example.org/item1> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeometry> "POINT(1 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 43.10 -<http://example.org/item2> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeometry> "POINT(2 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 43.11 -<http://example.org/item3> <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#hasGeometry> "POINT(3 0)"^^<http://strdf.di.uoa.gr/ontology#WKT>.
44.1 --- a/runtime/src/test/resources/sparql11-tests.nt Thu May 14 11:24:32 2015 +0300 44.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 44.3 @@ -1,62 +0,0 @@ 44.4 -<http://example.org#alice> <http://purl.org/dc/elements/1.0/title> "SPARQL Query Language Tutorial". 44.5 -<http://example.org#carol> <http://purl.org/dc/elements/1.0/title> "SPARQL". 44.6 -<http://example.org#a> <http://xmlns.com/foaf/0.1/name> "Johnny Lee Outlaw". 44.7 -<http://example.org#b> <http://xmlns.com/foaf/0.1/name> "Peter Goodguy". 44.8 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/name> "Alice". 44.9 -<http://example.org#bob> <http://xmlns.com/foaf/0.1/name> "Bob". 44.10 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/name> "Alice Foo". 44.11 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/name> "A. Foo". 44.12 -<http://example.org#bob> <http://xmlns.com/foaf/0.1/name> "Bob Bar". 44.13 -<http://example.org#bob> <http://xmlns.com/foaf/0.1/name> "B. Bar". 44.14 -<http://example.org#carol> <http://xmlns.com/foaf/0.1/name> "Carol Baz". 44.15 -<http://example.org#carol> <http://xmlns.com/foaf/0.1/name> "C. Baz". 44.16 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/homepage> <http://work.example.org/alice/>. 44.17 -<http://example.org#a> <http://xmlns.com/foaf/0.1/mbox> <mailto:jlow@example.com>. 44.18 -<http://example.org#b> <http://xmlns.com/foaf/0.1/mbox> <mailto:peter@example.org>. 44.19 -<http://example.org#c> <http://xmlns.com/foaf/0.1/mbox> <mailto:carol@example.org>. 44.20 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/mbox> <mailto:alice@example.com>. 44.21 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/mbox> <mailto:alice@work.example>. 44.22 -<http://example.org#bob> <http://xmlns.com/foaf/0.1/mbox> <mailto:bob@work.example>. 44.23 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/familyName> "Smith". 44.24 -<http://example.org#bob> <http://xmlns.com/foaf/0.1/familyName> "Jones". 44.25 -<http://example.org#carol> <http://xmlns.com/foaf/0.1/familyName> "Smith". 44.26 -<http://example.org#alice> <http://purl.org/dc/elements/1.0/creator> "Alice". 44.27 -<http://example.org#bob> <http://purl.org/dc/elements/1.1/creator> "Bob". 44.28 -<http://example.org#org1> <http://example.org#affiliates> <http://example.org#auth1>. 44.29 -<http://example.org#org1> <http://example.org#affiliates> <http://example.org#auth2>. 44.30 -<http://example.org#org2> <http://example.org#affiliates> <http://example.org#auth3>. 44.31 -<http://example.org#x> <http://example.org/ns#p> "cat"@en. 44.32 -<http://example.org#y> <http://example.org/ns#p> "42"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.33 -<http://example.org#z> <http://example.org/ns#p> "abc"^^<http://example.org/datatype#specialDatatype>. 44.34 -<http://example.org#a> <http://example.org#p> "1"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.35 -<http://example.org#b> <http://example.org#p> "3.0"^^<http://www.w3.org/2001/XMLSchema#decimal>. 44.36 -<http://example.org#a> <http://example.org#q> "1"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.37 -<http://example.org#a> <http://example.org#q> "2"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.38 -<http://example.org#b> <http://example.org#q> "4.0"^^<http://www.w3.org/2001/XMLSchema#decimal>. 44.39 -<http://example.org#b> <http://example.org#q> "5.0"^^<http://www.w3.org/2001/XMLSchema#decimal>. 44.40 -<http://example.org#auth1> <http://example.org#writesBook> <http://example.org#book1>. 44.41 -<http://example.org#auth1> <http://example.org#writesBook> <http://example.org#book2>. 44.42 -<http://example.org#auth2> <http://example.org#writesBook> <http://example.org#book3>. 44.43 -<http://example.org#auth3> <http://example.org#writesBook> <http://example.org#book4>. 44.44 -<http://example.org#book1> <http://example.org#price> "9"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.45 -<http://example.org#book2> <http://example.org#price> "5"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.46 -<http://example.org#book3> <http://example.org#price> "7"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.47 -<http://example.org#book4> <http://example.org#price> "7"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.48 -<http://example.org#johnDoe> <http://xmlns.com/foaf/0.1/surname> "Doe". 44.49 -<http://example.org#johnDoe> <http://xmlns.com/foaf/0.1/givenName> "John". 44.50 -<http://example.org#alice> <http://example.com/org#employeeId> "12345"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.51 -<http://example.org#bob> <http://example.com/org#employeeId> "67890"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.52 -<http://example.org#alice> <http://example.com/org#employeeName> "Alice". 44.53 -<http://example.org#bob> <http://example.com/org#employeeName> "Bob". 44.54 -<http://example.org#book1> <http://purl.org/dc/elements/1.1/title> "SPARQL Tutorial". 44.55 -<http://example.org#book2> <http://purl.org/dc/elements/1.1/title> "The Semantic Web". 44.56 -<http://example.org#bob> <http://purl.org/dc/elements/1.1/title> "SPARQL Protocol Tutorial". 44.57 -<http://example.org#carol> <http://purl.org/dc/elements/1.1/title> "SPARQL (updated)". 44.58 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/knows> <http://example.org#bob>. 44.59 -<http://example.org#alice> <http://xmlns.com/foaf/0.1/knows> <http://example.org#carol>. 44.60 -<http://example.org#book1> <http://example.org/ns#discount> "0.2"^^<http://www.w3.org/2001/XMLSchema#decimal>. 44.61 -<http://example.org#book2> <http://example.org/ns#discount> "0.25"^^<http://www.w3.org/2001/XMLSchema#decimal>. 44.62 -<http://example.org#book1> <http://example.org/ns#price> "42"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.63 -<http://example.org#book2> <http://example.org/ns#price> "23"^^<http://www.w3.org/2001/XMLSchema#integer>. 44.64 -<http://example.org#alice> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>. 44.65 -<http://example.org#bob> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>.
45.1 --- a/runtime/src/test/resources/spatial-tests-srid.nt Thu May 14 11:24:32 2015 +0300 45.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 45.3 @@ -1,36 +0,0 @@ 45.4 -<http://example.org/pol1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 45.5 -<http://example.org/pol11> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 45.6 -<http://example.org/pol2> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 45.7 -<http://example.org/pol3> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 45.8 -<http://example.org/pol4> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 45.9 -<http://example.org/pol5> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 45.10 -<http://example.org/pol6> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 45.11 -<http://example.org/pol7> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 45.12 -<http://example.org/pol8> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 45.13 -<http://example.org/pol9> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/Polygon>. 45.14 -<http://example.org/line20> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/LineString>. 45.15 -<http://example.org/line21> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/LineString>. 45.16 -<http://example.org/pol1> <http://example.org/id> "A"^^<http://www.w3.org/2001/XMLSchema#string>. 45.17 -<http://example.org/pol11> <http://example.org/id> "A"^^<http://www.w3.org/2001/XMLSchema#string>. 45.18 -<http://example.org/pol2> <http://example.org/id> "B"^^<http://www.w3.org/2001/XMLSchema#string>. 45.19 -<http://example.org/pol3> <http://example.org/id> "C"^^<http://www.w3.org/2001/XMLSchema#string>. 45.20 -<http://example.org/pol4> <http://example.org/id> "D"^^<http://www.w3.org/2001/XMLSchema#string>. 45.21 -<http://example.org/pol5> <http://example.org/id> "E"^^<http://www.w3.org/2001/XMLSchema#string>. 45.22 -<http://example.org/pol6> <http://example.org/id> "F"^^<http://www.w3.org/2001/XMLSchema#string>. 45.23 -<http://example.org/pol7> <http://example.org/id> "G"^^<http://www.w3.org/2001/XMLSchema#string>. 45.24 -<http://example.org/pol8> <http://example.org/id> "H"^^<http://www.w3.org/2001/XMLSchema#string>. 45.25 -<http://example.org/pol9> <http://example.org/id> "Z"^^<http://www.w3.org/2001/XMLSchema#string>. 45.26 -<http://example.org/line20> <http://example.org/id> "L1"^^<http://www.w3.org/2001/XMLSchema#string>. 45.27 -<http://example.org/line21> <http://example.org/id> "L2"^^<http://www.w3.org/2001/XMLSchema#string>. 45.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>. 45.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>. 45.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>. 45.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>. 45.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>. 45.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>. 45.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>. 45.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>. 45.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>. 45.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>. 45.38 -<http://example.org/line20> <http://example.org/geometry> "LINESTRING(11 3, 12 4)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 45.39 -<http://example.org/line21> <http://example.org/geometry> "LINESTRING(11 4, 12 3)"^^<http://strdf.di.uoa.gr/ontology#WKT>. 45.40 \ No newline at end of file