Strabon

changeset 656:b4f3521af846 temporals

updated LiteralTable to include PeriodTable as well and insert Period values to the respective table. Minor changes to PostGISSqlTable also
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Wed Oct 24 17:40:50 2012 +0300 (2012-10-24)
parents 912d14f9ce47
children e3b9342f0914
files generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlTable.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java	Wed Oct 24 17:23:37 2012 +0300
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/LiteralTable.java	Wed Oct 24 17:40:50 2012 +0300
     1.3 @@ -51,6 +51,10 @@
     1.4  	private GeoValueTable geoSpatialTable;
     1.5  	/***************************/
     1.6  
     1.7 +	/***************************/
     1.8 +	private PeriodTable temporalTable;
     1.9 +	/***************************/
    1.10 +	
    1.11  	private int version;
    1.12  
    1.13  	private IdSequence ids;
    1.14 @@ -87,14 +91,24 @@
    1.15  	public void setGeoSpatialTable(GeoValueTable geospatial) {
    1.16  		this.geoSpatialTable = geospatial;
    1.17  	}
    1.18 +	
    1.19 +	/****************************************/
    1.20 +	public void setTemporalTable(PeriodTable temporalTable) {
    1.21 +		this.temporalTable = temporalTable;
    1.22 +	}
    1.23 +
    1.24 +	public void setDatatypeTable(ValueTable datatypes) {
    1.25 +		this.datatypes = datatypes;
    1.26 +	}
    1.27  	/****************************************/
    1.28  
    1.29 +	
    1.30  	public ValueTable getDatatypeTable() {
    1.31  		return datatypes;
    1.32  	}
    1.33  
    1.34 -	public void setDatatypeTable(ValueTable datatypes) {
    1.35 -		this.datatypes = datatypes;
    1.36 +	public PeriodTable getTemporalTable() {
    1.37 +		return temporalTable;
    1.38  	}
    1.39  
    1.40  	public ValueTable getNumericTable() {
    1.41 @@ -129,6 +143,7 @@
    1.42  		dateTime.close();
    1.43  		/**********/
    1.44  		geoSpatialTable.close();
    1.45 +		temporalTable.close();
    1.46  		/**********/
    1.47  	}
    1.48  
    1.49 @@ -168,6 +183,17 @@
    1.50  		datatypes.insert(id, datatype);
    1.51  	}
    1.52  
    1.53 +	/**
    1.54 +	 * @throws InterruptedException 
    1.55 +	 * @throws SQLException 
    1.56 +	 * @throws NullPointerException ******************************************************************/
    1.57 +	public void insertTemporall(Integer id, String label) throws NullPointerException, SQLException, InterruptedException
    1.58 +	{
    1.59 +
    1.60 +		//TODO the label should be validated as a period before reaching this point. Not sure yet on which level this should be done
    1.61 +		temporalTable.insert(id, label);
    1.62 +	}
    1.63 +	
    1.64  	/********************************************************************/
    1.65  	public void insertGeoSpatial(Number id, String label, String datatype,Timestamp start,Timestamp end) throws SQLException, InterruptedException
    1.66  	{
     2.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlTable.java	Wed Oct 24 17:23:37 2012 +0300
     2.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlTable.java	Wed Oct 24 17:40:50 2012 +0300
     2.3 @@ -42,7 +42,7 @@
     2.4  	@Override
     2.5  	public String buildIndexOnPeriodCollumn() {
     2.6  		//return "CREATE INDEX geoindex ON geo_values USING GIST (strdfgeo)";
     2.7 -		return "CREATE INDEX test_period_idx ON periodvalues USING GiST (period)";
     2.8 +		return "CREATE INDEX test_period_idx ON period_values USING GiST (period)";
     2.9  	}
    2.10  	
    2.11  	@Override