Strabon

changeset 856:c1f6c1f56954 temporals

wrapped temporal constructs with text_in(period_out))
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Wed Jan 09 20:40:19 2013 +0200 (2013-01-09)
parents 985c9bbd8194
children 46d0edd3790c
files postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java
line diff
     1.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Wed Jan 09 18:24:12 2013 +0200
     1.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Wed Jan 09 20:40:19 2013 +0200
     1.3 @@ -350,16 +350,25 @@
     1.4  	@Override
     1.5  	public GeneralDBQueryBuilder construct(GeneralDBSqlExpr expr) throws UnsupportedRdbmsOperatorException
     1.6  	{
     1.7 +		boolean isTemporalConstruct = false;
     1.8 +		
     1.9  		if(!(expr instanceof GeneralDBSqlSpatialMetricBinary) 
    1.10  				&&!(expr instanceof GeneralDBSqlSpatialMetricUnary)
    1.11  				&&!(expr instanceof GeneralDBSqlMathExpr)
    1.12  				&&!(expr instanceof GeneralDBSqlSpatialProperty)
    1.13 -			&&!(expr instanceof GeneralDBSqlTemporal)
    1.14 -			&&!(expr instanceof GeneralDBSqlTemporalConstructBinary)
    1.15 -			&&!(expr instanceof GeneralDBSqlTemporalConstructUnary))
    1.16 +				&&!(expr instanceof GeneralDBSqlTemporalConstructUnary)
    1.17 +				&&!(expr instanceof GeneralDBSqlTemporalConstructBinary))
    1.18  		{
    1.19 +			
    1.20  			query.select().appendFunction(ST_ASBINARY);
    1.21  		}
    1.22 +		else if(expr instanceof GeneralDBSqlTemporalConstructUnary || expr instanceof GeneralDBSqlTemporalConstructBinary)
    1.23 +		{
    1.24 +			isTemporalConstruct = true;
    1.25 +			query.select().append(CSTRING_TO_TEXT);
    1.26 +			query.select.append("(");
    1.27 +			query.select.append(PERIOD_TO_CSTRING+"(");
    1.28 +		}
    1.29  		else
    1.30  		{
    1.31  			query.select();
    1.32 @@ -372,8 +381,10 @@
    1.33  		{
    1.34  			dispatchUnarySqlOperator((UnaryGeneralDBOperator) expr, query.select);
    1.35  		}
    1.36 +		if(isTemporalConstruct)
    1.37 +		{
    1.38 +			query.select.append("))");	}
    1.39  		//SRID support must be explicitly added!
    1.40 -
    1.41  		return this;
    1.42  	}
    1.43  
    1.44 @@ -1887,7 +1898,6 @@
    1.45  
    1.46  			GeneralDBSqlExpr tmp = expr;
    1.47  
    1.48 -
    1.49  			if(tmp instanceof GeneralDBSqlSpatialConstructUnary && tmp.getParentNode() == null)
    1.50  			{
    1.51  				while(true)