Strabon

changeset 1064:2e32beaa5a09

Merge.
author Panayiotis Smeros <psmeros@di.uoa.gr>
date Mon Apr 22 15:54:55 2013 +0300 (2013-04-22)
parents 94cac9923a49 7368a5899fc1
children 82a91860d76d
files
line diff
     1.1 --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/geosparql/GeoSparqlNonTopologicalMetric.java	Mon Apr 22 15:47:44 2013 +0300
     1.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/geosparql/GeoSparqlNonTopologicalMetric.java	Mon Apr 22 15:54:55 2013 +0300
     1.3 @@ -12,7 +12,7 @@
     1.4  import org.openrdf.model.Value;
     1.5  import org.openrdf.model.ValueFactory;
     1.6  import org.openrdf.query.algebra.evaluation.ValueExprEvaluationException;
     1.7 -import org.openrdf.query.algebra.evaluation.function.spatial.SpatialConstructFunc;
     1.8 +import org.openrdf.query.algebra.evaluation.function.spatial.SpatialMetricFunc;
     1.9  
    1.10  /**
    1.11   * This class represents a spatial function like the one defined in its superclass 
    1.12 @@ -23,7 +23,7 @@
    1.13   * @author Manos Karpathiotakis <mk@di.uoa.gr>
    1.14   * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    1.15   */
    1.16 -public abstract class GeoSparqlNonTopologicalMetric extends SpatialConstructFunc {
    1.17 +public abstract class GeoSparqlNonTopologicalMetric extends SpatialMetricFunc {
    1.18  
    1.19  	//No need for any implementation, I will have replaced this class's presence before reaching this place
    1.20  	public Value evaluate(ValueFactory valueFactory, Value... args)
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java	Mon Apr 22 15:47:44 2013 +0300
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java	Mon Apr 22 15:54:55 2013 +0300
     2.3 @@ -1218,8 +1218,7 @@
     2.4  		{
     2.5  			return geoSymDifference(leftArg, rightArg);
     2.6  		}
     2.7 -		//XXX GeoSPARQL - Non topological - except distance
     2.8 -		//TODO Must add buffer after deciding how to implement it
     2.9 +		//XXX GeoSPARQL - Non topological - except distance		
    2.10  		else if(function.getURI().equals(GeoConstants.geoSparqlConvexHull))
    2.11  		{
    2.12  			return geoConvexHull(leftArg);
    2.13 @@ -1280,11 +1279,14 @@
    2.14  		{
    2.15  			return geoDistance(leftArg, rightArg, thirdArg);
    2.16  		}
    2.17 +		else if(function.getURI().equals(GeoConstants.geoSparqlDistance))
    2.18 +		{
    2.19 +			return geoDistance(leftArg, rightArg, thirdArg);
    2.20 +		}	
    2.21  		else if(function.getURI().equals(GeoConstants.stSPARQLarea))
    2.22  		{
    2.23  			return geoArea(leftArg);
    2.24 -		}
    2.25 -		//GeoSPARQL's distance must be added at this place
    2.26 +		}		
    2.27  
    2.28  		logger.error("[Strabon.spatialMetricPicker] No appropriate SQL expression was generated for extension function {}. This is probably a bug.", function.getURI());
    2.29  		return null;
     3.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBNumericExprFactory.java	Mon Apr 22 15:47:44 2013 +0300
     3.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBNumericExprFactory.java	Mon Apr 22 15:54:55 2013 +0300
     3.3 @@ -471,8 +471,7 @@
     3.4  		{
     3.5  			return geoSymDifference(leftArg, rightArg);
     3.6  		}
     3.7 -		//XXX GeoSPARQL - Non topological - except distance
     3.8 -		//TODO Must add buffer after deciding how to implement it
     3.9 +		//XXX GeoSPARQL - Non topological - except distance		
    3.10  		else if(function.getURI().equals(GeoConstants.geoSparqlConvexHull))
    3.11  		{
    3.12  			return geoConvexHull(leftArg);
    3.13 @@ -534,11 +533,14 @@
    3.14  		{
    3.15  			return geoDistance(leftArg, rightArg, thirdArg);
    3.16  		}
    3.17 +		else if(function.getURI().equals(GeoConstants.geoSparqlDistance))
    3.18 +		{
    3.19 +			return geoDistance(leftArg, rightArg, thirdArg);
    3.20 +		}
    3.21  		else if(function.getURI().equals(GeoConstants.stSPARQLarea))
    3.22  		{
    3.23  			return geoArea(leftArg);
    3.24 -		}
    3.25 -		//GeoSPARQL's distance must be added at this place
    3.26 +		}		
    3.27  
    3.28  		//Should never reach this place
    3.29  		return null;
     4.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Mon Apr 22 15:47:44 2013 +0300
     4.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Mon Apr 22 15:54:55 2013 +0300
     4.3 @@ -1782,6 +1782,10 @@
     4.4  			{
     4.5  				appendMetricFunction(expr.getRightArg(), filter);
     4.6  			}
     4.7 +			else if(expr.getRightArg() instanceof GeneralDBSqlSpatialMetricTriple)
     4.8 +			{
     4.9 +				appendMetricFunction(expr.getRightArg(), filter);
    4.10 +			}
    4.11  			else
    4.12  			{
    4.13  				appendMBB((GeneralDBLabelColumn)(expr.getRightArg()),filter);
    4.14 @@ -1989,6 +1993,10 @@
    4.15  			{
    4.16  				appendConstructFunction(expr.getRightArg(), filter);
    4.17  			}
    4.18 +			else if(expr.getRightArg() instanceof GeneralDBSqlSpatialConstructTriple)
    4.19 +			{
    4.20 +				appendConstructFunction(expr.getRightArg(), filter);
    4.21 +			}
    4.22  			else if(expr.getRightArg() instanceof GeneralDBSqlCase)
    4.23  			{
    4.24  				GeneralDBLabelColumn onlyLabel = (GeneralDBLabelColumn)((GeneralDBSqlCase)expr.getRightArg()).getEntries().get(0).getResult();
    4.25 @@ -2303,6 +2311,10 @@
    4.26  			{
    4.27  				appendMetricFunction(expr.getRightArg(), filter);
    4.28  			}
    4.29 +			else if(expr.getRightArg() instanceof GeneralDBSqlSpatialMetricTriple)
    4.30 +			{
    4.31 +				appendMetricFunction(expr.getRightArg(), filter);
    4.32 +			}
    4.33  			else
    4.34  			{
    4.35  				appendMBB((GeneralDBLabelColumn)(expr.getRightArg()),filter);
    4.36 @@ -2437,6 +2449,10 @@
    4.37  			{
    4.38  				appendMetricFunction(expr.getRightArg(), filter);
    4.39  			}
    4.40 +			else if(expr.getRightArg() instanceof GeneralDBSqlSpatialMetricTriple)
    4.41 +			{
    4.42 +				appendMetricFunction(expr.getRightArg(), filter);
    4.43 +			}
    4.44  			else
    4.45  			{
    4.46  				appendMBB((GeneralDBLabelColumn)(expr.getRightArg()),filter);
    4.47 @@ -2921,6 +2937,10 @@
    4.48  				{
    4.49  					appendMetricFunction(expr.getRightArg(), filter);
    4.50  				}
    4.51 +				else if(expr.getRightArg() instanceof GeneralDBSqlSpatialMetricTriple)
    4.52 +				{
    4.53 +					appendMetricFunction(expr.getRightArg(), filter);
    4.54 +				}
    4.55  				else
    4.56  				{
    4.57  					appendMBB((GeneralDBLabelColumn)(expr.getRightArg()),filter);