Strabon

changeset 1343:12c3bba2c8a5

solve Bug #34
author Dimitrianos Savva <dimis.savva@gmail.com>
date Fri Jun 27 17:11:18 2014 +0300 (2014-06-27)
parents 8a4441fb946e
children 168b89aaa51b
files generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlDisjoint.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlEqualsSpatial.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlIntersects.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/rcc8/GeneralDBSqlRCC8_Dc.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/sf/GeneralDBSqlSF_Intersects.java generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBEvaluation.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/algebra/GeneralDBSqlDisjoint.java	Tue May 27 11:56:46 2014 +0300
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlDisjoint.java	Fri Jun 27 17:11:18 2014 +0300
     1.3 @@ -6,8 +6,6 @@
     1.4  package org.openrdf.sail.generaldb.algebra;
     1.5  
     1.6   
     1.7 -import org.openrdf.sail.generaldb.algebra.base.BinaryGeneralDBOperator; 
     1.8 -import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase;
     1.9  import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr;
    1.10  
    1.11  public class GeneralDBSqlDisjoint extends GeneralDBSqlGeoSpatial{
    1.12 @@ -15,6 +13,4 @@
    1.13  	public GeneralDBSqlDisjoint(GeneralDBSqlExpr left, GeneralDBSqlExpr right) {
    1.14  		super(left, right);
    1.15  	}
    1.16 -
    1.17 - 
    1.18  }
    1.19 \ No newline at end of file
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlEqualsSpatial.java	Tue May 27 11:56:46 2014 +0300
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlEqualsSpatial.java	Fri Jun 27 17:11:18 2014 +0300
     2.3 @@ -6,8 +6,6 @@
     2.4  package org.openrdf.sail.generaldb.algebra;
     2.5  
     2.6   
     2.7 -import org.openrdf.sail.generaldb.algebra.base.BinaryGeneralDBOperator; 
     2.8 -import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase;
     2.9  import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr;
    2.10  
    2.11  public class GeneralDBSqlEqualsSpatial extends GeneralDBSqlGeoSpatial{
    2.12 @@ -15,6 +13,4 @@
    2.13  	public GeneralDBSqlEqualsSpatial(GeneralDBSqlExpr left, GeneralDBSqlExpr right) {
    2.14  		super(left, right);
    2.15  	}
    2.16 -
    2.17 -
    2.18  }
    2.19 \ No newline at end of file
     3.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlIntersects.java	Tue May 27 11:56:46 2014 +0300
     3.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlIntersects.java	Fri Jun 27 17:11:18 2014 +0300
     3.3 @@ -6,8 +6,6 @@
     3.4  package org.openrdf.sail.generaldb.algebra;
     3.5  
     3.6   
     3.7 -import org.openrdf.sail.generaldb.algebra.base.BinaryGeneralDBOperator; 
     3.8 -import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase;
     3.9  import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr;
    3.10  
    3.11  public class GeneralDBSqlIntersects extends GeneralDBSqlGeoSpatial{
     4.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/rcc8/GeneralDBSqlRCC8_Dc.java	Tue May 27 11:56:46 2014 +0300
     4.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/rcc8/GeneralDBSqlRCC8_Dc.java	Fri Jun 27 17:11:18 2014 +0300
     4.3 @@ -7,8 +7,6 @@
     4.4  
     4.5   
     4.6  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoSpatial;
     4.7 -import org.openrdf.sail.generaldb.algebra.base.BinaryGeneralDBOperator; 
     4.8 -import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase;
     4.9  import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr;
    4.10  
    4.11  public class GeneralDBSqlRCC8_Dc extends GeneralDBSqlGeoSpatial{
     5.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/sf/GeneralDBSqlSF_Intersects.java	Tue May 27 11:56:46 2014 +0300
     5.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/sf/GeneralDBSqlSF_Intersects.java	Fri Jun 27 17:11:18 2014 +0300
     5.3 @@ -7,8 +7,6 @@
     5.4  
     5.5   
     5.6  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoSpatial;
     5.7 -import org.openrdf.sail.generaldb.algebra.base.BinaryGeneralDBOperator; 
     5.8 -import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase;
     5.9  import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr;
    5.10  
    5.11  public class GeneralDBSqlSF_Intersects extends GeneralDBSqlGeoSpatial{
     6.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBEvaluation.java	Tue May 27 11:56:46 2014 +0300
     6.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBEvaluation.java	Fri Jun 27 17:11:18 2014 +0300
     6.3 @@ -84,6 +84,7 @@
     6.4  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoGeometryType;
     6.5  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoIsEmpty;
     6.6  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoIsSimple;
     6.7 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoSpatial;
     6.8  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoSrid;
     6.9  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlIsNull;
    6.10  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMathExpr;
    6.11 @@ -118,6 +119,7 @@
    6.12   * them on a database.
    6.13   * 
    6.14   * @author Manos Karpathiotakis <mk@di.uoa.gr>
    6.15 + * @author Dimitrianos Savva <dimis@di.uoa.gr>
    6.16   */
    6.17  public abstract class GeneralDBEvaluation extends EvaluationStrategyImpl {
    6.18  
    6.19 @@ -938,6 +940,11 @@
    6.20  			locateColumnVars(((GeneralDBSqlMathExpr)expr).getLeftArg(),allKnown);
    6.21  			locateColumnVars(((GeneralDBSqlMathExpr)expr).getRightArg(),allKnown);
    6.22  		}
    6.23 +		else if(expr instanceof GeneralDBSqlGeoSpatial)
    6.24 +		{
    6.25 +			locateColumnVars(((GeneralDBSqlGeoSpatial)expr).getLeftArg(),allKnown); 
    6.26 +			locateColumnVars(((GeneralDBSqlGeoSpatial)expr).getRightArg(),allKnown);
    6.27 +		}
    6.28  		else
    6.29  		{
    6.30  			//must recurse
    6.31 @@ -964,6 +971,7 @@
    6.32  			}
    6.33  
    6.34  		}
    6.35 +		
    6.36  
    6.37  		//return allVars;
    6.38  	}
    6.39 @@ -1036,6 +1044,11 @@
    6.40  		{
    6.41  			return ResultType.DOUBLE;
    6.42  		}
    6.43 +		else if(expr instanceof GeneralDBSqlGeoSpatial)
    6.44 +		{
    6.45 +			return ResultType.BOOLEAN;
    6.46 +		}
    6.47 +		
    6.48  		return ResultType.NULL;//SHOULD NEVER REACH THIS CASE
    6.49  	}
    6.50  }
     7.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Tue May 27 11:56:46 2014 +0300
     7.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Fri Jun 27 17:11:18 2014 +0300
     7.3 @@ -3,7 +3,7 @@
     7.4   * License, v. 2.0. If a copy of the MPL was not distributed with this
     7.5   * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     7.6   * 
     7.7 - * Copyright (C) 2010, 2011, 2012, 2013 Pyravlos Team
     7.8 + * Copyright (C) 2010, 2011, 2012, 2013, 2014 Pyravlos Team
     7.9   * 
    7.10   * http://www.strabon.di.uoa.gr/
    7.11   */
    7.12 @@ -44,6 +44,7 @@
    7.13  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoIntersection;
    7.14  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoIsEmpty;
    7.15  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoIsSimple;
    7.16 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoSpatial;
    7.17  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoSrid;
    7.18  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoSymDifference;
    7.19  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoTransform;
    7.20 @@ -119,7 +120,7 @@
    7.21   * Constructs an SQL query from {@link GeneralDBSqlExpr}s and {@link GeneralDBFromItem}s.
    7.22   * 
    7.23   * @author Manos Karpathiotakis <mk@di.uoa.gr>
    7.24 - * 
    7.25 + * @author Dimitrianos Savva <dimis@di.uoa.gr>
    7.26   */
    7.27  public class PostGISQueryBuilder extends GeneralDBQueryBuilder {
    7.28  
    7.29 @@ -359,7 +360,8 @@
    7.30  				&&!(expr instanceof GeneralDBSqlSpatialMetricTriple)
    7.31  				&&!(expr instanceof GeneralDBSqlSpatialMetricUnary)
    7.32  				&&!(expr instanceof GeneralDBSqlMathExpr)
    7.33 -				&&!(expr instanceof GeneralDBSqlSpatialProperty))
    7.34 +				&&!(expr instanceof GeneralDBSqlSpatialProperty)
    7.35 +				&& !(expr instanceof GeneralDBSqlGeoSpatial))
    7.36  		{
    7.37  			query.select().appendFunction(ST_ASBINARY);
    7.38  		}