Strabon

changeset 884:1fc6edc57974 temporals

using batches to store large nquad files
author Konstantina
date Wed Feb 27 20:31:40 2013 +0200 (2013-02-27)
parents 0a6878442590
children ebb41816c21b
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 18:49:27 2013 +0200
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Wed Feb 27 20:31:40 2013 +0200
     1.3 @@ -504,9 +504,21 @@
     1.4  		if(format.equals(RDFFormat.NQUADS))
     1.5  		{
     1.6  			String line;
     1.7 +			StringBuilder lineToStore=new StringBuilder();
     1.8 +			int counter=0;
     1.9  			BufferedReader br = new BufferedReader(reader);
    1.10  			while ((line = br.readLine()) != null) {
    1.11 -			    storeString(line, baseURI, context, format);
    1.12 +				counter++;
    1.13 +				if(counter%500==0)
    1.14 +				{
    1.15 +					storeString(line, baseURI, context, format);
    1.16 +					lineToStore = new StringBuilder();
    1.17 +				}
    1.18 +				else
    1.19 +				{
    1.20 +					lineToStore.append(line);
    1.21 +				}
    1.22 +			    
    1.23  			}
    1.24  			
    1.25  			/*NQuadsTranslator translator = new NQuadsTranslator();