Strabon

changeset 58:c120517d858a

strdf:transform now supports variables (uris) as 2nd argument
author Manos Karpathiotakis <mk@di.uoa.gr>
date Fri Mar 16 13:56:41 2012 +0200 (2012-03-16)
parents 92512d21b0d7
children 7c2f5562a99b
files generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBSqlExprBuilder.java generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TransTableManager.java postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBSqlExprBuilder.java	Fri Mar 16 00:55:27 2012 +0100
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBSqlExprBuilder.java	Fri Mar 16 13:56:41 2012 +0200
     1.3 @@ -312,7 +312,7 @@
     1.4  	}
     1.5  	
     1.6  	public void keepSRID_part1() {
     1.7 -		where.append(" SUBSTRING(");
     1.8 +		where.append("CAST ( SUBSTRING(");
     1.9  	}
    1.10  	
    1.11  	public void keepSRID_part2() {
    1.12 @@ -320,7 +320,7 @@
    1.13  	}
    1.14  	
    1.15  	public void keepSRID_part3() {
    1.16 -		where.append(" ) + 2) ");
    1.17 +		where.append(" ) + 2) AS integer) ) ");
    1.18  	}
    1.19  
    1.20  	//	public void overlap() {
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TransTableManager.java	Fri Mar 16 00:55:27 2012 +0100
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/managers/TransTableManager.java	Fri Mar 16 13:56:41 2012 +0200
     2.3 @@ -246,7 +246,7 @@
     2.4  		synchronized (tables) {
     2.5  			TransactionTable table = tables.get(pred);
     2.6  			if (table == null) {
     2.7 -				triples.flushManagers();// charnik's addition (see flushManagers() method for details)
     2.8 +//				triples.flushManagers();// charnik's addition (see flushManagers() method for details)
     2.9  				TripleTable predicate = triples.getPredicateTable(pred);
    2.10  				Number key = pred;
    2.11  				if (predicate.isPredColumnPresent()) {
     3.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Fri Mar 16 00:55:27 2012 +0100
     3.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Fri Mar 16 13:56:41 2012 +0200
     3.3 @@ -1127,15 +1127,17 @@
     3.4  			
     3.5  			filter.appendComma();
     3.6  
     3.7 -			if(expr.getRightArg() instanceof GeneralDBURIColumn) //case met in transform!
     3.8 +			if(expr.getRightArg() instanceof GeneralDBSqlCase) //case met in transform!
     3.9  			{
    3.10 +				GeneralDBURIColumn plainURI = (GeneralDBURIColumn)((GeneralDBSqlCase)expr.getRightArg()).getEntries().get(0).getResult();
    3.11 +				
    3.12  				//XXX This case would be met if we recovered the SRID URI from the db!!!
    3.13  				//Need to set sridExpr to the value of this new URI, otherwise the appended uri
    3.14  				//to the spatial object will be the wrong one!!!! (Seee following case)
    3.15  				filter.keepSRID_part1();
    3.16 -				append(((GeneralDBURIColumn)expr.getRightArg()), filter);
    3.17 +				append(plainURI, filter);
    3.18  				filter.keepSRID_part2();
    3.19 -				append(((GeneralDBURIColumn)expr.getRightArg()), filter);
    3.20 +				append(plainURI, filter);
    3.21  				filter.keepSRID_part3();
    3.22  			}
    3.23  			else if(expr.getRightArg() instanceof GeneralDBStringValue)