Strabon

changeset 742:c9cf73b38b54 temporals

Comments can be everywhere!
author Panayiotis Smeros <psmeros@di.uoa.gr>
date Wed Nov 28 17:51:08 2012 +0200 (2012-11-28)
parents 60a14eba94dd
children 6b543070da6f 0aeaab276850
files runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java runtime/src/test/java/eu/earthobservatory/runtime/postgis/temporals/QueryRewritingTests.java
line diff
     1.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Tue Nov 27 20:08:56 2012 +0200
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Wed Nov 28 17:51:08 2012 +0200
     1.3 @@ -295,7 +295,7 @@
     1.4  			graphVariable+="_";
     1.5  			
     1.6  			//remove comments from query
     1.7 -			String REGEX = "((^(\\s)*#)|((\\s)+#)).*$";
     1.8 +			String REGEX = "((^(\\s)*#)|((\\s)*#)).*$";
     1.9  			Pattern pattern = Pattern.compile(REGEX, Pattern.MULTILINE);							
    1.10  			Matcher matcher = pattern.matcher(queryString);
    1.11  			String oldQueryString=matcher.replaceAll("");
     2.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgis/temporals/QueryRewritingTests.java	Tue Nov 27 20:08:56 2012 +0200
     2.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgis/temporals/QueryRewritingTests.java	Wed Nov 28 17:51:08 2012 +0200
     2.3 @@ -118,4 +118,20 @@
     2.4  		String [] querySplit=strabon.queryRewriting(query).split("GRAPH");		
     2.5  		assertEquals(3, querySplit.length);
     2.6  	}
     2.7 +	
     2.8 +	@Test
     2.9 +	public void testQueryRewriting4() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, QueryEvaluationException
    2.10 +	{
    2.11 +	
    2.12 +		String query = 
    2.13 +			prefixes+
    2.14 +			"select distinct ?s1 ?s2" +
    2.15 +			"where {" +
    2.16 +			"?s1 ?p1 ?ro1 ?o1 ." +
    2.17 +			"#?s2 ?p2 ?ro2 ?o2 ." +
    2.18 +			"FILTER(strdf:PeriodOverlaps(?o1, \"[2012-11-19 12:41:00+02, 2012-11-19 13:41:00.000001+02]\"^^<http://strdf.di.uoa.gr/ontology#validTime> ))";
    2.19 +		
    2.20 +		String [] querySplit=strabon.queryRewriting(query).split("GRAPH");
    2.21 +		assertEquals(2, querySplit.length);
    2.22 +	}
    2.23  }