Strabon

changeset 179:8521941bf589

Add srid in MonetDB var selection & some minor changes
author George Garbis <ggarbis@di.uoa.gr>
date Mon May 21 18:12:58 2012 +0300 (2012-05-21)
parents 3b65d91a4eac
children e1d79c8814ad
files TODO monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBQueryBuilder.java postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISEvaluation.java postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SPARQL11Tests.java runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SpatialTests.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/SpatialTests.java
line diff
     1.1 --- a/TODO	Mon May 21 13:09:07 2012 +0300
     1.2 +++ b/TODO	Mon May 21 18:12:58 2012 +0300
     1.3 @@ -0,0 +1,17 @@
     1.4 +Tests in MonetDB that fail or throw exception:
     1.5 +
     1.6 +SimpleTests
     1.7 +	- testComplexFilter
     1.8 +	- testNotExistingPredicate
     1.9 +
    1.10 +SPARQL11Tests
    1.11 +	- testRetrieveEveryEntry
    1.12 +	- testBind
    1.13 +	- testConcat
    1.14 +	- testOptionalFilter
    1.15 +	- testMinus
    1.16 +	- testQuerySumGroupByHaving
    1.17 +	- testRegex
    1.18 +	- testRegexI
    1.19 +	- testUnionWithCommonObject
    1.20 +	- testUnionWithDifferentObject
     2.1 --- a/monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBQueryBuilder.java	Mon May 21 13:09:07 2012 +0300
     2.2 +++ b/monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBQueryBuilder.java	Mon May 21 18:12:58 2012 +0300
     2.3 @@ -221,13 +221,25 @@
     2.4  		else {
     2.5  			if(var.isSpatial())
     2.6  			{
     2.7 -				filter.appendFunction("asBinary");
     2.8 +				filter.appendFunction("AsBinary");
     2.9  				filter.openBracket();
    2.10 +				//XXX SRID
    2.11 +				filter.appendFunction("Transform");
    2.12 +				filter.openBracket();
    2.13 +				//
    2.14  				String alias = getLabelAlias(var.getRdbmsVar());
    2.15  
    2.16  				filter.column(alias, "strdfgeo");
    2.17 +				//XXX SRID
    2.18 +				filter.appendComma();
    2.19 +				filter.column(alias, "srid");
    2.20 +				filter.closeBracket();
    2.21 +				//
    2.22  				filter.closeBracket();
    2.23  
    2.24 +				//Adding srid field explicitly for my StrabonPolyhedron constructor later on!
    2.25 +				filter.appendComma();
    2.26 +				filter.column(alias, "srid");
    2.27  			}
    2.28  			else
    2.29  			{
    2.30 @@ -326,7 +338,7 @@
    2.31  				&&!(expr instanceof GeneralDBSqlMathExpr)
    2.32  				&&!(expr instanceof GeneralDBSqlSpatialProperty))
    2.33  		{
    2.34 -			query.select().appendFunction("asBinary");
    2.35 +			query.select().appendFunction("AsBinary");
    2.36  		}
    2.37  		else
    2.38  		{
     3.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISEvaluation.java	Mon May 21 13:09:07 2012 +0300
     3.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISEvaluation.java	Mon May 21 18:12:58 2012 +0300
     3.3 @@ -64,8 +64,6 @@
     3.4  					stmt.setObject(++p, o);
     3.5  				}
     3.6  				Collection<GeneralDBColumnVar> proj = qb.getProjections();
     3.7 -				//System.out.println("The SQL query is: ");
     3.8 -				//System.out.println(stmt.toString().replaceAll("\n"," ");
     3.9  				GeneralDBBindingIteration result = new PostGISBindingIteration(stmt);
    3.10  				result.setProjections(proj);
    3.11  				result.setBindings(bindings);
    3.12 @@ -76,7 +74,8 @@
    3.13  				result.setConstructIndexesAndNames(this.constructIndexesAndNames);
    3.14  				//
    3.15  		
    3.16 -				
    3.17 +				System.out.println("In PostGIS Evaluation, query is: ");
    3.18 +				System.out.println(query);
    3.19  				return result;
    3.20  			}
    3.21  			catch (SQLException e) {
     4.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Mon May 21 13:09:07 2012 +0300
     4.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Mon May 21 18:12:58 2012 +0300
     4.3 @@ -1045,8 +1045,8 @@
     4.4  
     4.5  	//Used in all the generaldb stsparql boolean spatial functions of the form ST_Function(?GEO1,?GEO2) 
     4.6  	protected void appendTransformFunc(GeneralDBSqlGeoTransform expr, GeneralDBSqlExprBuilder filter)
     4.7 -			throws UnsupportedRdbmsOperatorException
     4.8 -			{
     4.9 +	throws UnsupportedRdbmsOperatorException
    4.10 +	{
    4.11  		//In the case where no variable is present in the expression! e.g ConvexHull("POLYGON((.....))")
    4.12  		boolean sridNeeded = true;
    4.13  		//XXX Incorporating SRID
    4.14 @@ -1183,7 +1183,7 @@
    4.15  			filter.append(sridExpr);
    4.16  		}
    4.17  
    4.18 -			}
    4.19 +	}
    4.20  
    4.21  
    4.22  
     5.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SPARQL11Tests.java	Mon May 21 13:09:07 2012 +0300
     5.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SPARQL11Tests.java	Mon May 21 18:12:58 2012 +0300
     5.3 @@ -329,7 +329,7 @@
     5.4  	}
     5.5  	
     5.6  	@Test
     5.7 -	public void testUnionWithDifferenceObject() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException
     5.8 +	public void testUnionWithDifferentObject() throws MalformedQueryException, RepositoryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException
     5.9  	{	
    5.10  		String queryString = prefixes+
    5.11  			"SELECT ?x ?y \n"+
     6.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SpatialTests.java	Mon May 21 13:09:07 2012 +0300
     6.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/generaldb/SpatialTests.java	Mon May 21 18:12:58 2012 +0300
     6.3 @@ -7,7 +7,6 @@
     6.4  import java.io.IOException;
     6.5  import java.util.ArrayList;
     6.6  
     6.7 -import org.junit.AfterClass;
     6.8  import org.junit.Test;
     6.9  import org.openrdf.model.vocabulary.RDF;
    6.10  import org.openrdf.model.vocabulary.XMLSchema;
    6.11 @@ -15,8 +14,6 @@
    6.12  import org.openrdf.query.QueryEvaluationException;
    6.13  import org.openrdf.query.TupleQueryResultHandlerException;
    6.14  
    6.15 -import eu.earthobservatory.runtime.generaldb.Strabon;
    6.16 -
    6.17  public class SpatialTests {
    6.18  	public static Strabon strabon;
    6.19  	
    6.20 @@ -65,6 +62,7 @@
    6.21  			" FILTER( strdf:anyInteract(?g1, ?g2 ) ) . \n"+
    6.22  			"}";
    6.23  		
    6.24 +		@SuppressWarnings("unchecked")	
    6.25  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
    6.26  
    6.27  		assertEquals(4, bindings.size());
    6.28 @@ -89,6 +87,7 @@
    6.29  			" FILTER( strdf:contains(?g1, ?g2 )) . \n"+
    6.30  			"}";
    6.31  		
    6.32 +		@SuppressWarnings("unchecked")
    6.33  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
    6.34  		assertEquals(2, bindings.size());
    6.35  		assertTrue(-1<bindings.indexOf("[id2=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
    6.36 @@ -110,6 +109,7 @@
    6.37  			" FILTER( strdf:covers(?g1, ?g2 )) . \n"+
    6.38  			"}";
    6.39  		
    6.40 +		@SuppressWarnings("unchecked")
    6.41  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
    6.42  		assertEquals(2, bindings.size());
    6.43  		assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
    6.44 @@ -131,6 +131,7 @@
    6.45  			" FILTER( strdf:coveredBy(?g1, ?g2 )) . \n"+
    6.46  			"}";
    6.47  
    6.48 +		@SuppressWarnings("unchecked")
    6.49  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
    6.50  		assertEquals(2, bindings.size());
    6.51  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
    6.52 @@ -150,6 +151,7 @@
    6.53  			" FILTER( strdf:disjoint(?g1, ?g2 )) . \n"+
    6.54  			"}";
    6.55  
    6.56 +		@SuppressWarnings("unchecked")
    6.57  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
    6.58  		assertEquals(40, bindings.size());
    6.59  		// too many results
    6.60 @@ -169,9 +171,10 @@
    6.61  			" FILTER( strdf:equals(?g1, ?g2 )) . \n"+
    6.62  			"}";
    6.63  		
    6.64 -			ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
    6.65 -			assertEquals(1, bindings.size());
    6.66 -			assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]"));
    6.67 +		@SuppressWarnings("unchecked")
    6.68 +		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
    6.69 +		assertEquals(1, bindings.size());
    6.70 +		assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]"));
    6.71  		}
    6.72  
    6.73  	@Test
    6.74 @@ -189,10 +192,11 @@
    6.75  			" FILTER( strdf:inside(?g1, ?g2 )) . \n"+
    6.76  			"}";
    6.77  		
    6.78 -			ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
    6.79 -			assertEquals(2, bindings.size());
    6.80 -			assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
    6.81 -			assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
    6.82 +		@SuppressWarnings("unchecked")
    6.83 +		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
    6.84 +		assertEquals(2, bindings.size());
    6.85 +		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
    6.86 +		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
    6.87  	}
    6.88  
    6.89  	@Test
    6.90 @@ -210,6 +214,7 @@
    6.91  			" FILTER( strdf:overlap(?g1, ?g2 )) . \n"+
    6.92  			"}";
    6.93  		
    6.94 +		@SuppressWarnings("unchecked")
    6.95  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
    6.96  		assertEquals(2, bindings.size());
    6.97  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
    6.98 @@ -231,6 +236,7 @@
    6.99  			" FILTER( geof:sf-touches(?g1, ?g2 )) . \n"+
   6.100  			"}";
   6.101  		
   6.102 +		@SuppressWarnings("unchecked")
   6.103  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.104  		assertEquals(1, bindings.size());
   6.105  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.106 @@ -251,6 +257,7 @@
   6.107  			" FILTER( strdf:relate(?g1, ?g2, \"T*F**F***\" )) . \n"+
   6.108  			"}";
   6.109  		
   6.110 +		@SuppressWarnings("unchecked")
   6.111  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.112  		assertEquals(2, bindings.size());
   6.113  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.114 @@ -280,10 +287,11 @@
   6.115  			" FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" +
   6.116  			"}";
   6.117  		
   6.118 +		@SuppressWarnings("unchecked")
   6.119  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.120  		
   6.121  		assertEquals(1, bindings.size());
   6.122 -		assertTrue(-1<bindings.indexOf("[ret=\"POLYGON ((5 3, 3 3, 3 8, 5 8, 10 8, 10 3, 5 3))\"^^<http://strdf.di.uoa.gr/ontology#WKT>]"));
   6.123 +		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>]"));
   6.124  	}
   6.125  	
   6.126  	@Test
   6.127 @@ -298,6 +306,7 @@
   6.128  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.129  			"}";
   6.130  		
   6.131 +		@SuppressWarnings("unchecked")
   6.132  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.133  				
   6.134  		assertEquals(1, bindings.size());
   6.135 @@ -322,6 +331,7 @@
   6.136  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.137  			"}";
   6.138  		
   6.139 +		@SuppressWarnings("unchecked")
   6.140  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.141  				
   6.142  		assertEquals(1, bindings.size());
   6.143 @@ -340,6 +350,7 @@
   6.144  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.145  			"}";
   6.146  		
   6.147 +		@SuppressWarnings("unchecked")
   6.148  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.149  				
   6.150  		assertEquals(1, bindings.size());
   6.151 @@ -357,6 +368,7 @@
   6.152  			" FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" +
   6.153  			"}";
   6.154  		
   6.155 +		@SuppressWarnings("unchecked")
   6.156  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.157  		
   6.158  		assertEquals(1, bindings.size());
   6.159 @@ -375,6 +387,7 @@
   6.160  			" FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" +
   6.161  			"}";
   6.162  		
   6.163 +		@SuppressWarnings("unchecked")
   6.164  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.165  				
   6.166  		assertEquals(1, bindings.size());
   6.167 @@ -393,6 +406,7 @@
   6.168  		" FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" +
   6.169  		"}";
   6.170  	
   6.171 +	@SuppressWarnings("unchecked")
   6.172  	ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.173  			
   6.174  	assertEquals(1, bindings.size());
   6.175 @@ -413,6 +427,7 @@
   6.176  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.177  			"}";
   6.178  		
   6.179 +		@SuppressWarnings("unchecked")
   6.180  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.181  				
   6.182  		assertEquals(1, bindings.size());
   6.183 @@ -431,6 +446,7 @@
   6.184  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.185  			"}";
   6.186  		
   6.187 +		@SuppressWarnings("unchecked")
   6.188  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.189  				
   6.190  		assertEquals(1, bindings.size());
   6.191 @@ -451,6 +467,7 @@
   6.192  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.193  			"}";
   6.194  		
   6.195 +		@SuppressWarnings("unchecked")
   6.196  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.197  		
   6.198  		assertEquals(1, bindings.size());
   6.199 @@ -477,6 +494,7 @@
   6.200  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.201  			"}";
   6.202  		
   6.203 +		@SuppressWarnings("unchecked")
   6.204  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.205  
   6.206  		assertEquals(1, bindings.size());
   6.207 @@ -503,6 +521,7 @@
   6.208  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.209  			"}";
   6.210  		
   6.211 +		@SuppressWarnings("unchecked")
   6.212  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.213  
   6.214  		assertEquals(1, bindings.size());
   6.215 @@ -529,6 +548,7 @@
   6.216  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.217  			"}";
   6.218  		
   6.219 +		@SuppressWarnings("unchecked")
   6.220  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.221  		// TODO test srid uri arguments
   6.222  		assertEquals(1, bindings.size());		
   6.223 @@ -554,10 +574,11 @@
   6.224  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.225  			"}";
   6.226  	
   6.227 -	ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.228 -
   6.229 -	assertEquals(1, bindings.size());		
   6.230 -	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>]"));
   6.231 +		@SuppressWarnings("unchecked")
   6.232 +		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.233 +		
   6.234 +		assertEquals(1, bindings.size());		
   6.235 +		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>]"));
   6.236  	}
   6.237  	
   6.238  	@Test
   6.239 @@ -574,10 +595,11 @@
   6.240  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.241  			"}";
   6.242  	
   6.243 -	ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.244 -
   6.245 -	assertEquals(1, bindings.size());		
   6.246 -	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>]"));
   6.247 +		@SuppressWarnings("unchecked")
   6.248 +		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.249 +	
   6.250 +		assertEquals(1, bindings.size());		
   6.251 +		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>]"));
   6.252  	}
   6.253  	
   6.254  	// -- GEOSPARQL -- //
   6.255 @@ -596,6 +618,7 @@
   6.256  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.257  			"}";
   6.258  		
   6.259 +		@SuppressWarnings("unchecked")
   6.260  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.261  				
   6.262  		assertEquals(1, bindings.size());
   6.263 @@ -614,6 +637,7 @@
   6.264  			" FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" +
   6.265  			"}";
   6.266  		
   6.267 +		@SuppressWarnings("unchecked")
   6.268  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.269  		
   6.270  		assertEquals(1, bindings.size());
   6.271 @@ -632,6 +656,7 @@
   6.272  			" FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" +
   6.273  			"}";
   6.274  		
   6.275 +		@SuppressWarnings("unchecked")
   6.276  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.277  				
   6.278  		assertEquals(1, bindings.size());
   6.279 @@ -650,6 +675,7 @@
   6.280  		" FILTER( str(?id) = \"Z\"^^xsd:string ) . \n" +
   6.281  		"}";
   6.282  	
   6.283 +	@SuppressWarnings("unchecked")
   6.284  	ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.285  			
   6.286  	assertEquals(1, bindings.size());
   6.287 @@ -668,6 +694,7 @@
   6.288  			" FILTER( str(?id) = \"C\"^^xsd:string ) . \n" +
   6.289  			"}";
   6.290  		
   6.291 +		@SuppressWarnings("unchecked")
   6.292  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.293  				
   6.294  		assertEquals(1, bindings.size());
   6.295 @@ -713,6 +740,7 @@
   6.296  			" FILTER( geof:sf-equals(?g1, ?g2 )) . \n"+
   6.297  			"}";
   6.298  		
   6.299 +		@SuppressWarnings("unchecked")
   6.300  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.301  		assertEquals(1, bindings.size());
   6.302  		assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]"));
   6.303 @@ -731,6 +759,7 @@
   6.304  			" FILTER( geof:sf-disjoint(?g1, ?g2 )) . \n"+
   6.305  			"}";
   6.306  		
   6.307 +		@SuppressWarnings("unchecked")
   6.308  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.309  		assertEquals(40, bindings.size());
   6.310  		// too many results :)
   6.311 @@ -752,6 +781,7 @@
   6.312  			" FILTER( geof:sf-intersects(?g1, ?g2 )) . \n"+
   6.313  			"}";
   6.314  		
   6.315 +		@SuppressWarnings("unchecked")
   6.316  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.317  		assertEquals(4, bindings.size());
   6.318  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.319 @@ -775,6 +805,7 @@
   6.320  			" FILTER( geof:sf-touches(?g1, ?g2 )) . \n"+
   6.321  			"}";
   6.322  		
   6.323 +		@SuppressWarnings("unchecked")
   6.324  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.325  		assertEquals(1, bindings.size());
   6.326  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.327 @@ -795,6 +826,7 @@
   6.328  			" FILTER( geof:sf-crosses(?g1, ?g2 )) . \n"+
   6.329  			"}";
   6.330  		
   6.331 +		@SuppressWarnings("unchecked")
   6.332  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.333  		assertEquals(4, bindings.size());
   6.334  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.335 @@ -818,6 +850,7 @@
   6.336  			" FILTER( geof:sf-within(?g1, ?g2 )) . \n"+
   6.337  			"}";
   6.338  		
   6.339 +		@SuppressWarnings("unchecked")
   6.340  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.341  		assertEquals(2, bindings.size());
   6.342  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.343 @@ -839,6 +872,7 @@
   6.344  			" FILTER( geof:sf-contains(?g1, ?g2 )) . \n"+
   6.345  			"}";
   6.346  		
   6.347 +		@SuppressWarnings("unchecked")
   6.348  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.349  		assertEquals(2, bindings.size());
   6.350  		assertTrue(-1<bindings.indexOf("[id2=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.351 @@ -860,6 +894,7 @@
   6.352  			" FILTER( geof:sf-overlaps(?g1, ?g2 )) . \n"+
   6.353  			"}";
   6.354  		
   6.355 +		@SuppressWarnings("unchecked")
   6.356  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.357  		assertEquals(2, bindings.size());
   6.358  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.359 @@ -881,6 +916,7 @@
   6.360  			" FILTER( geof:eh-equals(?g1, ?g2 )) . \n"+
   6.361  			"}";
   6.362  		
   6.363 +		@SuppressWarnings("unchecked")
   6.364  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.365  		assertEquals(1, bindings.size());
   6.366  		assertTrue(-1<bindings.indexOf("[s2=http://example.org/pol11;s1=http://example.org/pol1]"));
   6.367 @@ -899,6 +935,7 @@
   6.368  			" FILTER( geof:eh-disjoint(?g1, ?g2 )) . \n"+
   6.369  			"}";
   6.370  		
   6.371 +		@SuppressWarnings("unchecked")
   6.372  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.373  		assertEquals(40, bindings.size());
   6.374  		// too many results :)
   6.375 @@ -920,6 +957,7 @@
   6.376  			" FILTER( geof:eh-meet(?g1, ?g2 )) . \n"+
   6.377  			"}";
   6.378  		
   6.379 +		@SuppressWarnings("unchecked")
   6.380  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.381  		assertEquals(2, bindings.size());
   6.382  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"G\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.383 @@ -941,6 +979,7 @@
   6.384  			" FILTER( geof:eh-overlap(?g1, ?g2 )) . \n"+
   6.385  			"}";
   6.386  		
   6.387 +		@SuppressWarnings("unchecked")
   6.388  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.389  		assertEquals(2, bindings.size());
   6.390  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.391 @@ -962,6 +1001,7 @@
   6.392  			" FILTER( geof:eh-covers(?g1, ?g2 )) . \n"+
   6.393  			"}";
   6.394  		
   6.395 +		@SuppressWarnings("unchecked")
   6.396  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.397  		assertEquals(1, bindings.size());
   6.398  		assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.399 @@ -982,6 +1022,7 @@
   6.400  			" FILTER( geof:eh-coveredBy(?g1, ?g2 )) . \n"+
   6.401  			"}";
   6.402  		
   6.403 +		@SuppressWarnings("unchecked")
   6.404  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.405  		assertEquals(1, bindings.size());
   6.406  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.407 @@ -1002,6 +1043,7 @@
   6.408  			" FILTER( geof:eh-inside(?g1, ?g2 )) . \n"+
   6.409  			"}";
   6.410  		
   6.411 +		@SuppressWarnings("unchecked")
   6.412  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.413  		assertEquals(1, bindings.size());
   6.414  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.415 @@ -1022,6 +1064,7 @@
   6.416  			" FILTER( geof:eh-contains(?g1, ?g2 )) . \n"+
   6.417  			"}";
   6.418  		
   6.419 +		@SuppressWarnings("unchecked")
   6.420  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.421  		assertEquals(1, bindings.size());
   6.422  		assertTrue(-1<bindings.indexOf("[id2=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.423 @@ -1042,6 +1085,7 @@
   6.424  			" FILTER( geof:rcc8-dc(?g1, ?g2 )) . \n"+
   6.425  			"}";
   6.426  		
   6.427 +		@SuppressWarnings("unchecked")
   6.428  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.429  		assertEquals(40, bindings.size());
   6.430  		// too many results :)
   6.431 @@ -1063,6 +1107,7 @@
   6.432  			" FILTER( geof:rcc8-po(?g1, ?g2 )) . \n"+
   6.433  			"}";
   6.434  		
   6.435 +		@SuppressWarnings("unchecked")
   6.436  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.437  		assertEquals(2, bindings.size());
   6.438  		assertTrue(-1<bindings.indexOf("[id2=\"B\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.439 @@ -1084,6 +1129,7 @@
   6.440  			" FILTER( geof:rcc8-tppi(?g1, ?g2 )) . \n"+
   6.441  			"}";
   6.442  		
   6.443 +		@SuppressWarnings("unchecked")
   6.444  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.445  		assertEquals(1, bindings.size());
   6.446  		assertTrue(-1<bindings.indexOf("[id2=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.447 @@ -1104,6 +1150,7 @@
   6.448  			" FILTER( geof:rcc8-tpp(?g1, ?g2 )) . \n"+
   6.449  			"}";
   6.450  		
   6.451 +		@SuppressWarnings("unchecked")
   6.452  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.453  		assertEquals(1, bindings.size());
   6.454  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"F\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.455 @@ -1125,6 +1172,7 @@
   6.456  			" FILTER( geof:rcc8-ntpp(?g1, ?g2 )) . \n"+
   6.457  			"}";
   6.458  		
   6.459 +		@SuppressWarnings("unchecked")
   6.460  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.461  		assertEquals(1, bindings.size());
   6.462  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
   6.463 @@ -1144,6 +1192,7 @@
   6.464  			" FILTER( geof:rcc8-ntpp(?g1, ?g2 )) . \n"+
   6.465  			"}";
   6.466  		
   6.467 +		@SuppressWarnings("unchecked")
   6.468  		ArrayList<String> bindings = (ArrayList<String>) strabon.query(query,strabon.getSailRepoConnection());
   6.469  		assertEquals(1, bindings.size());
   6.470  		assertTrue(-1<bindings.indexOf("[id2=\"Z\"^^<http://www.w3.org/2001/XMLSchema#string>;id1=\"E\"^^<http://www.w3.org/2001/XMLSchema#string>]"));
     7.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SpatialTests.java	Mon May 21 13:09:07 2012 +0300
     7.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/SpatialTests.java	Mon May 21 18:12:58 2012 +0300
     7.3 @@ -27,7 +27,7 @@
     7.4  	@BeforeClass
     7.5  	public static void beforeClass() throws SQLException, ClassNotFoundException, RDFParseException, RepositoryException, RDFHandlerException, IOException, InvalidDatasetFormatFault
     7.6  	{
     7.7 -		strabon = TemplateTests.beforeClass("./spatial-tests-srid.nt");
     7.8 +		strabon = TemplateTests.beforeClass("/spatial-tests-srid.nt");
     7.9  	}
    7.10  	
    7.11  	@AfterClass