Strabon

changeset 720:4ce80f842ff1 temporals

did the same for the storeString case,too
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Tue Nov 20 19:52:28 2012 +0200 (2012-11-20)
parents 81eb9705a751
children c8d5507ab17e
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	Tue Nov 20 19:48:47 2012 +0200
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Tue Nov 20 19:52:28 2012 +0200
     1.3 @@ -482,7 +482,6 @@
     1.4  			{
     1.5  				//edw prepei na mpei sunartisi pou na metasximatizei to context an einai temporal
     1.6  				try {
     1.7 -					int length= st.getContext().toString().length();
     1.8  					Resource newContext = new NQuadsParser().createValidTimeURI(st.getContext().toString());
     1.9  							con1.add(st.getSubject(), st.getPredicate(), st.getObject(), newContext);
    1.10  				} catch (ParseException e) {
    1.11 @@ -539,16 +538,19 @@
    1.12  		{
    1.13  			ByteArrayInputStream in = new ByteArrayInputStream(text.getBytes());
    1.14  			NQuadsTranslator translator = new NQuadsTranslator();
    1.15 -		//	 final ByteArrayInputStream bais = new ByteArrayInputStream(i);
    1.16  						 
    1.17  			Collection<Statement> statements = translator.translate(in, baseURI);
    1.18  			Iterator iterator = statements.iterator();
    1.19  			for(Statement st: statements)
    1.20  			{
    1.21 -				//edw prepei na mpei sunartisi pou na metasximatizei to context an einai temporal
    1.22 -				con1.add(st.getSubject(), st.getPredicate(), st.getObject(), st.getContext());
    1.23 -				System.out.println("STATEMENT: "+st.toString());
    1.24 -				System.out.println("CONTEXT: "+st.getContext().toString());
    1.25 +				try {
    1.26 +					Resource newContext = new NQuadsParser().createValidTimeURI(st.getContext().toString());
    1.27 +					con1.add(st.getSubject(), st.getPredicate(), st.getObject(), newContext);
    1.28 +				} catch (ParseException e) {
    1.29 +					logger.error(this.getClass().toString()+": error when constructing the new context");
    1.30 +					e.printStackTrace();
    1.31 +				}
    1.32 +	
    1.33  			}
    1.34  			StringReader quadGraphReader = new StringReader(translator.getHandledTriples().toString());
    1.35  			con1.add(quadGraphReader, "", RDFFormat.NTRIPLES);