Strabon

changeset 747:5855c4eeb243 temporals

Valid instants are now supported, apart from valid periods
author konstantina
date Thu Nov 29 00:16:05 2012 +0200 (2012-11-29)
parents e72e4b2412ce
children 3e4cdb6151fc
files runtime/src/main/java/eu/earthobservatory/runtime/generaldb/QuadRDFHandler.java runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java
line diff
     1.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/QuadRDFHandler.java	Wed Nov 28 19:33:02 2012 +0200
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/QuadRDFHandler.java	Thu Nov 29 00:16:05 2012 +0200
     1.3 @@ -53,8 +53,18 @@
     1.4  	         	{	
     1.5  	         	    NQuadsParser parser = new NQuadsParser();
     1.6  	         		try {
     1.7 -					 Resource graph = parser.createValidTimeURI(st.getContext().toString());
     1.8 -					 String triple = "<"+graph.toString()+">"+  " <http://strdf.di.uoa.gr/ontology#hasValidTime> "+ st.getContext().toString()+ " .\n" ;
     1.9 +	         			String context = st.getContext().toString();
    1.10 +						 String validPeriod= context;
    1.11 +						 if(!context.contains(","))
    1.12 +						 {
    1.13 +							 int i = context.indexOf('[')+1;
    1.14 +							 int j = context.indexOf(']');
    1.15 +							 validPeriod = context.replace("]",","+context.substring(i, j)+"]");
    1.16 +							 
    1.17 +						 }
    1.18 +					 Resource graph = parser.createValidTimeURI(validPeriod);
    1.19 +					 
    1.20 +					 String triple = "<"+graph.toString()+">"+  " <http://strdf.di.uoa.gr/ontology#hasValidTime> "+ validPeriod+ " .\n" ;
    1.21  					    triples.append(triple);
    1.22  					} catch (RDFParseException e) {
    1.23  						// TODO Auto-generated catch block
     2.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Wed Nov 28 19:33:02 2012 +0200
     2.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Thu Nov 29 00:16:05 2012 +0200
     2.3 @@ -490,7 +490,16 @@
     2.4  			{
     2.5  				//edw prepei na mpei sunartisi pou na metasximatizei to context an einai temporal
     2.6  				try {
     2.7 -					Resource newContext = new NQuadsParser().createValidTimeURI(st.getContext().toString());
     2.8 +					String cont = st.getContext().toString();
     2.9 +					 String validPeriod= cont;
    2.10 +					 if(!cont.contains(","))
    2.11 +					 {
    2.12 +						 int i = cont.indexOf('[')+1;
    2.13 +						 int j = cont.indexOf(']');
    2.14 +						 validPeriod = cont.replace("]",","+cont.substring(i, j)+"]");
    2.15 +						 
    2.16 +					 }
    2.17 +					Resource newContext = new NQuadsParser().createValidTimeURI(validPeriod);
    2.18  							con1.add(st.getSubject(), st.getPredicate(), st.getObject(), newContext);
    2.19  				} catch (ParseException e) {
    2.20  					// TODO Auto-generated catch block