Strabon

changeset 882:6cd4c06a3557 temporals

fixed minor issue with nquads
author Konstantina
date Tue Feb 26 23:27:19 2013 +0200 (2013-02-26)
parents 8b8c2efcc293
children 0a6878442590
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 20 18:18:57 2013 +0200
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Tue Feb 26 23:27:19 2013 +0200
     1.3 @@ -593,7 +593,9 @@
     1.4  			for(Statement st: statements)
     1.5  			{
     1.6  				String cont = st.getContext().toString();
     1.7 -				 String validPeriod= cont;
     1.8 +				if(cont.contains(TemporalConstants.PERIOD) ||cont.contains(TemporalConstants.INSTANT))
     1.9 +				 {
    1.10 +					String validPeriod= cont;
    1.11  				 if(!cont.contains(","))
    1.12  				 {
    1.13  					 int i = cont.indexOf('"')+1;
    1.14 @@ -606,12 +608,17 @@
    1.15  				try {
    1.16  					Resource newContext = new NQuadsParser().createValidTimeURI(validPeriod);
    1.17  					con1.add(st.getSubject(), st.getPredicate(), st.getObject(), newContext);
    1.18 -				} catch (ParseException e) {
    1.19 +				}
    1.20 +				 catch (ParseException e) {
    1.21  					logger.error(this.getClass().toString()+": error when constructing the new context");
    1.22  					e.printStackTrace();
    1.23  				}
    1.24  	
    1.25  			}
    1.26 +			else
    1.27 +			{
    1.28 +				con1.add(st.getSubject(), st.getPredicate(), st.getObject(), st.getContext());
    1.29 +			}
    1.30  			StringReader quadGraphReader = new StringReader(translator.getHandledTriples().toString());
    1.31  			con1.add(quadGraphReader, "", RDFFormat.NTRIPLES);
    1.32  			return;
    1.33 @@ -644,7 +651,7 @@
    1.34  		con1.add(georeader, "", RDFFormat.NTRIPLES);
    1.35  		georeader.close();
    1.36  		logger.info("[Strabon.storeString] Storing was successful.");
    1.37 -	}
    1.38 +	}}
    1.39  
    1.40  	public void describe(String describeString, String format, SailRepositoryConnection con, OutputStream out) throws MalformedQueryException
    1.41  	{