Strabon

changeset 814:5f0ed03631ee temporals

implemented createTemporalValue
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Tue Dec 18 12:30:01 2012 +0200 (2012-12-18)
parents 32e6314a2c4b
children d400062a70f6
files generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBLabelColumn.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBLongLabelColumn.java postgis/src/main/java/org/openrdf/sail/postgis/iteration/PostGISBindingIteration.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBLabelColumn.java	Mon Dec 17 16:24:48 2012 +0200
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBLabelColumn.java	Tue Dec 18 12:30:01 2012 +0200
     1.3 @@ -52,6 +52,10 @@
     1.4  		{
     1.5  			setSpatial(true);
     1.6  		}
     1.7 +		else if(var.isTemporal())
     1.8 +		{
     1.9 +			setTemporal(true);
    1.10 +		}
    1.11  		
    1.12  	}
    1.13  	
    1.14 @@ -61,6 +65,8 @@
    1.15  		setSpatial(isSpatial);
    1.16  	}
    1.17  
    1.18 +
    1.19 +
    1.20  	public boolean isSpatial() {
    1.21  		return spatial;
    1.22  	}
    1.23 @@ -73,8 +79,8 @@
    1.24  		return temporal;
    1.25  	}
    1.26  
    1.27 -	public void setTemporal(boolean spatial) {
    1.28 -		this.temporal = spatial;
    1.29 +	public void setTemporal(boolean temporal) {
    1.30 +		this.temporal = temporal;
    1.31  	}
    1.32  
    1.33  	
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBLongLabelColumn.java	Mon Dec 17 16:24:48 2012 +0200
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/GeneralDBLongLabelColumn.java	Tue Dec 18 12:30:01 2012 +0200
     2.3 @@ -57,6 +57,9 @@
     2.4  	public void setSpatial(boolean spatial) {
     2.5  		this.spatial = spatial;
     2.6  	}
     2.7 +	public void setTemporal(boolean temporal) {
     2.8 +		this.spatial = temporal;
     2.9 +	}
    2.10  
    2.11  	@Override
    2.12  	public <X extends Exception> void visit(GeneralDBQueryModelVisitorBase<X> visitor)
     3.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/iteration/PostGISBindingIteration.java	Mon Dec 17 16:24:48 2012 +0200
     3.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/iteration/PostGISBindingIteration.java	Tue Dec 18 12:30:01 2012 +0200
     3.3 @@ -10,10 +10,13 @@
     3.4  import java.sql.ResultSet;
     3.5  import java.sql.SQLException;
     3.6  
     3.7 +import org.openrdf.model.URI;
     3.8  import org.openrdf.query.BindingSet;
     3.9  import org.openrdf.query.algebra.evaluation.function.spatial.GeoConstants;
    3.10 +import org.openrdf.query.algebra.evaluation.function.temporal.stsparql.relation.TemporalConstants;
    3.11  import org.openrdf.sail.generaldb.iteration.GeneralDBBindingIteration;
    3.12  import org.openrdf.sail.generaldb.model.GeneralDBPolyhedron;
    3.13 +import org.openrdf.sail.rdbms.model.RdbmsLiteral;
    3.14  import org.openrdf.sail.rdbms.model.RdbmsValue;
    3.15  
    3.16  /**
    3.17 @@ -60,10 +63,15 @@
    3.18  	protected RdbmsValue createTemporalValue(ResultSet rs, int index)
    3.19  	throws SQLException
    3.20  	{
    3.21 -//TODO implement method 
    3.22 -//		System.out.println("CREATE TEMPORAL VALUE!");
    3.23 -
    3.24 -		return null;
    3.25 +		Number id = ids.idOf(rs.getLong(index));
    3.26 +		if (ids.isLiteral(id))
    3.27 +		{
    3.28 +			String label = rs.getObject(index+1).toString();
    3.29 +		    URI datatype = vf.createURI(TemporalConstants.PERIOD);
    3.30 +		    return vf.createLiteral(label, datatype);
    3.31 +		    
    3.32 +		}
    3.33 +		return createResource(rs, index);
    3.34  	}
    3.35  
    3.36