Strabon

changeset 748:3e4cdb6151fc temporals

Did the same for the query processing: Instants supported as constant arguments in temporal extension functions
author Konstantina
date Thu Nov 29 01:00:38 2012 +0200 (2012-11-29)
parents 5855c4eeb243
children 07d584b2fb5b
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	Thu Nov 29 00:16:05 2012 +0200
     1.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/evaluation/PostGISQueryBuilder.java	Thu Nov 29 01:00:38 2012 +0200
     1.3 @@ -986,7 +986,17 @@
     1.4  		}
     1.5  		else
     1.6  		{
     1.7 -			filter.append("period_in(textout('"+period+"'))");
     1.8 +			if(period.contains(",")) //valid time is a period
     1.9 +			{
    1.10 +				filter.append("period_in(textout('"+period+"'))");		
    1.11 +			}
    1.12 +			else // valid time is an instant
    1.13 +			{
    1.14 +
    1.15 +				String instant =period.substring(period.indexOf('[')+1, period.indexOf(']'));
    1.16 +				filter.append("period(to_timestamp('"+instant+ "','YYYY-MM-DD HH:MI:SS.MS'))");
    1.17 +			}
    1.18 +		
    1.19  		}
    1.20  		return period;
    1.21  	}