Strabon

changeset 1035:ae9f108cc7a9 temporals

fixed bug that occurs when storing periods having "UC" as ending point. That was supported in initial versions but it got probably messed up in later updates. Going to add tests so that this will not happen again :)
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Tue Apr 16 14:42:20 2013 +0300 (2013-04-16)
parents 800120faf87f
children 6e417d9b4c3d
files evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/TemporalConstants.java generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java runtime/src/main/java/eu/earthobservatory/runtime/generaldb/NQuadsParser.java
line diff
     1.1 --- a/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/TemporalConstants.java	Fri Mar 29 19:05:56 2013 +0200
     1.2 +++ b/evaluation/src/main/java/org/openrdf/query/algebra/evaluation/function/temporal/stsparql/relation/TemporalConstants.java	Tue Apr 16 14:42:20 2013 +0300
     1.3 @@ -21,6 +21,10 @@
     1.4  	
     1.5  	public static final String INSTANT = "http://www.w3.org/2001/XMLSchema#dateTime";
     1.6  	
     1.7 +	public static final String UNTIL_CHANGED = "UC";
     1.8 +	public static final String UNTIL_CHANGED_VALUE = "9999-9-9:00:00:00";
     1.9 +	
    1.10 +	
    1.11  	//Temporal Relationships
    1.12  	public static final String periodContains= stRDF+ "PeriodContains";
    1.13  
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java	Fri Mar 29 19:05:56 2013 +0200
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java	Tue Apr 16 14:42:20 2013 +0300
     2.3 @@ -12,6 +12,7 @@
     2.4  
     2.5  import org.openrdf.query.algebra.evaluation.function.spatial.AbstractWKT;
     2.6  import org.openrdf.query.algebra.evaluation.function.spatial.StrabonPolyhedron;
     2.7 +import org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.TemporalConstants;
     2.8  import org.openrdf.query.algebra.evaluation.util.JTSWrapper;
     2.9  import org.slf4j.Logger;
    2.10  import org.slf4j.LoggerFactory;
    2.11 @@ -193,7 +194,7 @@
    2.12  		//TODO the label should be validated as a period before reaching this point. Not sure yet on which level this should be done
    2.13  //		System.out.println("LABEL: "+label);
    2.14  //		System.out.println("NUMBER: "+id.toString());
    2.15 -		String postgresPeriodLabel = label.replace("T"," ");
    2.16 +		String postgresPeriodLabel = label.replace("T"," ").replace(TemporalConstants.UNTIL_CHANGED, TemporalConstants.UNTIL_CHANGED_VALUE);
    2.17  		temporalTable.insert(id, postgresPeriodLabel);
    2.18  	}
    2.19  	
     3.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/NQuadsParser.java	Fri Mar 29 19:05:56 2013 +0200
     3.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/NQuadsParser.java	Tue Apr 16 14:42:20 2013 +0300
     3.3 @@ -204,6 +204,8 @@
     3.4      {
     3.5      	String strdf = TemporalConstants.PERIOD;
     3.6      	String period = "http://strdf.di.uoa.gr/ontology#period";
     3.7 +    	Date end = null;
     3.8 +    	
     3.9      	validTimeLiteral=sb;
    3.10      	int i2=0; 
    3.11      	
    3.12 @@ -260,7 +262,9 @@
    3.13       	SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
    3.14       	Date start = format.parse(startDate);
    3.15       	//System.out.println("start date:"+startDate.toString());
    3.16 -     	Date end = format.parse(endDate);
    3.17 +     	
    3.18 +     	if(!endDate.contains(TemporalConstants.UNTIL_CHANGED))
    3.19 +     		 end = format.parse(endDate);
    3.20       	//System.out.println("End date:"+ endDate.toString());
    3.21          String uri = strdf+"/"+ startDate+"_"+ endDate+ "_" +format.getTimeZone().getID(); 
    3.22          Resource cont = createURI(uri);