Strabon

changeset 885:ebb41816c21b temporals

"caching"
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Thu Feb 28 11:11:09 2013 +0200 (2013-02-28)
parents 1fc6edc57974
children 8827033292b3
files runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java
line diff
     1.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Wed Feb 27 20:31:40 2013 +0200
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Thu Feb 28 11:11:09 2013 +0200
     1.3 @@ -504,23 +504,27 @@
     1.4  		if(format.equals(RDFFormat.NQUADS))
     1.5  		{
     1.6  			String line;
     1.7 -			StringBuilder lineToStore=new StringBuilder();
     1.8 +			StringBuilder batch=new StringBuilder();
     1.9  			int counter=0;
    1.10  			BufferedReader br = new BufferedReader(reader);
    1.11  			while ((line = br.readLine()) != null) {
    1.12  				counter++;
    1.13 -				if(counter%500==0)
    1.14 +				if(counter%500 ==0 )
    1.15  				{
    1.16 -					storeString(line, baseURI, context, format);
    1.17 -					lineToStore = new StringBuilder();
    1.18 +					storeString(batch.toString(), baseURI, context, format);
    1.19 +					batch = new StringBuilder();
    1.20  				}
    1.21  				else
    1.22  				{
    1.23 -					lineToStore.append(line);
    1.24 +					batch.append("\n").append(line);
    1.25  				}
    1.26  			    
    1.27  			}
    1.28 -			
    1.29 +			if(batch.length()>0)
    1.30 +			{
    1.31 +				storeString(batch.toString(), baseURI, context, format);
    1.32 +			}
    1.33 +		
    1.34  			/*NQuadsTranslator translator = new NQuadsTranslator();
    1.35  			Collection<Statement> statements = translator.translate(in, baseURI);
    1.36  			System.out.println("Translated NQUADS to NTRIPLES!");