Strabon

changeset 722:6e2902c90aa2 temporals

Performing an inner join with temporal table each time a temporal variable is encountered
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Thu Nov 22 12:43:46 2012 +0200 (2012-11-22)
parents c8d5507ab17e
children 4caf7b892022
files generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBValueJoinOptimizer.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBValueJoinOptimizer.java	Thu Nov 22 12:41:19 2012 +0200
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/optimizers/GeneralDBValueJoinOptimizer.java	Thu Nov 22 12:43:46 2012 +0200
     1.3 @@ -52,7 +52,6 @@
     1.4  	private URITable uris;
     1.5  
     1.6  	private BNodeTable bnodes;
     1.7 -
     1.8  	private LiteralTable literals;
     1.9  
    1.10  	private HashTable hashes;
    1.11 @@ -180,7 +179,7 @@
    1.12  			{
    1.13  		GeneralDBColumnVar var = node.getRdbmsVar();
    1.14  		//XXX If spatial, I don't want this action to take place
    1.15 -		if(!var.isSpatial() && !var.isSpatial())
    1.16 +		if(!var.isSpatial() && !var.isTemporal())
    1.17  		{
    1.18  			String alias = "d" + getDBName(var);
    1.19  			String tableName = literals.getDatatypeTable().getName();
    1.20 @@ -220,13 +219,8 @@
    1.21  		String alias = "l" + getDBName(var);
    1.22  		String tableName;
    1.23  		//XXX If spatial, I want to join with geo_values
    1.24 -		if(!var.isSpatial())
    1.25 -		{
    1.26 -			//String alias = "l" + getDBName(var);
    1.27 -			tableName = literals.getLabelTable().getName();
    1.28 -			join(var, alias, tableName);
    1.29 -		}
    1.30 -		else
    1.31 +		
    1.32 +		if(var.isSpatial())
    1.33  		{
    1.34  			//FIXME temporary try
    1.35  			//String alias = ""+getDBName(var).subSequence(1, getDBName(var).length());
    1.36 @@ -236,6 +230,17 @@
    1.37  			join(var,alias,tableName,false);
    1.38  
    1.39  		}
    1.40 +		else if(var.isTemporal())
    1.41 +		{
    1.42 +			tableName= "period_values";
    1.43 +			join(var,alias,tableName,false);
    1.44 +		}
    1.45 +		else
    1.46 +		{
    1.47 +			//String alias = "l" + getDBName(var);
    1.48 +			tableName = literals.getLabelTable().getName();
    1.49 +			join(var, alias, tableName);
    1.50 +		}
    1.51  
    1.52  			}
    1.53