Strabon

changeset 1159:48fc6fd46980 temporals

added "hasValidTime" property of strdf as constant in the vocabulary.
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Wed May 08 20:26:55 2013 +0300 (2013-05-08)
parents ef429743d55a
children e6f71db0955e
files runtime/src/main/java/eu/earthobservatory/runtime/generaldb/QuadRDFHandler.java runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java runtime/src/main/java/eu/earthobservatory/runtime/generaldb/utils.java vocab/src/main/java/eu/earthobservatory/constants/TemporalConstants.java
line diff
     1.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/QuadRDFHandler.java	Wed May 08 20:15:41 2013 +0300
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/QuadRDFHandler.java	Wed May 08 20:26:55 2013 +0300
     1.3 @@ -83,11 +83,10 @@
     1.4  						 }
     1.5  					 Resource graph = parser.createValidTimeURI(validPeriod);
     1.6  					 
     1.7 -					 String triple = "<"+graph.toString()+">"+  " <http://strdf.di.uoa.gr/ontology#hasValidTime> "+ validPeriod+ " .\n" ;
     1.8 +					 String triple = "<"+graph.toString()+">"+  TemporalConstants.VALID_TIME_PROPERTY + validPeriod+ " .\n" ;
     1.9  				
    1.10  					 try {
    1.11 -						//connection.add(new URIImpl("<"+graph.toString()+">"),new URIImpl(" <http://strdf.di.uoa.gr/ontology#hasValidTime>"), new URIImpl(validPeriod));
    1.12 -					   StringReader reader = new StringReader(triple);
    1.13 +						 StringReader reader = new StringReader(triple);
    1.14  						 connection.add(reader, "null", RDFFormat.NTRIPLES);
    1.15  					 } catch (RepositoryException e) {
    1.16  						// TODO Auto-generated catch block
     2.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Wed May 08 20:15:41 2013 +0300
     2.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Wed May 08 20:26:55 2013 +0300
     2.3 @@ -359,7 +359,7 @@
     2.4  				String[] token = quadruple.split("(\\s)+");
     2.5  	
     2.6  				newQueryString+="\n GRAPH "+graphVariable+numOfQuadruples+" { " +token[0]+" "+token[1]+" "+token[2]+" .}\n";
     2.7 -				newQueryString+=graphVariable+numOfQuadruples+" <http://strdf.di.uoa.gr/ontology#hasValidTime>";
     2.8 +				newQueryString+=graphVariable+numOfQuadruples+" TemporalConstants.VALID_TIME_PROPERTY";
     2.9  				
    2.10  				//add the rest tokens
    2.11  				for( int i=3; i<token.length; i++)
     3.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/utils.java	Wed May 08 20:15:41 2013 +0300
     3.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/utils.java	Wed May 08 20:26:55 2013 +0300
     3.3 @@ -22,6 +22,8 @@
     3.4  import org.slf4j.Logger;
     3.5  import org.slf4j.LoggerFactory;
     3.6  
     3.7 +import eu.earthobservatory.constants.TemporalConstants;
     3.8 +
     3.9  public class utils {
    3.10  	
    3.11  	private static Logger logger = LoggerFactory.getLogger(eu.earthobservatory.runtime.generaldb.Strabon.class);
    3.12 @@ -114,14 +116,14 @@
    3.13  				{
    3.14  					String tgraph =  "<"+parser.createValidTimeURI(token[3]).toString()+">";
    3.15  					newQueryString+="\n GRAPH "+tgraph+" { " +token[0]+" "+token[1]+" "+token[2]+" .}\n";
    3.16 -					newQueryString+= tgraph+" <http://strdf.di.uoa.gr/ontology#hasValidTime>";
    3.17 +					newQueryString+= tgraph+ TemporalConstants.VALID_TIME_PROPERTY;
    3.18  					i=3;
    3.19  	
    3.20  				}
    3.21  				else
    3.22  				{
    3.23  					String tgraph=null;
    3.24 -					//String addedPattern = graphVariable+numOfQuadruples+ " <http://strdf.di.uoa.gr/ontology#hasValidTime>"+ token[3];
    3.25 +					//String addedPattern = graphVariable+numOfQuadruples+ " TemporalConstants.VALID_TIME_PROPERTY"+ token[3];
    3.26  					if(periodsAndGraphs.containsKey(token[3]))
    3.27  					{
    3.28  						tgraph = periodsAndGraphs.get(token[3]);
    3.29 @@ -143,7 +145,7 @@
    3.30  					{
    3.31  				
    3.32  						newQueryString+="\n GRAPH "+tgraph+" { " +token[0]+" "+token[1]+" "+token[2]+" .}\n";
    3.33 -						newQueryString+=tgraph+" <http://strdf.di.uoa.gr/ontology#hasValidTime>";
    3.34 +						newQueryString+=tgraph+ TemporalConstants.VALID_TIME_PROPERTY;
    3.35  						i=3;
    3.36  					
    3.37  					}
     4.1 --- a/vocab/src/main/java/eu/earthobservatory/constants/TemporalConstants.java	Wed May 08 20:15:41 2013 +0300
     4.2 +++ b/vocab/src/main/java/eu/earthobservatory/constants/TemporalConstants.java	Wed May 08 20:26:55 2013 +0300
     4.3 @@ -24,7 +24,7 @@
     4.4  	
     4.5  	public static final String UNTIL_CHANGED = "UC";
     4.6  	public static final String UNTIL_CHANGED_VALUE = "9999-9-9:00:00:00";
     4.7 -	
     4.8 +	public static final String VALID_TIME_PROPERTY = "<http://strdf.di.uoa.gr/ontology#hasValidTime>";
     4.9  	
    4.10  	//Temporal Relationships
    4.11  	public static final String periodContains= stRDF+ "PeriodContains";