Strabon

changeset 1114:bba55f126513

some cleanup; ST_MakeLine works for geometries that are binded at query time, but not for constant geometries given in the select clause of the query (see bug #43)
author Babis Nikolaou <charnik@di.uoa.gr>
date Sat Apr 27 13:26:55 2013 +0300 (2013-04-27)
parents a3b6378fa394
children c69d609a5921
files evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/SpatialConstructFunc.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlGeoDifference.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/base/GeneralDBExprSupport.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBNumericExprFactory.java postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISEvaluation.java postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISEvaluationFactory.java postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISSqlBracketBuilder.java postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISSqlCastBuilder.java postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISSqlExprBuilder.java
line diff
     1.1 --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/SpatialConstructFunc.java	Sat Apr 27 12:32:51 2013 +0300
     1.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/SpatialConstructFunc.java	Sat Apr 27 13:26:55 2013 +0300
     1.3 @@ -3,7 +3,7 @@
     1.4   * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.5   * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.6   * 
     1.7 - * Copyright (C) 2010, 2011, 2012, Pyravlos Team
     1.8 + * Copyright (C) 2010, 2011, 2012, 2013 Pyravlos Team
     1.9   * 
    1.10   * http://www.strabon.di.uoa.gr/
    1.11   */
    1.12 @@ -20,6 +20,7 @@
    1.13   * 
    1.14   * @see package {@link org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct}
    1.15   *      and		{@link org.openrdf.query.algebra.evaluation.function.spatial.stsparql.aggregage}
    1.16 + *      and     {@link org.openrdf.query.algebra.evaluation.function.spatial.postgis.construct}
    1.17   * 
    1.18   * @author Manos Karpathiotakis <mk@di.uoa.gr>
    1.19   * @author Charalampos Nikolaou <charnik@di.uoa.gr>
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlGeoDifference.java	Sat Apr 27 12:32:51 2013 +0300
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBSqlGeoDifference.java	Sat Apr 27 13:26:55 2013 +0300
     2.3 @@ -3,7 +3,7 @@
     2.4   * License, v. 2.0. If a copy of the MPL was not distributed with this
     2.5   * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     2.6   * 
     2.7 - * Copyright (C) 2012, 2013, Pyravlos Team
     2.8 + * Copyright (C) 2010, 2011, 2012, 2013 Pyravlos Team
     2.9   * 
    2.10   * http://www.strabon.di.uoa.gr/
    2.11   */
    2.12 @@ -13,7 +13,7 @@
    2.13  import org.openrdf.sail.generaldb.algebra.base.GeneralDBQueryModelVisitorBase;
    2.14  import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr;
    2.15  
    2.16 -public class GeneralDBSqlGeoDifference extends GeneralDBSqlSpatialConstructBinary{
    2.17 +public class GeneralDBSqlGeoDifference extends GeneralDBSqlSpatialConstructBinary {
    2.18  
    2.19  	public GeneralDBSqlGeoDifference(GeneralDBSqlExpr left, GeneralDBSqlExpr right) {
    2.20  		super(left, right);
     3.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/base/GeneralDBExprSupport.java	Sat Apr 27 12:32:51 2013 +0300
     3.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/base/GeneralDBExprSupport.java	Sat Apr 27 13:26:55 2013 +0300
     3.3 @@ -414,12 +414,10 @@
     3.4  	 * @author George Garbis <ggarbis@di.uoa.gr>
     3.5  	 * 
     3.6  	 */
     3.7 -
     3.8  	public static GeneralDBSqlExpr diffDateTime(GeneralDBSqlExpr left, GeneralDBSqlExpr right) {
     3.9  
    3.10  		return new GeneralDBSqlDiffDateTime(left, right);
    3.11  	}
    3.12 -	
    3.13  	/***/
    3.14  	
    3.15  	//XXX Spatial Metric Functions
     4.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBNumericExprFactory.java	Sat Apr 27 12:32:51 2013 +0300
     4.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBNumericExprFactory.java	Sat Apr 27 13:26:55 2013 +0300
     4.3 @@ -577,22 +577,19 @@
     4.4  		return null;
     4.5  	}
     4.6  
     4.7 -	protected GeneralDBSqlExpr label(ValueExpr arg)
     4.8 -			throws UnsupportedRdbmsOperatorException
     4.9 -			{
    4.10 +	protected GeneralDBSqlExpr label(ValueExpr arg) throws UnsupportedRdbmsOperatorException
    4.11 +	{
    4.12  		return labelsPeek.createLabelExpr(arg);
    4.13 -			}
    4.14 +	}
    4.15  
    4.16 -	protected GeneralDBSqlExpr uri(ValueExpr arg)
    4.17 -			throws UnsupportedRdbmsOperatorException
    4.18 -			{
    4.19 +	protected GeneralDBSqlExpr uri(ValueExpr arg) throws UnsupportedRdbmsOperatorException
    4.20 +	{
    4.21  		return urisPeek.createUriExpr(arg);
    4.22 -			}
    4.23 +	}
    4.24  
    4.25  	//	protected GeneralDBSqlExpr numeric(ValueExpr arg)
    4.26  	//	throws UnsupportedRdbmsOperatorException
    4.27  	//	{
    4.28  	//		return sql.createNumericExpr(arg);
    4.29  	//	}
    4.30 -
    4.31  }
    4.32 \ No newline at end of file
     5.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISEvaluation.java	Sat Apr 27 12:32:51 2013 +0300
     5.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISEvaluation.java	Sat Apr 27 13:26:55 2013 +0300
     5.3 @@ -1,7 +1,11 @@
     5.4 -/*
     5.5 - * Copyright Aduna (http://www.aduna-software.com/) (c) 2008.
     5.6 - *
     5.7 - * Licensed under the Aduna BSD-style license.
     5.8 +/**
     5.9 + * This Source Code Form is subject to the terms of the Mozilla Public
    5.10 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    5.11 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    5.12 + * 
    5.13 + * Copyright (C) 2010, 2011, 2012, 2013 Pyravlos Team
    5.14 + * 
    5.15 + * http://www.strabon.di.uoa.gr/
    5.16   */
    5.17  package org.openrdf.sail.postgis.evaluation;
    5.18  
    5.19 @@ -36,7 +40,7 @@
    5.20   * Extends the default strategy by accepting {@link GeneralDBSelectQuery} and evaluating
    5.21   * them on a database.
    5.22   * 
    5.23 - * @author James Leigh
    5.24 + * @author Manos Karpathiotakis <mk@di.uoa.gr>
    5.25   * 
    5.26   */
    5.27  public class PostGISEvaluation extends GeneralDBEvaluation {
     6.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISEvaluationFactory.java	Sat Apr 27 12:32:51 2013 +0300
     6.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISEvaluationFactory.java	Sat Apr 27 13:26:55 2013 +0300
     6.3 @@ -1,3 +1,12 @@
     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, 2013 Pyravlos Team
    6.10 + * 
    6.11 + * http://www.strabon.di.uoa.gr/
    6.12 + */
    6.13  package org.openrdf.sail.postgis.evaluation;
    6.14  
    6.15  import org.openrdf.query.Dataset;
     7.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Sat Apr 27 12:32:51 2013 +0300
     7.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Sat Apr 27 13:26:55 2013 +0300
     7.3 @@ -1,7 +1,11 @@
     7.4 -/*
     7.5 - * Copyright Aduna (http://www.aduna-software.com/) (c) 2008.
     7.6 - *
     7.7 - * Licensed under the Aduna BSD-style license.
     7.8 +/**
     7.9 + * This Source Code Form is subject to the terms of the Mozilla Public
    7.10 + * License, v. 2.0. If a copy of the MPL was not distributed with this
    7.11 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7.12 + * 
    7.13 + * Copyright (C) 2010, 2011, 2012, 2013 Pyravlos Team
    7.14 + * 
    7.15 + * http://www.strabon.di.uoa.gr/
    7.16   */
    7.17  package org.openrdf.sail.postgis.evaluation;
    7.18  
    7.19 @@ -21,7 +25,6 @@
    7.20  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlBelow;
    7.21  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCase;
    7.22  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlContains;
    7.23 -import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbContains;
    7.24  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlCrosses;
    7.25  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlDiffDateTime;
    7.26  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlDisjoint;
    7.27 @@ -48,9 +51,10 @@
    7.28  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlIsNull;
    7.29  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlLeft;
    7.30  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMathExpr;
    7.31 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbContains;
    7.32  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbEquals;
    7.33 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbIntersects;
    7.34  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbWithin;
    7.35 -import org.openrdf.sail.generaldb.algebra.GeneralDBSqlMbbIntersects;
    7.36  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNot;
    7.37  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlNull;
    7.38  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlOverlaps;
    7.39 @@ -154,7 +158,6 @@
    7.40  		// Spatial Constructs - Binary (PostGIS namespace)
    7.41  		ST_MakeLine,
    7.42  
    7.43 -
    7.44  		//Spatial Constructs - Unary
    7.45  		ST_Envelope,
    7.46  		ST_ConvexHull,
    7.47 @@ -204,8 +207,7 @@
    7.48  		EH_Covers,
    7.49  		EH_CoveredBy,
    7.50  		EH_Inside,
    7.51 -		EH_Contains,
    7.52 -		; 
    7.53 +		EH_Contains
    7.54  	}
    7.55  
    7.56  	/** Addition for datetime metric functions
    7.57 @@ -231,17 +233,15 @@
    7.58  	}
    7.59  
    7.60  	@Override
    7.61 -	protected void append(GeneralDBSqlIsNull expr, GeneralDBSqlExprBuilder filter)
    7.62 -			throws UnsupportedRdbmsOperatorException
    7.63 -			{
    7.64 +	protected void append(GeneralDBSqlIsNull expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException
    7.65 +	{
    7.66  		dispatch(expr.getArg(), filter);
    7.67  		filter.isNull();
    7.68 -			}
    7.69 +	}
    7.70  
    7.71  	@Override
    7.72 -	protected void append(GeneralDBSqlNot expr, GeneralDBSqlExprBuilder filter)
    7.73 -			throws UnsupportedRdbmsOperatorException
    7.74 -			{
    7.75 +	protected void append(GeneralDBSqlNot expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException
    7.76 +	{
    7.77  		if (expr.getArg() instanceof GeneralDBSqlIsNull) {
    7.78  			GeneralDBSqlIsNull arg = (GeneralDBSqlIsNull)expr.getArg();
    7.79  			dispatch(arg.getArg(), filter);
    7.80 @@ -252,7 +252,7 @@
    7.81  			dispatch(expr.getArg(), (GeneralDBSqlExprBuilder) open);
    7.82  			open.close();
    7.83  		}
    7.84 -			}
    7.85 +	}
    7.86  
    7.87  	@Override
    7.88  	protected void append(GeneralDBDateTimeColumn var, GeneralDBSqlExprBuilder filter) {
    7.89 @@ -741,22 +741,19 @@
    7.90  			}
    7.91  
    7.92  	@Override
    7.93 -	protected void append(GeneralDBSqlGeoIntersection expr, GeneralDBSqlExprBuilder filter)
    7.94 -			throws UnsupportedRdbmsOperatorException
    7.95 -			{
    7.96 +	protected void append(GeneralDBSqlGeoIntersection expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException
    7.97 +	{
    7.98  		appendGeneralDBSpatialFunctionBinary(expr, filter, SpatialFunctionsPostGIS.ST_Intersection);
    7.99 -			}
   7.100 +	}
   7.101  
   7.102  	@Override
   7.103 -	protected void append(GeneralDBSqlGeoDifference expr, GeneralDBSqlExprBuilder filter)
   7.104 -			throws UnsupportedRdbmsOperatorException
   7.105 -			{
   7.106 +	protected void append(GeneralDBSqlGeoDifference expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException
   7.107 +	{
   7.108  		appendGeneralDBSpatialFunctionBinary(expr, filter, SpatialFunctionsPostGIS.ST_Difference);
   7.109 -			}
   7.110 +	}
   7.111  
   7.112  	@Override
   7.113 -	protected void append(GeneralDBSqlGeoSymDifference expr, GeneralDBSqlExprBuilder filter)
   7.114 -	throws UnsupportedRdbmsOperatorException
   7.115 +	protected void append(GeneralDBSqlGeoSymDifference expr, GeneralDBSqlExprBuilder filter) throws UnsupportedRdbmsOperatorException
   7.116  	{
   7.117  		appendGeneralDBSpatialFunctionBinary(expr, filter, SpatialFunctionsPostGIS.ST_SymDifference);
   7.118  	}
     8.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISSqlBracketBuilder.java	Sat Apr 27 12:32:51 2013 +0300
     8.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISSqlBracketBuilder.java	Sat Apr 27 13:26:55 2013 +0300
     8.3 @@ -1,3 +1,12 @@
     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, 2013 Pyravlos Team
    8.10 + * 
    8.11 + * http://www.strabon.di.uoa.gr/
    8.12 + */
    8.13  package org.openrdf.sail.postgis.evaluation;
    8.14  
    8.15  import org.openrdf.sail.generaldb.evaluation.GeneralDBQueryBuilderFactory;
     9.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISSqlCastBuilder.java	Sat Apr 27 12:32:51 2013 +0300
     9.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISSqlCastBuilder.java	Sat Apr 27 13:26:55 2013 +0300
     9.3 @@ -1,3 +1,12 @@
     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, 2013 Pyravlos Team
    9.10 + * 
    9.11 + * http://www.strabon.di.uoa.gr/
    9.12 + */
    9.13  package org.openrdf.sail.postgis.evaluation;
    9.14  
    9.15  import java.sql.Types;
    10.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISSqlExprBuilder.java	Sat Apr 27 12:32:51 2013 +0300
    10.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISSqlExprBuilder.java	Sat Apr 27 13:26:55 2013 +0300
    10.3 @@ -5,8 +5,6 @@
    10.4   */
    10.5  package org.openrdf.sail.postgis.evaluation;
    10.6  
    10.7 -import java.math.BigDecimal;
    10.8 -
    10.9  import org.openrdf.sail.generaldb.evaluation.GeneralDBQueryBuilderFactory;
   10.10  import org.openrdf.sail.generaldb.evaluation.GeneralDBSqlExprBuilder;
   10.11