Strabon

changeset 371:8714353b3a2c

added asGML to PostGIS and MonetDB. Still not working.
author Babis Nikolaou <charnik@di.uoa.gr>
date Wed Jun 27 13:31:06 2012 +0300 (2012-06-27)
parents d0fce81f7f56
children 531d318e3578 617f0030d0af
files generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBQueryBuilder.java monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBQueryBuilder.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/evaluation/GeneralDBQueryBuilder.java	Tue Jun 26 21:18:08 2012 +0300
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBQueryBuilder.java	Wed Jun 27 13:31:06 2012 +0300
     1.3 @@ -42,6 +42,7 @@
     1.4  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlEq;
     1.5  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlEqualsSpatial;
     1.6  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoArea;
     1.7 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoAsGML;
     1.8  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoAsText;
     1.9  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoBoundary;
    1.10  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoBuffer;
    1.11 @@ -76,7 +77,6 @@
    1.12  import org.openrdf.sail.generaldb.algebra.GeneralDBStringValue;
    1.13  import org.openrdf.sail.generaldb.algebra.GeneralDBTrueValue;
    1.14  import org.openrdf.sail.generaldb.algebra.GeneralDBURIColumn;
    1.15 -import org.openrdf.sail.generaldb.algebra.GeneralDBUnionItem;
    1.16  import org.openrdf.sail.generaldb.algebra.base.BinaryGeneralDBOperator;
    1.17  import org.openrdf.sail.generaldb.algebra.base.GeneralDBFromItem;
    1.18  import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlConstant;
    1.19 @@ -114,7 +114,7 @@
    1.20  /**
    1.21   * Constructs an SQL query from {@link GeneralDBSqlExpr}s and {@link GeneralDBFromItem}s.
    1.22   * 
    1.23 - * @author James Leigh
    1.24 + * @author Manos Karpathiotakis <mk@di.uoa.gr>
    1.25   * 
    1.26   */
    1.27  public abstract class GeneralDBQueryBuilder {
    1.28 @@ -146,19 +146,17 @@
    1.29  	}
    1.30  
    1.31  	public GeneralDBQueryBuilder filter(GeneralDBColumnVar var, Value val)
    1.32 -			throws RdbmsException
    1.33 -			{
    1.34 +	throws RdbmsException
    1.35 +	{
    1.36  		String alias = var.getAlias();
    1.37  		String column = var.getColumn();
    1.38  		query.filter().and().columnEquals(alias, column, vf.getInternalId(val));
    1.39  		return this;
    1.40 -			}
    1.41 +	}
    1.42  
    1.43 -	public void from(GeneralDBFromItem from)
    1.44 -			throws RdbmsException, UnsupportedRdbmsOperatorException
    1.45 -			{
    1.46 +	public void from(GeneralDBFromItem from) throws RdbmsException, UnsupportedRdbmsOperatorException {
    1.47  		from(query, from);
    1.48 -			}
    1.49 +	}
    1.50  
    1.51  	public List<?> getParameters() {
    1.52  		return query.findParameters(new ArrayList<Object>());
    1.53 @@ -173,22 +171,22 @@
    1.54  	}
    1.55  
    1.56  	public void orderBy(GeneralDBSqlExpr expr, boolean isAscending)
    1.57 -			throws UnsupportedRdbmsOperatorException
    1.58 -			{
    1.59 +	throws UnsupportedRdbmsOperatorException
    1.60 +	{
    1.61  		GeneralDBSqlExprBuilder orderBy = query.orderBy();
    1.62  		dispatch(expr, orderBy);
    1.63  		if (!isAscending) {
    1.64  			orderBy.append(" DESC");
    1.65  		}
    1.66 -			}
    1.67 +	}
    1.68  
    1.69  	public GeneralDBQueryBuilder select(GeneralDBSqlExpr expr)
    1.70 -			throws UnsupportedRdbmsOperatorException
    1.71 -			{
    1.72 +	throws UnsupportedRdbmsOperatorException
    1.73 +	{
    1.74  		dispatch(expr, query.select());
    1.75  
    1.76  		return this;
    1.77 -			}
    1.78 +	}
    1.79  
    1.80  	@Override
    1.81  	public String toString() {
    1.82 @@ -345,8 +343,8 @@
    1.83  			}	
    1.84  
    1.85  	protected void append(GeneralDBSqlCase expr, GeneralDBSqlExprBuilder filter)
    1.86 -			throws UnsupportedRdbmsOperatorException
    1.87 -			{
    1.88 +	throws UnsupportedRdbmsOperatorException
    1.89 +	{
    1.90  		GeneralDBSqlCaseBuilder caseExpr = filter.caseBegin();
    1.91  		for (GeneralDBSqlCase.Entry e : expr.getEntries()) {
    1.92  			caseExpr.when();
    1.93 @@ -355,68 +353,68 @@
    1.94  			dispatch(e.getResult(), filter);
    1.95  		}
    1.96  		caseExpr.end();
    1.97 -			}
    1.98 +	}
    1.99  
   1.100  	protected void append(GeneralDBSqlCast expr, GeneralDBSqlExprBuilder filter)
   1.101 -			throws UnsupportedRdbmsOperatorException
   1.102 -			{
   1.103 +	throws UnsupportedRdbmsOperatorException
   1.104 +	{
   1.105  		GeneralDBSqlCastBuilder cast = filter.cast(expr.getType());
   1.106  		dispatch(expr.getArg(), (GeneralDBSqlExprBuilder) cast);
   1.107  		cast.close();
   1.108 -			}
   1.109 +	}
   1.110  
   1.111  	protected void append(GeneralDBSqlCompare expr, GeneralDBSqlExprBuilder filter)
   1.112 -			throws UnsupportedRdbmsOperatorException
   1.113 -			{
   1.114 +	throws UnsupportedRdbmsOperatorException
   1.115 +	{
   1.116  		dispatch(expr.getLeftArg(), filter);
   1.117  		filter.appendOperator(expr.getOperator());
   1.118  		dispatch(expr.getRightArg(), filter);
   1.119 -			}
   1.120 +	}
   1.121  
   1.122  	protected void append(GeneralDBSqlConcat expr, GeneralDBSqlExprBuilder filter)
   1.123 -			throws UnsupportedRdbmsOperatorException
   1.124 -			{
   1.125 +	throws UnsupportedRdbmsOperatorException
   1.126 +	{
   1.127  		GeneralDBSqlBracketBuilder open = filter.open();
   1.128  		dispatch(expr.getLeftArg(), (GeneralDBSqlExprBuilder) open);
   1.129  		open.concat();
   1.130  		dispatch(expr.getRightArg(), (GeneralDBSqlExprBuilder) open);
   1.131  		open.close();
   1.132 -			}
   1.133 +	}
   1.134  
   1.135  	protected void append(GeneralDBSqlEq expr, GeneralDBSqlExprBuilder filter)
   1.136 -			throws UnsupportedRdbmsOperatorException
   1.137 -			{
   1.138 +	throws UnsupportedRdbmsOperatorException
   1.139 +	{
   1.140  		dispatch(expr.getLeftArg(), filter);
   1.141  		filter.eq();
   1.142  		dispatch(expr.getRightArg(), filter);
   1.143 -			}
   1.144 +	}
   1.145  
   1.146  	protected abstract void append(GeneralDBSqlIsNull expr, GeneralDBSqlExprBuilder filter)
   1.147  			throws UnsupportedRdbmsOperatorException;
   1.148  
   1.149  	protected void append(GeneralDBSqlLike expr, GeneralDBSqlExprBuilder filter)
   1.150 -			throws UnsupportedRdbmsOperatorException
   1.151 -			{
   1.152 +	throws UnsupportedRdbmsOperatorException
   1.153 +	{
   1.154  		dispatch(expr.getLeftArg(), filter);
   1.155  		filter.like();
   1.156  		dispatch(expr.getRightArg(), filter);
   1.157 -			}
   1.158 +	}
   1.159  
   1.160  	protected void append(GeneralDBSqlLowerCase expr, GeneralDBSqlExprBuilder filter)
   1.161 -			throws UnsupportedRdbmsOperatorException
   1.162 -			{
   1.163 +	throws UnsupportedRdbmsOperatorException
   1.164 +	{
   1.165  		GeneralDBSqlBracketBuilder lower = filter.lowerCase();
   1.166  		dispatch(expr.getArg(), (GeneralDBSqlExprBuilder) lower);
   1.167  		lower.close();
   1.168 -			}
   1.169 +	}
   1.170  
   1.171  	protected void append(GeneralDBSqlMathExpr expr, GeneralDBSqlExprBuilder filter)
   1.172 -			throws UnsupportedRdbmsOperatorException
   1.173 -			{
   1.174 +	throws UnsupportedRdbmsOperatorException
   1.175 +	{
   1.176  		dispatch(expr.getLeftArg(), filter);
   1.177  		filter.math(expr.getOperator());
   1.178  		dispatch(expr.getRightArg(), filter);
   1.179 -			}
   1.180 +	}
   1.181  
   1.182  	protected abstract void append(GeneralDBSqlNot expr, GeneralDBSqlExprBuilder filter)
   1.183  			throws UnsupportedRdbmsOperatorException;
   1.184 @@ -424,18 +422,18 @@
   1.185  	protected abstract void append(GeneralDBSqlNull expr, GeneralDBSqlExprBuilder filter);
   1.186  
   1.187  	protected void append(GeneralDBSqlOr expr, GeneralDBSqlExprBuilder filter)
   1.188 -			throws UnsupportedRdbmsOperatorException
   1.189 -			{
   1.190 +	throws UnsupportedRdbmsOperatorException
   1.191 +	{
   1.192  		GeneralDBSqlBracketBuilder open = filter.open();
   1.193  		dispatch(expr.getLeftArg(), (GeneralDBSqlExprBuilder) open);
   1.194  		open.or();
   1.195  		dispatch(expr.getRightArg(), (GeneralDBSqlExprBuilder) open);
   1.196  		open.close();
   1.197 -			}
   1.198 +	}
   1.199  
   1.200  	protected void append(GeneralDBSqlRegex expr, GeneralDBSqlExprBuilder filter)
   1.201 -			throws UnsupportedRdbmsOperatorException
   1.202 -			{
   1.203 +	throws UnsupportedRdbmsOperatorException
   1.204 +	{
   1.205  		GeneralDBSqlRegexBuilder regex = filter.regex();
   1.206  		dispatch(expr.getArg(), regex.value());
   1.207  		dispatch(expr.getPatternArg(), regex.pattern());
   1.208 @@ -444,11 +442,11 @@
   1.209  			dispatch(flags, regex.flags());
   1.210  		}
   1.211  		regex.close();
   1.212 -			}
   1.213 +	}
   1.214  
   1.215  	protected void append(GeneralDBSqlShift expr, GeneralDBSqlExprBuilder filter)
   1.216 -			throws UnsupportedRdbmsOperatorException
   1.217 -			{
   1.218 +	throws UnsupportedRdbmsOperatorException
   1.219 +	{
   1.220  		GeneralDBSqlBracketBuilder mod = filter.mod(expr.getRange());
   1.221  		GeneralDBSqlBracketBuilder open = mod.open();
   1.222  		dispatch(expr.getArg(), (GeneralDBSqlExprBuilder) open);
   1.223 @@ -456,7 +454,7 @@
   1.224  		open.close();
   1.225  		mod.plus(expr.getRange());
   1.226  		mod.close();
   1.227 -			}
   1.228 +	}
   1.229  
   1.230  	protected void append(GeneralDBStringValue expr, GeneralDBSqlExprBuilder filter) {
   1.231  		filter.varchar(expr.getValue());
   1.232 @@ -473,8 +471,8 @@
   1.233  	}
   1.234  
   1.235  	protected void dispatch(GeneralDBSqlExpr expr, GeneralDBSqlExprBuilder filter)
   1.236 -			throws UnsupportedRdbmsOperatorException
   1.237 -			{
   1.238 +	throws UnsupportedRdbmsOperatorException
   1.239 +	{
   1.240  		if (expr instanceof GeneralDBValueColumnBase) {
   1.241  			dispatchValueColumnBase((GeneralDBValueColumnBase)expr, filter);
   1.242  		}
   1.243 @@ -497,11 +495,11 @@
   1.244  		else {
   1.245  			dispatchOther(expr, filter);
   1.246  		}
   1.247 -			}
   1.248 +	}
   1.249  
   1.250  	protected void dispatchBinarySqlOperator(BinaryGeneralDBOperator expr, GeneralDBSqlExprBuilder filter)
   1.251 -			throws UnsupportedRdbmsOperatorException
   1.252 -			{
   1.253 +	throws UnsupportedRdbmsOperatorException
   1.254 +	{
   1.255  		if (expr instanceof GeneralDBSqlAnd) {
   1.256  			append((GeneralDBSqlAnd)expr, filter);
   1.257  		}
   1.258 @@ -676,7 +674,7 @@
   1.259  		else {
   1.260  			throw unsupported(expr);
   1.261  		}
   1.262 -			}
   1.263 +	}
   1.264  
   1.265  	protected void dispatchTripleSqlOperator(TripleGeneralDBOperator expr, GeneralDBSqlExprBuilder filter)
   1.266  			throws UnsupportedRdbmsOperatorException
   1.267 @@ -774,6 +772,9 @@
   1.268  		else if (expr instanceof GeneralDBSqlGeoAsText) {
   1.269  			append((GeneralDBSqlGeoAsText)expr, filter);
   1.270  		}
   1.271 +		else if (expr instanceof GeneralDBSqlGeoAsGML) {
   1.272 +			append((GeneralDBSqlGeoAsGML)expr, filter);
   1.273 +		}
   1.274  		else if (expr instanceof GeneralDBSqlGeoSrid) {
   1.275  			append((GeneralDBSqlGeoSrid)expr, filter);
   1.276  		}
   1.277 @@ -1091,6 +1092,9 @@
   1.278  	protected abstract void append(GeneralDBSqlGeoAsText expr, GeneralDBSqlExprBuilder filter)
   1.279  			throws UnsupportedRdbmsOperatorException;
   1.280  
   1.281 +	protected abstract void append(GeneralDBSqlGeoAsGML expr, GeneralDBSqlExprBuilder filter)
   1.282 +			throws UnsupportedRdbmsOperatorException;
   1.283 +	
   1.284  	protected abstract void append(GeneralDBSqlGeoSrid expr, GeneralDBSqlExprBuilder filter)
   1.285  			throws UnsupportedRdbmsOperatorException;
   1.286  
     2.1 --- a/monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBQueryBuilder.java	Tue Jun 26 21:18:08 2012 +0300
     2.2 +++ b/monetdb/src/main/java/org/openrdf/sail/monetdb/evaluation/MonetDBQueryBuilder.java	Wed Jun 27 13:31:06 2012 +0300
     2.3 @@ -25,6 +25,7 @@
     2.4  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlDisjoint;
     2.5  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlEqualsSpatial;
     2.6  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoArea;
     2.7 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoAsGML;
     2.8  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoAsText;
     2.9  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoBoundary;
    2.10  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoBuffer;
    2.11 @@ -121,11 +122,13 @@
    2.12  		ST_CoveredBy,
    2.13  		ST_Overlaps,
    2.14  		ST_Relate,
    2.15 +		
    2.16  		// These Spatial Relations are implemented in MonetDB as operands and they apply in MBB of a geometry
    2.17  		anyInteract, 
    2.18  		equals, 
    2.19  		contains, 
    2.20  		inside,		
    2.21 +		
    2.22  		//Spatial Constructs - Binary
    2.23  		ST_Union,
    2.24  		ST_Intersection,
    2.25 @@ -133,21 +136,27 @@
    2.26  		ST_Buffer,
    2.27  		ST_Transform,
    2.28  		ST_SymDifference,
    2.29 +		
    2.30  		//Spatial Constructs - Unary
    2.31  		ST_Envelope,
    2.32  		ST_ConvexHull,
    2.33  		ST_Boundary,
    2.34 +		
    2.35  		//Spatial Metrics - Binary
    2.36  		ST_Distance,
    2.37 +		
    2.38  		//Spatial Metrics - Unary
    2.39  		ST_Area,
    2.40 +		
    2.41  		//Spatial Properties - All Unary
    2.42  		ST_Dimension,
    2.43  		ST_GeometryType,
    2.44 +		ST_AsGML,
    2.45  		ST_AsText,
    2.46  		ST_SRID,
    2.47  		ST_IsEmpty,
    2.48  		ST_IsSimple,
    2.49 +		
    2.50  		//GeoSPARQL
    2.51  		//Simple Features
    2.52  		SF_Equals,
    2.53 @@ -167,6 +176,7 @@
    2.54  		RCC8_Tpp,
    2.55  		RCC8_Ntppi,
    2.56  		RCC8_Ntpp,
    2.57 +		
    2.58  		//Egenhofer
    2.59  		EH_Equals,
    2.60  		EH_Disjoint,
    2.61 @@ -751,6 +761,12 @@
    2.62  	{
    2.63  		appendMonetDBSpatialFunctionUnary(expr, filter, SpatialFunctionsMonetDB.ST_AsText);
    2.64  	}
    2.65 +	
    2.66 +	@Override
    2.67 +	protected void append(GeneralDBSqlGeoAsGML expr, GeneralDBSqlExprBuilder filter)
    2.68 +	throws UnsupportedRdbmsOperatorException {
    2.69 +		appendMonetDBSpatialFunctionUnary(expr, filter, SpatialFunctionsMonetDB.ST_AsGML);
    2.70 +	}	
    2.71  
    2.72  	@Override
    2.73  	protected void append(GeneralDBSqlGeoSrid expr, GeneralDBSqlExprBuilder filter)
    2.74 @@ -2025,5 +2041,5 @@
    2.75  			//			filter.closeBracket();
    2.76  		}
    2.77  		filter.closeBracket();
    2.78 -	}	
    2.79 +	}
    2.80  }
    2.81 \ No newline at end of file
     3.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Tue Jun 26 21:18:08 2012 +0300
     3.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Wed Jun 27 13:31:06 2012 +0300
     3.3 @@ -24,6 +24,7 @@
     3.4  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlDisjoint;
     3.5  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlEqualsSpatial;
     3.6  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoArea;
     3.7 +import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoAsGML;
     3.8  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoAsText;
     3.9  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoBoundary;
    3.10  import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoBuffer;
    3.11 @@ -61,7 +62,6 @@
    3.12  import org.openrdf.sail.generaldb.algebra.base.BinaryGeneralDBOperator;
    3.13  import org.openrdf.sail.generaldb.algebra.base.GeneralDBFromItem;
    3.14  import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr;
    3.15 -import org.openrdf.sail.generaldb.algebra.base.GeneralDBValueColumnBase;
    3.16  import org.openrdf.sail.generaldb.algebra.base.TripleGeneralDBOperator;
    3.17  import org.openrdf.sail.generaldb.algebra.base.UnaryGeneralDBOperator;
    3.18  import org.openrdf.sail.generaldb.algebra.egenhofer.GeneralDBSqlEgenhofer_Contains;
    3.19 @@ -99,11 +99,15 @@
    3.20  /**
    3.21   * Constructs an SQL query from {@link GeneralDBSqlExpr}s and {@link GeneralDBFromItem}s.
    3.22   * 
    3.23 - * @author James Leigh
    3.24 + * @author Manos Karpathiotakis <mk@di.uoa.gr>
    3.25   * 
    3.26   */
    3.27  public class PostGISQueryBuilder extends GeneralDBQueryBuilder {
    3.28  
    3.29 +	public static final String STRDFGEO_FIELD = "strdfgeo";
    3.30 +	public static final String SRID_FIELD = "srid";
    3.31 +	public static final String ST_TRANSFORM = "ST_Transform";
    3.32 +	public static final String ST_ASBINARY = "ST_AsBinary";
    3.33  	/**
    3.34  	 * If (spatial) label column met is null, I must not try to retrieve its srid. 
    3.35  	 * Opting to ask for 'null' instead
    3.36 @@ -122,6 +126,7 @@
    3.37  		ST_Intersects,
    3.38  		ST_Equals,
    3.39  		ST_Relate, 
    3.40 +		
    3.41  		//Spatial Constructs - Binary
    3.42  		ST_Union, 
    3.43  		ST_Intersection, 
    3.44 @@ -129,21 +134,27 @@
    3.45  		ST_Buffer,
    3.46  		ST_Transform,
    3.47  		ST_SymDifference,
    3.48 +		
    3.49  		//Spatial Constructs - Unary
    3.50  		ST_Envelope,
    3.51  		ST_ConvexHull,
    3.52  		ST_Boundary,
    3.53 +		
    3.54  		//Spatial Metrics - Binary
    3.55  		ST_Distance,
    3.56 +		
    3.57  		//Spatial Metrics - Unary
    3.58  		ST_Area,
    3.59 +		
    3.60  		//Spatial Properties - All Unary
    3.61  		ST_Dimension,
    3.62  		ST_GeometryType,
    3.63 +		ST_AsGML,
    3.64  		ST_AsText,
    3.65  		ST_SRID,
    3.66  		ST_IsEmpty,
    3.67  		ST_IsSimple,
    3.68 +		
    3.69  		//GeoSPARQL
    3.70  		//Simple Features
    3.71  		SF_Equals,
    3.72 @@ -154,6 +165,7 @@
    3.73  		SF_Contains,
    3.74  		SF_Overlaps,
    3.75  		SF_Crosses,
    3.76 +		
    3.77  		//RCC8
    3.78  		RCC8_Eq,
    3.79  		RCC8_Dc,
    3.80 @@ -163,6 +175,7 @@
    3.81  		RCC8_Tpp,
    3.82  		RCC8_Ntppi,
    3.83  		RCC8_Ntpp,
    3.84 +		
    3.85  		//Egenhofer
    3.86  		EH_Equals,
    3.87  		EH_Disjoint,
    3.88 @@ -222,25 +235,25 @@
    3.89  		else {
    3.90  			if(var.isSpatial())
    3.91  			{
    3.92 -				filter.appendFunction("ST_AsBinary");
    3.93 +				filter.appendFunction(ST_ASBINARY);
    3.94  				filter.openBracket();
    3.95  				//XXX SRID
    3.96 -				filter.appendFunction("ST_Transform");
    3.97 +				filter.appendFunction(ST_TRANSFORM);
    3.98  				filter.openBracket();
    3.99  				//
   3.100  				String alias = getLabelAlias(var.getRdbmsVar());
   3.101  
   3.102 -				filter.column(alias, "strdfgeo");
   3.103 +				filter.column(alias, STRDFGEO_FIELD);
   3.104  				//XXX SRID
   3.105  				filter.appendComma();
   3.106 -				filter.column(alias, "srid");
   3.107 +				filter.column(alias, SRID_FIELD);
   3.108  				filter.closeBracket();
   3.109  				//
   3.110  				filter.closeBracket();
   3.111  
   3.112  				//Adding srid field explicitly for my StrabonPolyhedron constructor later on!
   3.113  				filter.appendComma();
   3.114 -				filter.column(alias, "srid");
   3.115 +				filter.column(alias, SRID_FIELD);
   3.116  			}
   3.117  			else
   3.118  			{
   3.119 @@ -308,7 +321,7 @@
   3.120  				&&!(expr instanceof GeneralDBSqlMathExpr)
   3.121  				&&!(expr instanceof GeneralDBSqlSpatialProperty))
   3.122  		{
   3.123 -			query.select().appendFunction("ST_AsBinary");
   3.124 +			query.select().appendFunction(ST_ASBINARY);
   3.125  		}
   3.126  		else
   3.127  		{
   3.128 @@ -699,6 +712,13 @@
   3.129  	{
   3.130  		appendGeneralDBSpatialFunctionUnary(expr, filter, SpatialFunctionsPostGIS.ST_AsText);
   3.131  	}
   3.132 +	
   3.133 +	@Override
   3.134 +	protected void append(GeneralDBSqlGeoAsGML expr, GeneralDBSqlExprBuilder filter)
   3.135 +	throws UnsupportedRdbmsOperatorException
   3.136 +	{
   3.137 +		appendGeneralDBSpatialFunctionUnary(expr, filter, SpatialFunctionsPostGIS.ST_AsGML);
   3.138 +	}
   3.139  
   3.140  	//	@Override
   3.141  	//	protected void append(GeneralDBSqlGeoSrid expr, GeneralDBSqlExprBuilder filter)
   3.142 @@ -1052,7 +1072,7 @@
   3.143  		String sridExpr = null;
   3.144  
   3.145  		filter.openBracket();
   3.146 -		filter.appendFunction("ST_Transform");
   3.147 +		filter.appendFunction(ST_TRANSFORM);
   3.148  		filter.openBracket();
   3.149  
   3.150  		boolean check1 = expr.getLeftArg().getClass().getCanonicalName().equals("org.openrdf.sail.generaldb.algebra.GeneralDBSqlNull");
   3.151 @@ -1111,7 +1131,7 @@
   3.152  				}
   3.153  				if(sridNeeded)
   3.154  				{
   3.155 -					filter.appendFunction("ST_Transform");
   3.156 +					filter.appendFunction(ST_TRANSFORM);
   3.157  					filter.openBracket();
   3.158  				}
   3.159  			}
   3.160 @@ -1256,7 +1276,7 @@
   3.161  				}
   3.162  				if(sridNeeded)
   3.163  				{
   3.164 -					filter.appendFunction("ST_Transform");
   3.165 +					filter.appendFunction(ST_TRANSFORM);
   3.166  					filter.openBracket();
   3.167  				}
   3.168  			}
   3.169 @@ -1461,7 +1481,7 @@
   3.170  				}
   3.171  				if(sridNeeded)
   3.172  				{
   3.173 -					filter.appendFunction("ST_Transform");
   3.174 +					filter.appendFunction(ST_TRANSFORM);
   3.175  					filter.openBracket();
   3.176  				}
   3.177  			}