Strabon

changeset 223:1e9ab0c41d50

cleaned messages during store in Strabon
author Babis Nikolaou <charnik@di.uoa.gr>
date Fri Jun 01 14:08:48 2012 +0300 (2012-06-01)
parents 95960607715a
children fd43d9f83de7
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	Fri Jun 01 13:50:20 2012 +0300
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Fri Jun 01 14:08:48 2012 +0300
     1.3 @@ -866,14 +866,15 @@
     1.4  		handler.startRDF();
     1.5  		parser.setRDFHandler(handler);
     1.6  		parser.parse(reader, "");
     1.7 -		logger.info("[Strabon.storeFile] Triples inferred:"+ handler.getTriples().toString());
     1.8 +		logger.info("[Strabon.storeFile] Inferred " + handler.getNumberOfTriples() + " triples.");
     1.9 +		if (handler.getNumberOfTriples() > 0) {
    1.10 +			logger.info("[Strabon.storeFile] Triples inferred:"+ handler.getTriples().toString());
    1.11 +		}
    1.12  		StringReader georeader= new StringReader(handler.getTriples().toString());
    1.13  		handler.endRDF();
    1.14  		if (context == null) {
    1.15 -			logger.info("[Strabon.storeFile] [1]");
    1.16  			con1.add(file, baseURI, format);
    1.17  		} else {
    1.18 -			logger.info("[Strabon.storeFile] [2]");
    1.19  			con1.add(file, baseURI, format, context);
    1.20  		}
    1.21  		con1.add(georeader, "", RDFFormat.NTRIPLES);
    1.22 @@ -894,15 +895,16 @@
    1.23  		handler.startRDF();
    1.24  		parser.setRDFHandler(handler);
    1.25  		parser.parse(reader, "");
    1.26 -		logger.info("[Strabon.storeURL] These are the extra triples:"+ handler.getTriples().toString());
    1.27 +		logger.info("[Strabon.storeURL] Inferred " + handler.getNumberOfTriples() + " triples.");
    1.28 +		if (handler.getNumberOfTriples() > 0) {
    1.29 +			logger.info("[Strabon.storeURL] Triples inferred:"+ handler.getTriples().toString());
    1.30 +		}
    1.31  		StringReader georeader= new StringReader(handler.getTriples().toString());
    1.32  		handler.endRDF();
    1.33  
    1.34  		if (context == null) {
    1.35 -			logger.info("[Strabon.storeURL] [3]");
    1.36  			con1.add(url, baseURI, format);
    1.37  		} else {
    1.38 -			logger.info("[Strabon.storeURL] [4]");
    1.39  			con1.add(url, baseURI, format, context);
    1.40  		}
    1.41  		con1.add(georeader, "", RDFFormat.NTRIPLES);
    1.42 @@ -925,17 +927,17 @@
    1.43  		handler.startRDF();
    1.44  		parser.setRDFHandler(handler);
    1.45  		parser.parse(reader, "");
    1.46 -		logger.info("[Strabon.storeString] These are the extra triples:"+ handler.getTriples().toString());
    1.47 +		logger.info("[Strabon.storeString] Inferred " + handler.getNumberOfTriples() + " triples.");
    1.48 +		if (handler.getNumberOfTriples() > 0) {
    1.49 +			logger.info("[Strabon.storeString] Triples inferred:"+ handler.getTriples().toString());
    1.50 +		}
    1.51  		StringReader georeader= new StringReader(handler.getTriples().toString());
    1.52  		handler.endRDF();
    1.53  
    1.54 -
    1.55  		if (context == null) {
    1.56 -			logger.info("[Strabon.storeString] [5]");
    1.57  			con1.add(reader, baseURI, format);
    1.58  			reader.close();
    1.59  		} else {
    1.60 -			logger.info("[Strabon.storeString] [6]");
    1.61  			con1.add(reader, baseURI, format, context);
    1.62  			reader.close();
    1.63  		}