Strabon

changeset 886:ffd0338e5af3 temporals

Reverted some files to revision 874.
author Panayiotis Smeros <psmeros@di.uoa.gr>
date Tue Mar 05 19:35:48 2013 +0200 (2013-03-05)
parents 0a6878442590
children b1d4a5dfe6b3
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	Tue Mar 05 19:35:48 2013 +0200
     1.3 @@ -491,8 +491,10 @@
     1.4  		logger.info("[Strabon.storeURL] Storing file.");
     1.5  		logger.info("[Strabon.storeURL] URL      : {}", url.toString());
     1.6  		logger.info("[Strabon.storeURL] Context  : {}", ((context == null) ? "default" : context));
     1.7 -		logger.info("[Strabon.storeURL] Base URI : {}", ((baseURI == null) ? "null" : baseURI));
     1.8 -		logger.info("[Strabon.storeURL] Format   : {}", ((format == null) ? "null" : format));
     1.9 +		if (logger.isDebugEnabled()) {
    1.10 +			logger.debug("[Strabon.storeURL] Base URI : {}", ((baseURI == null) ? url.toExternalForm() : baseURI));
    1.11 +			logger.debug("[Strabon.storeURL] Format   : {}", ((format == null) ? "null" : format));
    1.12 +		}
    1.13  
    1.14  		InputStream in = (InputStream) url.openStream();
    1.15  		InputStreamReader reader = new InputStreamReader(in);
    1.16 @@ -591,9 +593,7 @@
    1.17  			for(Statement st: statements)
    1.18  			{
    1.19  				String cont = st.getContext().toString();
    1.20 -				if(cont.contains(TemporalConstants.PERIOD) ||cont.contains(TemporalConstants.INSTANT))
    1.21 -				 {
    1.22 -					String validPeriod= cont;
    1.23 +				 String validPeriod= cont;
    1.24  				 if(!cont.contains(","))
    1.25  				 {
    1.26  					 int i = cont.indexOf('"')+1;
    1.27 @@ -606,17 +606,12 @@
    1.28  				try {
    1.29  					Resource newContext = new NQuadsParser().createValidTimeURI(validPeriod);
    1.30  					con1.add(st.getSubject(), st.getPredicate(), st.getObject(), newContext);
    1.31 -				}
    1.32 -				 catch (ParseException e) {
    1.33 +				} catch (ParseException e) {
    1.34  					logger.error(this.getClass().toString()+": error when constructing the new context");
    1.35  					e.printStackTrace();
    1.36  				}
    1.37  	
    1.38  			}
    1.39 -			else
    1.40 -			{
    1.41 -				con1.add(st.getSubject(), st.getPredicate(), st.getObject(), st.getContext());
    1.42 -			}
    1.43  			StringReader quadGraphReader = new StringReader(translator.getHandledTriples().toString());
    1.44  			con1.add(quadGraphReader, "", RDFFormat.NTRIPLES);
    1.45  			return;
    1.46 @@ -649,7 +644,7 @@
    1.47  		con1.add(georeader, "", RDFFormat.NTRIPLES);
    1.48  		georeader.close();
    1.49  		logger.info("[Strabon.storeString] Storing was successful.");
    1.50 -	}}
    1.51 +	}
    1.52  
    1.53  	public void describe(String describeString, String format, SailRepositoryConnection con, OutputStream out) throws MalformedQueryException
    1.54  	{