Strabon

changeset 871:57f00dc6208e temporals

added some more tests and modified storeURL function to test the performance of the system when storing files with over a million quads
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Thu Feb 07 17:59:46 2013 +0200 (2013-02-07)
parents 2ee96133646a
children 74ffcfcb691d
files generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBEvaluation.java runtime/src/main/java/eu/earthobservatory/runtime/generaldb/QuadRDFHandler.java runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java runtime/src/test/java/eu/earthobservatory/runtime/postgres/temporals/TemporalRelationTests.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBEvaluation.java	Tue Jan 15 19:58:08 2013 +0200
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/evaluation/GeneralDBEvaluation.java	Thu Feb 07 17:59:46 2013 +0200
     1.3 @@ -522,6 +522,8 @@
     1.4  
     1.5  	public StrabonTemporalElement temporalConstructPicker(Function function, Value left, Value right) throws ParseException
     1.6  	{
     1.7 +		//temporarily commented out the following so that they will be evaluated in postgres temporal and not in Java
     1.8 +		/*
     1.9  		if(function.getURI().equals(TemporalConstants.periodUnion))
    1.10  		{
    1.11  
    1.12 @@ -571,7 +573,7 @@
    1.13  				 rightArg = StrabonInstant.read(right.toString());
    1.14  			}
    1.15  			return StrabonPeriod.intersection(rightArg, leftArg);
    1.16 -		}*/
    1.17 +		}
    1.18  		else if(function.getURI().equals(TemporalConstants.minusPeriod))
    1.19  		{ //this functions takes only periods as arguments
    1.20  			if(!right.toString().contains(",") || !left.toString().contains(","))
    1.21 @@ -599,7 +601,8 @@
    1.22  		else
    1.23  		{
    1.24  			return null;			
    1.25 -		}
    1.26 +		}*/
    1.27 +		return null;
    1.28  	}
    1.29  	
    1.30  	public boolean temporalRelationshipPicker (Function function, Value left, Value right) throws ParseException
     2.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/QuadRDFHandler.java	Tue Jan 15 19:58:08 2013 +0200
     2.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/QuadRDFHandler.java	Thu Feb 07 17:59:46 2013 +0200
     2.3 @@ -65,6 +65,7 @@
     2.4  					 Resource graph = parser.createValidTimeURI(validPeriod);
     2.5  					 
     2.6  					 String triple = "<"+graph.toString()+">"+  " <http://strdf.di.uoa.gr/ontology#hasValidTime> "+ validPeriod+ " .\n" ;
     2.7 +					
     2.8  					 if (!triples.toString().contains(triple))
     2.9  					 {
    2.10  						 triples.append(triple);
     3.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Tue Jan 15 19:58:08 2013 +0200
     3.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Thu Feb 07 17:59:46 2013 +0200
     3.3 @@ -11,6 +11,7 @@
     3.4   */
     3.5  package eu.earthobservatory.runtime.generaldb;
     3.6  
     3.7 +import java.io.BufferedReader;
     3.8  import java.io.ByteArrayInputStream;
     3.9  import java.io.File;
    3.10  import java.io.IOException;
    3.11 @@ -485,7 +486,13 @@
    3.12  		
    3.13  		if(format.equals(RDFFormat.NQUADS))
    3.14  		{
    3.15 -			NQuadsTranslator translator = new NQuadsTranslator();
    3.16 +			String line;
    3.17 +			BufferedReader br = new BufferedReader(reader);
    3.18 +			while ((line = br.readLine()) != null) {
    3.19 +			    storeString(line, baseURI, context, format);
    3.20 +			}
    3.21 +			
    3.22 +			/*NQuadsTranslator translator = new NQuadsTranslator();
    3.23  			Collection<Statement> statements = translator.translate(in, baseURI);
    3.24  			System.out.println("Translated NQUADS to NTRIPLES!");
    3.25  			Iterator iterator = statements.iterator();
    3.26 @@ -513,7 +520,7 @@
    3.27  					e.printStackTrace();
    3.28  				}
    3.29  			}
    3.30 -			
    3.31 +			*/
    3.32  			return;
    3.33  		}
    3.34  
     4.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgres/temporals/TemporalRelationTests.java	Tue Jan 15 19:58:08 2013 +0200
     4.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgres/temporals/TemporalRelationTests.java	Thu Feb 07 17:59:46 2013 +0200
     4.3 @@ -9,7 +9,7 @@
     4.4   */
     4.5  
     4.6  /**
     4.7 - * A set of simple tests on temporal selection functionality 
     4.8 + * 
     4.9   * 
    4.10   * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
    4.11   *