Strabon

changeset 939:8827033292b3 temporals

merge
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Wed Mar 27 13:18:46 2013 +0200 (2013-03-27)
parents f247a75a32b9 ebb41816c21b
children a1e2561b7c2c
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 Mar 27 13:18:23 2013 +0200
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Wed Mar 27 13:18:46 2013 +0200
     1.3 @@ -506,11 +506,27 @@
     1.4  		if(format.equals(RDFFormat.NQUADS))
     1.5  		{
     1.6  			String line;
     1.7 +			StringBuilder batch=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(batch.toString(), baseURI, context, format);
    1.16 +					batch = new StringBuilder();
    1.17 +				}
    1.18 +				else
    1.19 +				{
    1.20 +					batch.append("\n").append(line);
    1.21 +				}
    1.22 +			    
    1.23  			}
    1.24 -			
    1.25 +			if(batch.length()>0)
    1.26 +			{
    1.27 +				storeString(batch.toString(), baseURI, context, format);
    1.28 +			}
    1.29 +		
    1.30  			/*NQuadsTranslator translator = new NQuadsTranslator();
    1.31  			Collection<Statement> statements = translator.translate(in, baseURI);
    1.32  			System.out.println("Translated NQUADS to NTRIPLES!");