Strabon

changeset 1059:b903c47cc189

added implementation of geof:buffer (same as strdf:buffer)
author Stella Giannakopoulou <sgian@di.uoa.gr>
date Mon Apr 22 13:26:52 2013 +0300 (2013-04-22)
parents 1382b01c2060
children 7f8023f3b97e c2e43cb108d9
files generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBNumericExprFactory.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java	Mon Apr 22 03:07:11 2013 +0300
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java	Mon Apr 22 13:26:52 2013 +0300
     1.3 @@ -119,6 +119,7 @@
     1.4  import org.openrdf.query.algebra.evaluation.function.spatial.SpatialRelationshipFunc;
     1.5  import org.openrdf.query.algebra.evaluation.function.spatial.geosparql.GeoSparqlRelateFunc;
     1.6  import org.openrdf.query.algebra.evaluation.function.spatial.geosparql.nontopological.GeoSparqlBoundaryFunc;
     1.7 +import org.openrdf.query.algebra.evaluation.function.spatial.geosparql.nontopological.GeoSparqlBufferFunc;
     1.8  import org.openrdf.query.algebra.evaluation.function.spatial.geosparql.nontopological.GeoSparqlConvexHullFunc;
     1.9  import org.openrdf.query.algebra.evaluation.function.spatial.geosparql.nontopological.GeoSparqlEnvelopeFunc;
    1.10  import org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.BoundaryFunc;
    1.11 @@ -877,7 +878,7 @@
    1.12  			}
    1.13  			else
    1.14  			{
    1.15 -				if(function.getURI().equals(GeoConstants.stSPARQLbuffer))
    1.16 +				if(function.getURI().equals(GeoConstants.stSPARQLbuffer) || function.getURI().equals(GeoConstants.geoSparqlBuffer))
    1.17  				{
    1.18  					//Be it a Var or a Value Constant, 'numeric' is the way to go
    1.19  					rightArg = numeric(right);
    1.20 @@ -894,7 +895,7 @@
    1.21  					rightArg = label(right);
    1.22  				}
    1.23  			}
    1.24 -			if(function instanceof BufferFunc)
    1.25 +			if(function instanceof BufferFunc || function instanceof GeoSparqlBufferFunc)
    1.26  				thirdArg = uri(functionCall.getArgs().get(2));
    1.27  		}
    1.28  
    1.29 @@ -995,8 +996,7 @@
    1.30  
    1.31  	}
    1.32  
    1.33 -	GeneralDBSqlExpr spatialRelationshipPicker(Function function,GeneralDBSqlExpr leftArg, GeneralDBSqlExpr rightArg, 
    1.34 -			GeneralDBSqlExpr thirdArg)
    1.35 +	GeneralDBSqlExpr spatialRelationshipPicker(Function function,GeneralDBSqlExpr leftArg, GeneralDBSqlExpr rightArg, GeneralDBSqlExpr thirdArg)
    1.36  	{
    1.37  		//XXX stSPARQL		
    1.38  		if(function.getURI().equals(GeoConstants.stSPARQLequals))
    1.39 @@ -1103,6 +1103,7 @@
    1.40  		{
    1.41  			return sfWithin(leftArg,rightArg);
    1.42  		}
    1.43 +		
    1.44  		//RCC8
    1.45  		else if(function.getURI().equals(GeoConstants.rccDisconnected))
    1.46  		{
    1.47 @@ -1247,6 +1248,10 @@
    1.48  		{
    1.49  			return geoBoundary(leftArg);
    1.50  		}
    1.51 +		else if(function.getURI().equals(GeoConstants.geoSparqlBuffer))
    1.52 +		{
    1.53 +			return geoBuffer(leftArg, rightArg, thirdArg);
    1.54 +		}
    1.55  
    1.56  		logger.error("[Strabon.spatialConstructPicker] No appropriate SQL expression was generated for extension function {}. This is probably a bug.", function.getURI());
    1.57  		return null;
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBNumericExprFactory.java	Mon Apr 22 03:07:11 2013 +0300
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBNumericExprFactory.java	Mon Apr 22 13:26:52 2013 +0300
     2.3 @@ -501,6 +501,10 @@
     2.4  		{
     2.5  			return geoBoundary(leftArg);
     2.6  		}
     2.7 +		else if(function.getURI().equals(GeoConstants.geoSparqlBuffer))
     2.8 +		{
     2.9 +			return geoBuffer(leftArg,rightArg, thirdArg);
    2.10 +		}
    2.11  		//Should never reach this place
    2.12  		return null;
    2.13  	}