Strabon
changeset 950:b473371456f0 temporals
added modified the tests for the previously mentioned functions
author | Konstantina Bereta <Konstantina.Bereta@di.uoa.gr> |
---|---|
date | Fri Mar 29 18:11:22 2013 +0200 (2013-03-29) |
parents | b4da61de4970 |
children | ef699a403d15 |
files | generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlPeriodIntersects.java runtime/src/test/java/eu/earthobservatory/runtime/postgres/temporals/TemporalRelationTests.java |
line diff
1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlPeriodIntersects.java Fri Mar 29 17:52:10 2013 +0200 1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlPeriodIntersects.java Fri Mar 29 18:11:22 2013 +0200 1.3 @@ -37,7 +37,7 @@ 1.4 @Override 1.5 public String getPostgresFunction() { 1.6 1.7 - return "intersects"; 1.8 + return "overlaps"; 1.9 } 1.10 1.11 } 1.12 \ No newline at end of file
2.1 --- a/runtime/src/test/java/eu/earthobservatory/runtime/postgres/temporals/TemporalRelationTests.java Fri Mar 29 17:52:10 2013 +0200 2.2 +++ b/runtime/src/test/java/eu/earthobservatory/runtime/postgres/temporals/TemporalRelationTests.java Fri Mar 29 18:11:22 2013 +0200 2.3 @@ -320,6 +320,37 @@ 2.4 } 2.5 2.6 @Test 2.7 + public void testPeriodIntersects() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, QueryEvaluationException 2.8 + { 2.9 + 2.10 + String query = 2.11 + prefixes+ 2.12 + "SELECT distinct ?x1 ?x2 "+ 2.13 + "WHERE { "+ 2.14 + "?x1 ?y1 ?z1 ?t1 . "+ 2.15 + "?x2 ?y2 ?z2 ?t2 . "+ 2.16 + "FILTER(strdf:PeriodIntersects(?t1, ?t2) && str(?x1) != str(?x2))."+ 2.17 + "}"; 2.18 + 2.19 + ArrayList<String> bindings = (ArrayList<String>) strabon.query(strabon.queryRewriting(query),strabon.getSailRepoConnection()); 2.20 + 2.21 + //assertEquals(6, bindings.size()); 2.22 + //assertTrue(-1 < bindings.indexOf("")); 2.23 + for(String result: bindings) 2.24 + { 2.25 + System.out.println(result.toString()); 2.26 + } 2.27 + 2.28 + /*assertTrue(-1 < bindings.indexOf("[x2=http://example.org/item7;x1=http://example.org/item3]")); 2.29 + assertTrue(-1 < bindings.indexOf("[x2=http://example.org/item7;x1=http://example.org/item1]")); 2.30 + assertTrue(-1 < bindings.indexOf("[x2=http://example.org/item3;x1=http://example.org/item2]")); 2.31 + assertTrue(-1 < bindings.indexOf("[x2=http://example.org/item1;x1=http://example.org/item2]")); 2.32 + assertTrue(-1 < bindings.indexOf("[x2=http://example.org/item7;x1=http://example.org/item2]")); 2.33 + assertTrue(-1 < bindings.indexOf("[x2=http://example.org/item8;x1=http://example.org/item2]")); 2.34 + */ 2.35 + } 2.36 + 2.37 + @Test 2.38 public void testDuring() throws MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, IOException, QueryEvaluationException 2.39 { 2.40