Strabon

changeset 988:3e3bf4aaa021

added support for geof:getSRID. Addresses bug #32. Notice that this implementation is the same as strdf:srid.
author Babis Nikolaou <charnik@di.uoa.gr>
date Fri Apr 05 18:41:16 2013 +0300 (2013-04-05)
parents f6cf896c4422
children ee4984f7a3ca
files constants/src/main/java/eu/earthobservatory/constants/GeoConstants.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/SpatialPropertyFunc.java evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/geosparql/property/GeoSparqlGetSRIDFunc.java evaluation/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/base/GeneralDBExprSupport.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java
line diff
     1.1 --- a/constants/src/main/java/eu/earthobservatory/constants/GeoConstants.java	Fri Apr 05 18:02:22 2013 +0300
     1.2 +++ b/constants/src/main/java/eu/earthobservatory/constants/GeoConstants.java	Fri Apr 05 18:41:16 2013 +0300
     1.3 @@ -247,6 +247,7 @@
     1.4  	public static final String geoSparqlSymmetricDifference 	= GEOF + "symDifference";
     1.5  	public static final String geoSparqlEnvelope 				= GEOF + "envelope";
     1.6  	public static final String geoSparqlBoundary 				= GEOF + "boundary";
     1.7 +	public static final String geoSparqlGetSRID				= GEOF + "getSRID";
     1.8  
     1.9  	// Simple Features - 8 functions - all with 2 arguments + boolean
    1.10  	public static final String sfEquals 						= GEOF + "sfEquals";
     2.1 --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/SpatialPropertyFunc.java	Fri Apr 05 18:02:22 2013 +0300
     2.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/SpatialPropertyFunc.java	Fri Apr 05 18:41:16 2013 +0300
     2.3 @@ -20,6 +20,7 @@
     2.4   * and so on), its type (Polygon, Point, etc.), SRID, etc.
     2.5   * 
     2.6   * @see package {@link org.openrdf.query.algebra.evaluation.function.spatial.stsparql.property}
     2.7 + * @see package {@link org.openrdf.query.algebra.evaluation.function.spatial.geosparql.property}
     2.8   * 
     2.9   * @author Manos Karpathiotakis <mk@di.uoa.gr>
    2.10   * @author Charalampos Nikolaou <charnik@di.uoa.gr>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/spatial/geosparql/property/GeoSparqlGetSRIDFunc.java	Fri Apr 05 18:41:16 2013 +0300
     3.3 @@ -0,0 +1,29 @@
     3.4 +/**
     3.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     3.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     3.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     3.8 + * 
     3.9 + * Copyright (C) 2012, Pyravlos Team
    3.10 + * 
    3.11 + * http://www.strabon.di.uoa.gr/
    3.12 + */
    3.13 +package org.openrdf.query.algebra.evaluation.function.spatial.geosparql.property;
    3.14 +
    3.15 +import org.openrdf.query.algebra.evaluation.function.spatial.SpatialPropertyFunc;
    3.16 +
    3.17 +import eu.earthobservatory.constants.GeoConstants;
    3.18 +
    3.19 +/**
    3.20 + * Implementation of the <code>geof:getSRID(geom: ogc:geomLiteral): xsd:anyURI</code> 
    3.21 + * function of GeoSPARQL.
    3.22 + * 
    3.23 + * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    3.24 + *
    3.25 + */
    3.26 +public class GeoSparqlGetSRIDFunc extends SpatialPropertyFunc {
    3.27 +
    3.28 +	@Override
    3.29 +	public String getURI() {
    3.30 +		return GeoConstants.geoSparqlGetSRID;
    3.31 +	}
    3.32 +}
     4.1 --- a/evaluation/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function	Fri Apr 05 18:02:22 2013 +0300
     4.2 +++ b/evaluation/src/main/resources/META-INF/services/org.openrdf.query.algebra.evaluation.function.Function	Fri Apr 05 18:41:16 2013 +0300
     4.3 @@ -33,8 +33,8 @@
     4.4  org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.EnvelopeFunc
     4.5  org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.ConvexHullFunc
     4.6  org.openrdf.query.algebra.evaluation.function.spatial.stsparql.construct.BoundaryFunc
     4.7 +org.openrdf.query.algebra.evaluation.function.spatial.stsparql.metric.AreaFunc
     4.8  org.openrdf.query.algebra.evaluation.function.spatial.stsparql.metric.DistanceFunc
     4.9 -org.openrdf.query.algebra.evaluation.function.spatial.stsparql.metric.AreaFunc
    4.10  org.openrdf.query.algebra.evaluation.function.spatial.stsparql.property.DimensionFunc
    4.11  org.openrdf.query.algebra.evaluation.function.spatial.stsparql.property.GeometryTypeFunc
    4.12  org.openrdf.query.algebra.evaluation.function.spatial.stsparql.property.AsTextFunc
    4.13 @@ -53,6 +53,7 @@
    4.14  org.openrdf.query.algebra.evaluation.function.spatial.geosparql.nontopological.GeoSparqlIntersectionFunc
    4.15  org.openrdf.query.algebra.evaluation.function.spatial.geosparql.nontopological.GeoSparqlSymmetricDifferenceFunc
    4.16  org.openrdf.query.algebra.evaluation.function.spatial.geosparql.nontopological.GeoSparqlUnionFunc
    4.17 +org.openrdf.query.algebra.evaluation.function.spatial.geosparql.property.GeoSparqlGetSRIDFunc
    4.18  org.openrdf.query.algebra.evaluation.function.spatial.geosparql.GeoSparqlRelateFunc
    4.19  org.openrdf.query.algebra.evaluation.function.spatial.geosparql.egenhofer.EgenhoferContainsFunc
    4.20  org.openrdf.query.algebra.evaluation.function.spatial.geosparql.egenhofer.EgenhoferCoveredByFunc
     5.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/base/GeneralDBExprSupport.java	Fri Apr 05 18:02:22 2013 +0300
     5.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/base/GeneralDBExprSupport.java	Fri Apr 05 18:41:16 2013 +0300
     5.3 @@ -91,9 +91,11 @@
     5.4  import org.openrdf.sail.generaldb.algebra.sf.GeneralDBSqlSF_Touches;
     5.5  import org.openrdf.sail.generaldb.algebra.sf.GeneralDBSqlSF_Within;
     5.6  import org.openrdf.sail.rdbms.exceptions.UnsupportedRdbmsOperatorException;
     5.7 +
     5.8  /**
     5.9   * Support method to create SQL expressions.
    5.10   * 
    5.11 + * @author Manos Karpathiotakis <mk@di.uoa.gr>
    5.12   * @author James Leigh
    5.13   * 
    5.14   */
    5.15 @@ -269,12 +271,6 @@
    5.16  		// no constructor
    5.17  	}
    5.18  
    5.19 -	/**
    5.20 -	 * my addition
    5.21 -	 * FIXME  
    5.22 -	 * 
    5.23 -	 */
    5.24 -
    5.25  	//XXX Spatial Relationship Functions - all 9 of them - stSPARQL++	
    5.26  	public static GeneralDBSqlExpr equalsGeo(GeneralDBSqlExpr left, GeneralDBSqlExpr right) {
    5.27  		return new GeneralDBSqlEqualsSpatial(left, right);
    5.28 @@ -419,7 +415,6 @@
    5.29  	
    5.30  	//XXX Spatial Metric Functions
    5.31  	public static GeneralDBSqlExpr geoArea(GeneralDBSqlExpr expr) {
    5.32 -
    5.33  		return new GeneralDBSqlGeoArea(expr);
    5.34  	}
    5.35  	
    5.36 @@ -429,17 +424,14 @@
    5.37  	
    5.38  	//XXX Spatial Property Functions
    5.39  	public static GeneralDBSqlExpr dimension(GeneralDBSqlExpr expr) {
    5.40 -
    5.41  		return new GeneralDBSqlGeoDimension(expr);
    5.42  	}
    5.43  
    5.44  	public static GeneralDBSqlExpr geometryType(GeneralDBSqlExpr expr) {
    5.45 -
    5.46  		return new GeneralDBSqlGeoGeometryType(expr);
    5.47  	}
    5.48  	
    5.49  	public static GeneralDBSqlExpr asText(GeneralDBSqlExpr expr) {
    5.50 -
    5.51  		return new GeneralDBSqlGeoAsText(expr);
    5.52  	}
    5.53  	
    5.54 @@ -448,23 +440,19 @@
    5.55  	}
    5.56  
    5.57  	public static GeneralDBSqlExpr srid(GeneralDBSqlExpr expr) {
    5.58 -
    5.59  		return new GeneralDBSqlGeoSrid(expr);
    5.60  	}
    5.61  	
    5.62  	public static GeneralDBSqlExpr isEmpty(GeneralDBSqlExpr expr) {
    5.63 -
    5.64  		return new GeneralDBSqlGeoIsEmpty(expr);
    5.65  	}
    5.66  
    5.67  	public static GeneralDBSqlExpr isSimple(GeneralDBSqlExpr expr) {
    5.68 -
    5.69  		return new GeneralDBSqlGeoIsSimple(expr);
    5.70  	}
    5.71  	
    5.72  
    5.73 -
    5.74 -	//XXX GeoSPARQL - Spatial Relations
    5.75 +	// GeoSPARQL - Spatial Relations
    5.76  	//Simple Features
    5.77  	public static GeneralDBSqlExpr sfContains(GeneralDBSqlExpr left, GeneralDBSqlExpr right) {
    5.78  		return new GeneralDBSqlSF_Contains(left, right);
    5.79 @@ -563,10 +551,4 @@
    5.80  	public static GeneralDBSqlExpr ehOverlap(GeneralDBSqlExpr left, GeneralDBSqlExpr right) {
    5.81  		return new GeneralDBSqlEgenhofer_Overlap(left, right);
    5.82  	}
    5.83 -
    5.84 -
    5.85 -	/**
    5.86 -	 * end of my addition
    5.87 -	 */
    5.88 -
    5.89  }
     6.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java	Fri Apr 05 18:02:22 2013 +0300
     6.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/factories/GeneralDBBooleanExprFactory.java	Fri Apr 05 18:41:16 2013 +0300
     6.3 @@ -135,6 +135,8 @@
     6.4  import org.openrdf.sail.generaldb.algebra.GeneralDBTrueValue;
     6.5  import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr;
     6.6  import org.openrdf.sail.rdbms.exceptions.UnsupportedRdbmsOperatorException;
     6.7 +import org.slf4j.Logger;
     6.8 +import org.slf4j.LoggerFactory;
     6.9  
    6.10  import eu.earthobservatory.constants.GeoConstants;
    6.11  
    6.12 @@ -147,6 +149,8 @@
    6.13   */
    6.14  public class GeneralDBBooleanExprFactory extends QueryModelVisitorBase<UnsupportedRdbmsOperatorException> {
    6.15  
    6.16 +	private static final Logger logger = LoggerFactory.getLogger(org.openrdf.sail.generaldb.algebra.factories.GeneralDBBooleanExprFactory.class);
    6.17 +	
    6.18  	private static final double HR14 = 14 * 60 * 60 * 1000;
    6.19  
    6.20  	protected GeneralDBSqlExpr result;
    6.21 @@ -260,7 +264,7 @@
    6.22  			/***/
    6.23  			else //spatial property
    6.24  			{
    6.25 -				System.out.println("SPATIAL PROPERTY!!!");
    6.26 +				//System.out.println("SPATIAL PROPERTY!!!");
    6.27  				rightSql = spatialPropertyFunction((FunctionCall) right, function);
    6.28  				rightIsSpatial = true;
    6.29  			}
    6.30 @@ -275,10 +279,6 @@
    6.31  			}
    6.32  		}
    6.33  
    6.34 -		/**
    6.35 -		 * 
    6.36 -		 */
    6.37 -
    6.38  		switch (op) {
    6.39  		case EQ:
    6.40  			if( (!rightIsSpatial && !rightIsDateTime) && (!leftIsSpatial && !leftIsDateTime) )
    6.41 @@ -376,38 +376,33 @@
    6.42  	}
    6.43  
    6.44  	@Override
    6.45 -	public void meet(IsBNode node)
    6.46 -			throws UnsupportedRdbmsOperatorException
    6.47 -			{
    6.48 +	public void meet(IsBNode node) throws UnsupportedRdbmsOperatorException
    6.49 +	{
    6.50  		result = isNotNull(sql.createBNodeExpr(node.getArg()));
    6.51 -			}
    6.52 +	}
    6.53  
    6.54  	@Override
    6.55 -	public void meet(IsLiteral node)
    6.56 -			throws UnsupportedRdbmsOperatorException
    6.57 -			{
    6.58 +	public void meet(IsLiteral node) throws UnsupportedRdbmsOperatorException
    6.59 +	{
    6.60  		result = isNotNull(sql.createLabelExpr(node.getArg()));
    6.61 -			}
    6.62 +	}
    6.63  
    6.64  	@Override
    6.65 -	public void meet(IsResource node)
    6.66 -			throws UnsupportedRdbmsOperatorException
    6.67 -			{
    6.68 +	public void meet(IsResource node) throws UnsupportedRdbmsOperatorException
    6.69 +	{
    6.70  		GeneralDBSqlExpr isBNode = isNotNull(sql.createBNodeExpr(node.getArg()));
    6.71  		result = or(isBNode, isNotNull(sql.createUriExpr(node.getArg())));
    6.72 -			}
    6.73 +	}
    6.74  
    6.75  	@Override
    6.76 -	public void meet(IsURI node)
    6.77 -			throws UnsupportedRdbmsOperatorException
    6.78 -			{
    6.79 +	public void meet(IsURI node) throws UnsupportedRdbmsOperatorException
    6.80 +	{
    6.81  		result = isNotNull(sql.createUriExpr(node.getArg()));
    6.82 -			}
    6.83 +	}
    6.84  
    6.85  	@Override
    6.86 -	public void meet(LangMatches node)
    6.87 -			throws UnsupportedRdbmsOperatorException
    6.88 -			{
    6.89 +	public void meet(LangMatches node) throws UnsupportedRdbmsOperatorException
    6.90 +	{
    6.91  		ValueExpr left = node.getLeftArg();
    6.92  		ValueExpr right = node.getRightArg();
    6.93  		GeneralDBSqlCase sqlCase = new GeneralDBSqlCase();
    6.94 @@ -415,39 +410,36 @@
    6.95  		GeneralDBSqlExpr pattern = concat(lowercase(label(right)), str("%"));
    6.96  		sqlCase.when(new GeneralDBTrueValue(), like(label(left), pattern));
    6.97  		result = sqlCase;
    6.98 -			}
    6.99 +	}
   6.100  
   6.101  	@Override
   6.102 -	public void meet(Not node)
   6.103 -			throws UnsupportedRdbmsOperatorException
   6.104 -			{
   6.105 +	public void meet(Not node) throws UnsupportedRdbmsOperatorException
   6.106 +	{
   6.107  		result = not(bool(node.getArg()));
   6.108 -			}
   6.109 +	}
   6.110  
   6.111  	@Override
   6.112 -	public void meet(Or node)
   6.113 -			throws UnsupportedRdbmsOperatorException
   6.114 -			{
   6.115 +	public void meet(Or node) throws UnsupportedRdbmsOperatorException
   6.116 +	{
   6.117  		result = or(bool(node.getLeftArg()), bool(node.getRightArg()));
   6.118 -			}
   6.119 +	}
   6.120  
   6.121  	@Override
   6.122 -	public void meet(Regex node)
   6.123 -			throws UnsupportedRdbmsOperatorException
   6.124 -			{
   6.125 +	public void meet(Regex node) throws UnsupportedRdbmsOperatorException
   6.126 +	{
   6.127  		result = regex(label(node.getArg()), label(node.getPatternArg()), label(node.getFlagsArg()));
   6.128 -			}
   6.129 +	}
   6.130  
   6.131  	@Override
   6.132 -	public void meet(SameTerm node)
   6.133 -			throws UnsupportedRdbmsOperatorException
   6.134 -			{
   6.135 +	public void meet(SameTerm node) throws UnsupportedRdbmsOperatorException
   6.136 +	{
   6.137  		ValueExpr left = node.getLeftArg();
   6.138  		ValueExpr right = node.getRightArg();
   6.139  		boolean leftIsVar = left instanceof Var;
   6.140  		boolean rightIsVar = right instanceof Var;
   6.141  		boolean leftIsConst = left instanceof ValueConstant;
   6.142  		boolean rightIsConst = right instanceof ValueConstant;
   6.143 +		
   6.144  		if (leftIsVar && rightIsVar) {
   6.145  			result = eq(new GeneralDBRefIdColumn((Var)left), new GeneralDBRefIdColumn((Var)right));
   6.146  		}
   6.147 @@ -464,132 +456,116 @@
   6.148  			GeneralDBSqlExpr literals = and(langs, and(datatype, labels));
   6.149  			result = and(bnodes, and(uris, literals));
   6.150  		}
   6.151 -			}
   6.152 +	}
   6.153  
   6.154  	@Override
   6.155 -	public void meet(ValueConstant vc)
   6.156 -			throws UnsupportedRdbmsOperatorException
   6.157 -			{
   6.158 +	public void meet(ValueConstant vc) throws UnsupportedRdbmsOperatorException
   6.159 +	{
   6.160  		result = valueOf(vc.getValue());
   6.161 -			}
   6.162 +	}
   6.163  
   6.164  	@Override
   6.165 -	public void meet(Var var)
   6.166 -			throws UnsupportedRdbmsOperatorException
   6.167 -			{
   6.168 +	public void meet(Var var) throws UnsupportedRdbmsOperatorException
   6.169 +	{
   6.170  		if (var.getValue() == null) {
   6.171  			result = effectiveBooleanValue(var);
   6.172  		}
   6.173  		else {
   6.174  			result = valueOf(var.getValue());
   6.175  		}
   6.176 -			}
   6.177 +	}
   6.178  
   6.179  	public void setSqlExprFactory(GeneralDBSqlExprFactory sql) {
   6.180  		this.sql = sql;
   6.181  	}
   6.182  
   6.183 -	protected GeneralDBSqlExpr bNode(ValueExpr arg)
   6.184 -			throws UnsupportedRdbmsOperatorException
   6.185 -			{
   6.186 +	protected GeneralDBSqlExpr bNode(ValueExpr arg) throws UnsupportedRdbmsOperatorException
   6.187 +	{
   6.188  		return sql.createBNodeExpr(arg);
   6.189 -			}
   6.190 +	}
   6.191  
   6.192 -	protected GeneralDBSqlExpr bool(ValueExpr arg)
   6.193 -			throws UnsupportedRdbmsOperatorException
   6.194 -			{
   6.195 +	protected GeneralDBSqlExpr bool(ValueExpr arg) throws UnsupportedRdbmsOperatorException
   6.196 +	{
   6.197  		return sql.createBooleanExpr(arg);
   6.198 -			}
   6.199 +	}
   6.200  
   6.201 -	protected GeneralDBSqlExpr label(ValueExpr arg)
   6.202 -			throws UnsupportedRdbmsOperatorException
   6.203 -			{
   6.204 +	protected GeneralDBSqlExpr label(ValueExpr arg) throws UnsupportedRdbmsOperatorException
   6.205 +	{
   6.206  		return sql.createLabelExpr(arg);
   6.207 -			}
   6.208 +	}
   6.209  
   6.210 -	protected GeneralDBSqlExpr lang(ValueExpr arg)
   6.211 -			throws UnsupportedRdbmsOperatorException
   6.212 -			{
   6.213 +	protected GeneralDBSqlExpr lang(ValueExpr arg) throws UnsupportedRdbmsOperatorException
   6.214 +	{
   6.215  		return sql.createLanguageExpr(arg);
   6.216 -			}
   6.217 +	}
   6.218  
   6.219 -	protected GeneralDBSqlExpr hash(ValueExpr arg)
   6.220 -			throws UnsupportedRdbmsOperatorException
   6.221 -			{
   6.222 +	protected GeneralDBSqlExpr hash(ValueExpr arg) throws UnsupportedRdbmsOperatorException
   6.223 +	{
   6.224  		return sql.createHashExpr(arg);
   6.225 -			}
   6.226 +	}
   6.227  
   6.228  	@Override
   6.229 -	protected void meetNode(QueryModelNode arg)
   6.230 -			throws UnsupportedRdbmsOperatorException
   6.231 -			{
   6.232 +	protected void meetNode(QueryModelNode arg) throws UnsupportedRdbmsOperatorException
   6.233 +	{
   6.234  		if (arg instanceof ValueExpr) {
   6.235  			result = effectiveBooleanValue((ValueExpr)arg);
   6.236  		}
   6.237  		else {
   6.238  			throw unsupported(arg);
   6.239  		}
   6.240 -			}
   6.241 +	}
   6.242  
   6.243 -	protected GeneralDBSqlExpr numeric(ValueExpr arg)
   6.244 -			throws UnsupportedRdbmsOperatorException
   6.245 -			{
   6.246 +	protected GeneralDBSqlExpr numeric(ValueExpr arg) throws UnsupportedRdbmsOperatorException
   6.247 +	{
   6.248  		return sql.createNumericExpr(arg);
   6.249 -			}
   6.250 +	}
   6.251  
   6.252 -	protected GeneralDBSqlExpr time(ValueExpr arg)
   6.253 -			throws UnsupportedRdbmsOperatorException
   6.254 -			{
   6.255 +	protected GeneralDBSqlExpr time(ValueExpr arg) throws UnsupportedRdbmsOperatorException
   6.256 +	{
   6.257  		return sql.createTimeExpr(arg);
   6.258 -			}
   6.259 +	}
   6.260  
   6.261 -	protected GeneralDBSqlExpr type(ValueExpr arg)
   6.262 -			throws UnsupportedRdbmsOperatorException
   6.263 -			{
   6.264 +	protected GeneralDBSqlExpr type(ValueExpr arg) throws UnsupportedRdbmsOperatorException
   6.265 +	{
   6.266  		return sql.createDatatypeExpr(arg);
   6.267 -			}
   6.268 +	}
   6.269  
   6.270 -	protected GeneralDBSqlExpr uri(ValueExpr arg)
   6.271 -			throws UnsupportedRdbmsOperatorException
   6.272 -			{
   6.273 +	protected GeneralDBSqlExpr uri(ValueExpr arg) throws UnsupportedRdbmsOperatorException
   6.274 +	{
   6.275  		return sql.createUriExpr(arg);
   6.276 -			}
   6.277 +	}
   6.278  
   6.279 -	protected GeneralDBSqlExpr zoned(ValueExpr arg)
   6.280 -			throws UnsupportedRdbmsOperatorException
   6.281 -			{
   6.282 +	protected GeneralDBSqlExpr zoned(ValueExpr arg) throws UnsupportedRdbmsOperatorException
   6.283 +	{
   6.284  		return sql.createZonedExpr(arg);
   6.285 -			}
   6.286 +	}
   6.287  
   6.288 -	private GeneralDBSqlExpr effectiveBooleanValue(ValueExpr v)
   6.289 -			throws UnsupportedRdbmsOperatorException
   6.290 -			{
   6.291 +	private GeneralDBSqlExpr effectiveBooleanValue(ValueExpr v) throws UnsupportedRdbmsOperatorException
   6.292 +	{
   6.293  		String bool = XMLSchema.BOOLEAN.stringValue();
   6.294  		GeneralDBSqlCase sqlCase = new GeneralDBSqlCase();
   6.295  		sqlCase.when(eq(type(v), str(bool)), eq(label(v), str("true")));
   6.296  		sqlCase.when(simple(type(v)), not(eq(label(v), str(""))));
   6.297  		sqlCase.when(isNotNull(numeric(v)), not(eq(numeric(v), num(0))));
   6.298  		return sqlCase;
   6.299 -			}
   6.300 +	}
   6.301  
   6.302 -	private GeneralDBSqlExpr equal(ValueExpr left, ValueExpr right)
   6.303 -			throws UnsupportedRdbmsOperatorException
   6.304 -			{
   6.305 +	private GeneralDBSqlExpr equal(ValueExpr left, ValueExpr right) throws UnsupportedRdbmsOperatorException
   6.306 +	{
   6.307  		GeneralDBSqlExpr bnodes = eq(bNode(left), bNode(right));
   6.308  		GeneralDBSqlExpr uris = eq(uri(left), uri(right));
   6.309  		GeneralDBSqlCase scase = new GeneralDBSqlCase();
   6.310  		scase.when(or(isNotNull(bNode(left)), isNotNull(bNode(right))), bnodes);
   6.311  		scase.when(or(isNotNull(uri(left)), isNotNull(uri(right))), uris);
   6.312  		return literalEqual(left, right, scase);
   6.313 -			}
   6.314 +	}
   6.315  
   6.316  	private boolean isTerm(ValueExpr node) {
   6.317  		return node instanceof Var || node instanceof ValueConstant;
   6.318  	}
   6.319  
   6.320 -	private GeneralDBSqlExpr literalEqual(ValueExpr left, ValueExpr right, GeneralDBSqlCase scase)
   6.321 -			throws UnsupportedRdbmsOperatorException
   6.322 -			{
   6.323 +	private GeneralDBSqlExpr literalEqual(ValueExpr left, ValueExpr right, GeneralDBSqlCase scase) throws UnsupportedRdbmsOperatorException
   6.324 +	{
   6.325  		GeneralDBSqlExpr labels = eq(label(left), label(right));
   6.326  		GeneralDBSqlExpr langs = and(eqIfNotNull(lang(left), lang(right)), labels.clone());
   6.327  		GeneralDBSqlExpr numeric = eq(numeric(left), numeric(right));
   6.328 @@ -605,18 +581,17 @@
   6.329  		scase.when(comparable, time);
   6.330  		scase.when(and(eq(type(left), type(right)), labels.clone()), new GeneralDBTrueValue());
   6.331  		return scase;
   6.332 -			}
   6.333 +	}
   6.334  
   6.335 -	private GeneralDBSqlExpr termsEqual(ValueExpr left, ValueExpr right)
   6.336 -			throws UnsupportedRdbmsOperatorException
   6.337 -			{
   6.338 +	private GeneralDBSqlExpr termsEqual(ValueExpr left, ValueExpr right) throws UnsupportedRdbmsOperatorException
   6.339 +	{
   6.340  		GeneralDBSqlExpr bnodes = eqIfNotNull(bNode(left), bNode(right));
   6.341  		GeneralDBSqlExpr uris = eqIfNotNull(uri(left), uri(right));
   6.342  		GeneralDBSqlCase scase = new GeneralDBSqlCase();
   6.343  		scase.when(or(isNotNull(bNode(left)), isNotNull(bNode(right))), bnodes);
   6.344  		scase.when(or(isNotNull(uri(left)), isNotNull(uri(right))), uris);
   6.345  		return literalEqual(left, right, scase);
   6.346 -			}
   6.347 +	}
   6.348  
   6.349  	private GeneralDBSqlExpr valueOf(Value value) {
   6.350  		if (value instanceof Literal) {
   6.351 @@ -629,7 +604,7 @@
   6.352  	}
   6.353  
   6.354  	/**
   6.355 -	 * FIXME spatials
   6.356 +	 * Spatials
   6.357  	 */
   6.358  	@Override
   6.359  	public void meet(FunctionCall functionCall) throws UnsupportedRdbmsOperatorException
   6.360 @@ -749,7 +724,6 @@
   6.361  		else if(function instanceof SpatialMetricFunc) 
   6.362  			//Argument # depending on the function selected
   6.363  		{
   6.364 -			//TODO
   6.365  			GeneralDBSqlExpr leftArg = null;
   6.366  			GeneralDBSqlExpr rightArg = null;
   6.367  			GeneralDBSqlExpr thirdArg = null;
   6.368 @@ -804,8 +778,6 @@
   6.369  		}
   6.370  		return null;
   6.371  	}
   6.372 -
   6.373 -	/***/
   6.374  	
   6.375  	public GeneralDBSqlExpr spatialFunction(FunctionCall functionCall) throws UnsupportedRdbmsOperatorException
   6.376  	{
   6.377 @@ -835,7 +807,6 @@
   6.378  		ValueExpr left = functionCall.getArgs().get(0);
   6.379  		ValueExpr right = functionCall.getArgs().get(1);
   6.380  
   6.381 -
   6.382  		GeneralDBSqlExpr leftArg = null;
   6.383  		GeneralDBSqlExpr rightArg = null;
   6.384  		GeneralDBSqlExpr thirdArg = null;
   6.385 @@ -965,8 +936,6 @@
   6.386  
   6.387  	}
   6.388  
   6.389 -	/***/
   6.390 -	
   6.391  	GeneralDBSqlExpr spatialMetricFunction(FunctionCall functionCall, Function function) throws UnsupportedRdbmsOperatorException
   6.392  	{
   6.393  		GeneralDBSqlExpr leftArg = null;
   6.394 @@ -1201,7 +1170,8 @@
   6.395  		{
   6.396  			return relate(leftArg,rightArg,thirdArg);
   6.397  		}
   6.398 -		//Should never reach this place
   6.399 +		
   6.400 +		logger.error("[Strabon.spatialRelationshipPicker] No appropriate SQL expression was generated for extension function {}. This is probably a bug.", function.getURI());
   6.401  		return null;
   6.402  	}
   6.403  
   6.404 @@ -1275,7 +1245,7 @@
   6.405  			return geoBoundary(leftArg);
   6.406  		}
   6.407  
   6.408 -		//Should never reach this place
   6.409 +		logger.error("[Strabon.spatialConstructPicker] No appropriate SQL expression was generated for extension function {}. This is probably a bug.", function.getURI());
   6.410  		return null;
   6.411  	}
   6.412  
   6.413 @@ -1284,7 +1254,6 @@
   6.414  	 * @author George Garbis <ggarbis@di.uoa.gr>
   6.415  	 * 
   6.416  	 */
   6.417 -	
   6.418  	GeneralDBSqlExpr dateTimeMetricPicker(Function function,GeneralDBSqlExpr leftArg, GeneralDBSqlExpr rightArg)
   6.419  	{
   6.420  		if(function.getURI().equals(GeoConstants.diffDateTime))
   6.421 @@ -1292,12 +1261,10 @@
   6.422  			return diffDateTime(leftArg, rightArg);
   6.423  		}
   6.424  
   6.425 -		//Should never reach this place
   6.426 +		logger.error("[Strabon.dateTimeMetricPicker] No appropriate SQL expression was generated for extension function {}. This is probably a bug.", function.getURI());
   6.427  		return null;
   6.428  	}
   6.429  	
   6.430 -	/***/
   6.431 -	
   6.432  	//TODO more to be added here probably
   6.433  	GeneralDBSqlExpr spatialMetricPicker(Function function,GeneralDBSqlExpr leftArg, GeneralDBSqlExpr rightArg, GeneralDBSqlExpr thirdArg)
   6.434  	{
   6.435 @@ -1311,11 +1278,11 @@
   6.436  		}
   6.437  		//GeoSPARQL's distance must be added at this place
   6.438  
   6.439 -		//Should never reach this place
   6.440 +		logger.error("[Strabon.spatialMetricPicker] No appropriate SQL expression was generated for extension function {}. This is probably a bug.", function.getURI());
   6.441  		return null;
   6.442  	}
   6.443  
   6.444 -	GeneralDBSqlExpr spatialPropertyPicker(Function function,GeneralDBSqlExpr arg)
   6.445 +	GeneralDBSqlExpr spatialPropertyPicker(Function function, GeneralDBSqlExpr arg)
   6.446  	{
   6.447  		if(function.getURI().equals(GeoConstants.stSPARQLdimension))
   6.448  		{
   6.449 @@ -1329,7 +1296,8 @@
   6.450  		{
   6.451  			return asText(arg);
   6.452  		}
   6.453 -		else if(function.getURI().equals(GeoConstants.stSPARQLsrid))
   6.454 +		else if(function.getURI().equals(GeoConstants.stSPARQLsrid) ||
   6.455 +				function.getURI().equals(GeoConstants.geoSparqlGetSRID))
   6.456  		{
   6.457  			return srid(arg);
   6.458  		}
   6.459 @@ -1345,7 +1313,8 @@
   6.460  			return asGML(arg);
   6.461  		}
   6.462  
   6.463 -		//Should never reach this place
   6.464 +		logger.error("[Strabon.GeneralDBBooleanExprFactory] No appropriate SQL expression was generated for extension function {}. This is probably a bug.", function.getURI());
   6.465 +		
   6.466  		return null;
   6.467  	}
   6.468