Strabon

changeset 1468:31466cac9cec temporals

added correct queries and results for the rest functions that are not supported by PostgreSQL Temporal.
Also modified the name of the respective SQL function in order to comply with the script that contains
Allen's functions.
author Stella Giannakopoulou <sgian@di.uoa.gr>
date Fri Jan 23 18:40:23 2015 +0200 (2015-01-23)
parents d4387b73ec9a
children ea73ab0bcc3d
files generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlFinishes.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlPeriodIntersects.java generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlStarts.java testsuite/src/test/java/eu/earthobservatory/testsuite/stSPARQL/TemporalRelations.java testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/finishes.rq testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/finishes.srx testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/meets.srx testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/nestedOverleft.srx testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/periodIntersects.rq testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/periodIntersects.srx testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/starts.srx
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlFinishes.java	Thu Jan 22 19:33:24 2015 +0200
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlFinishes.java	Fri Jan 23 18:40:23 2015 +0200
     1.3 @@ -36,7 +36,7 @@
     1.4  	@Override
     1.5  	public String getPostgresFunction() {
     1.6  		// TODO Auto-generated method stub
     1.7 -		return "finishesAllen";
     1.8 +		return "finishes";
     1.9  	}
    1.10  
    1.11  }
    1.12 \ No newline at end of file
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlPeriodIntersects.java	Thu Jan 22 19:33:24 2015 +0200
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlPeriodIntersects.java	Fri Jan 23 18:40:23 2015 +0200
     2.3 @@ -9,7 +9,6 @@
     2.4   */
     2.5  package org.openrdf.sail.generaldb.algebra.temporal;
     2.6  
     2.7 -import org.openrdf.sail.generaldb.algebra.GeneralDBSqlGeoSpatial;
     2.8  import org.openrdf.sail.generaldb.algebra.base.GeneralDBSqlExpr;
     2.9  
    2.10  /**
     3.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlStarts.java	Thu Jan 22 19:33:24 2015 +0200
     3.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/algebra/temporal/GeneralDBSqlStarts.java	Fri Jan 23 18:40:23 2015 +0200
     3.3 @@ -36,7 +36,7 @@
     3.4  	@Override
     3.5  	public String getPostgresFunction() {
     3.6  		// TODO Auto-generated method stub
     3.7 -		return "startsAllen";
     3.8 +		return "starts";
     3.9  	}
    3.10  
    3.11  }
    3.12 \ No newline at end of file
     4.1 --- a/testsuite/src/test/java/eu/earthobservatory/testsuite/stSPARQL/TemporalRelations.java	Thu Jan 22 19:33:24 2015 +0200
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,20 +0,0 @@
     4.4 -/**
     4.5 - * This Source Code Form is subject to the terms of the Mozilla Public
     4.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this
     4.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     4.8 - * 
     4.9 - * Copyright (C) 2010, 2011, 2012, 2013 Pyravlos Team
    4.10 - * 
    4.11 - * http://www.strabon.di.uoa.gr/
    4.12 - */
    4.13 -package eu.earthobservatory.testsuite.stSPARQL;
    4.14 -
    4.15 -import eu.earthobservatory.testsuite.utils.TemplateTest;
    4.16 -
    4.17 -
    4.18 -/**
    4.19 - * A simple store test. It tests if triples with GML serialization are stored and retrieved correctly.
    4.20 - * 
    4.21 - * @author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
    4.22 - */
    4.23 -public class TemporalRelations extends TemplateTest{}
     5.1 --- a/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/finishes.rq	Thu Jan 22 19:33:24 2015 +0200
     5.2 +++ b/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/finishes.rq	Fri Jan 23 18:40:23 2015 +0200
     5.3 @@ -1,7 +1,3 @@
     5.4 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
     5.5 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
     5.6 -PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 
     5.7 -
     5.8  SELECT distinct ?x1 ?x2 
     5.9  			WHERE { 
    5.10  				?x1 ?y1 ?z1 ?t1 .
     6.1 --- a/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/finishes.srx	Thu Jan 22 19:33:24 2015 +0200
     6.2 +++ b/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/finishes.srx	Fri Jan 23 18:40:23 2015 +0200
     6.3 @@ -5,5 +5,37 @@
     6.4  		<variable name='x2'/>
     6.5  	</head>
     6.6  	<results>
     6.7 +		<result>
     6.8 +			<binding name='x1'>
     6.9 +				<uri>http://example.org/item1</uri>
    6.10 +			</binding>
    6.11 +			<binding name='x2'>
    6.12 +				<uri>http://example.org/item2</uri>
    6.13 +			</binding>
    6.14 +		</result>
    6.15 +		<result>
    6.16 +			<binding name='x1'>
    6.17 +				<uri>http://example.org/item1</uri>
    6.18 +			</binding>
    6.19 +			<binding name='x2'>
    6.20 +				<uri>http://example.org/item3</uri>
    6.21 +			</binding>
    6.22 +		</result>
    6.23 +		<result>
    6.24 +			<binding name='x1'>
    6.25 +				<uri>http://example.org/item2</uri>
    6.26 +			</binding>
    6.27 +			<binding name='x2'>
    6.28 +				<uri>http://example.org/item3</uri>
    6.29 +			</binding>
    6.30 +		</result>
    6.31 +		<result>
    6.32 +			<binding name='x1'>
    6.33 +				<uri>http://example.org/item2</uri>
    6.34 +			</binding>
    6.35 +			<binding name='x2'>
    6.36 +				<uri>http://example.org/item8</uri>
    6.37 +			</binding>
    6.38 +		</result>
    6.39  	</results>
    6.40  </sparql>
     7.1 --- a/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/meets.srx	Thu Jan 22 19:33:24 2015 +0200
     7.2 +++ b/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/meets.srx	Fri Jan 23 18:40:23 2015 +0200
     7.3 @@ -6,28 +6,36 @@
     7.4  	</head>
     7.5  	<results>
     7.6  		<result>
     7.7 +			<binding name='x1'>
     7.8 +				<uri>http://example.org/item1</uri>
     7.9 +			</binding>
    7.10  			<binding name='x2'>
    7.11  				<uri>http://example.org/item7</uri>
    7.12  			</binding>
    7.13 +		</result>
    7.14 +		<result>
    7.15 +			<binding name='x1'>
    7.16 +				<uri>http://example.org/item2</uri>
    7.17 +			</binding>
    7.18 +			<binding name='x2'>
    7.19 +				<uri>http://example.org/item7</uri>
    7.20 +			</binding>
    7.21 +		</result>
    7.22 +		<result>
    7.23  			<binding name='x1'>
    7.24  				<uri>http://example.org/item3</uri>
    7.25  			</binding>
    7.26 -		</result>
    7.27 -		<result>
    7.28  			<binding name='x2'>
    7.29  				<uri>http://example.org/item7</uri>
    7.30  			</binding>
    7.31 -			<binding name='x1'>
    7.32 -				<uri>http://example.org/item1</uri>
    7.33 -			</binding>
    7.34  		</result>
    7.35  		<result>
    7.36 -			<binding name='x2'>
    7.37 +			<binding name='x1'>
    7.38  				<uri>http://example.org/item7</uri>
    7.39  			</binding>
    7.40 -			<binding name='x1'>
    7.41 -				<uri>http://example.org/item2</uri>
    7.42 +			<binding name='x2'>
    7.43 +				<uri>http://example.org/item8</uri>
    7.44  			</binding>
    7.45  		</result>
    7.46  	</results>
    7.47 -</sparql>
    7.48 +</sparql>
    7.49 \ No newline at end of file
     8.1 --- a/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/nestedOverleft.srx	Thu Jan 22 19:33:24 2015 +0200
     8.2 +++ b/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/nestedOverleft.srx	Fri Jan 23 18:40:23 2015 +0200
     8.3 @@ -6,12 +6,12 @@
     8.4  	<results>
     8.5  		<result>
     8.6  			<binding name='node'>
     8.7 -				<uri>http://example.org/item2</uri>
     8.8 +				<uri>http://example.org/item1</uri>
     8.9  			</binding>
    8.10  		</result>
    8.11  		<result>
    8.12  			<binding name='node'>
    8.13 -				<uri>http://example.org/item1</uri>
    8.14 +				<uri>http://example.org/item2</uri>
    8.15  			</binding>
    8.16  		</result>
    8.17  		<result>
    8.18 @@ -19,5 +19,10 @@
    8.19  				<uri>http://example.org/item3</uri>
    8.20  			</binding>
    8.21  		</result>
    8.22 +		<result>
    8.23 +			<binding name='node'>
    8.24 +				<uri>http://example.org/item7</uri>
    8.25 +			</binding>
    8.26 +		</result>
    8.27  	</results>
    8.28  </sparql>
    8.29 \ No newline at end of file
     9.1 --- a/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/periodIntersects.rq	Thu Jan 22 19:33:24 2015 +0200
     9.2 +++ b/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/periodIntersects.rq	Fri Jan 23 18:40:23 2015 +0200
     9.3 @@ -1,9 +1,5 @@
     9.4 -PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
     9.5 -PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
     9.6 -PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#> 
     9.7 -
     9.8  SELECT distinct ?x1 ?x2 
     9.9  			WHERE { 
    9.10  				?x1 ?y1 ?z1 ?t1 .
    9.11  				?x2 ?y2 ?z2 ?t2 .
    9.12 -				FILTER(strdf:periodIntersects(?t1, ?t2) && str(?x1) < str(?x2)).}
    9.13 \ No newline at end of file
    9.14 +				FILTER(strdf:PeriodIntersects(?t1, ?t2) && str(?x1) < str(?x2)).}
    9.15 \ No newline at end of file
    10.1 --- a/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/periodIntersects.srx	Thu Jan 22 19:33:24 2015 +0200
    10.2 +++ b/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/periodIntersects.srx	Fri Jan 23 18:40:23 2015 +0200
    10.3 @@ -5,5 +5,69 @@
    10.4  		<variable name='x2'/>
    10.5  	</head>
    10.6  	<results>
    10.7 +		<result>
    10.8 +			<binding name='x1'>
    10.9 +				<uri>http://example.org/item1</uri>
   10.10 +			</binding>
   10.11 +			<binding name='x2'>
   10.12 +				<uri>http://example.org/item2</uri>
   10.13 +			</binding>
   10.14 +		</result>
   10.15 +		<result>
   10.16 +			<binding name='x1'>
   10.17 +				<uri>http://example.org/item1</uri>
   10.18 +			</binding>
   10.19 +			<binding name='x2'>
   10.20 +				<uri>http://example.org/item3</uri>
   10.21 +			</binding>
   10.22 +		</result>
   10.23 +		<result>
   10.24 +			<binding name='x1'>
   10.25 +				<uri>http://example.org/item2</uri>
   10.26 +			</binding>
   10.27 +			<binding name='x2'>
   10.28 +				<uri>http://example.org/item3</uri>
   10.29 +			</binding>
   10.30 +		</result>
   10.31 +		<result>
   10.32 +			<binding name='x1'>
   10.33 +				<uri>http://example.org/item1</uri>
   10.34 +			</binding>
   10.35 +			<binding name='x2'>
   10.36 +				<uri>http://example.org/item7</uri>
   10.37 +			</binding>
   10.38 +		</result>
   10.39 +		<result>
   10.40 +			<binding name='x1'>
   10.41 +				<uri>http://example.org/item2</uri>
   10.42 +			</binding>
   10.43 +			<binding name='x2'>
   10.44 +				<uri>http://example.org/item7</uri>
   10.45 +			</binding>
   10.46 +		</result>
   10.47 +		<result>
   10.48 +			<binding name='x1'>
   10.49 +				<uri>http://example.org/item3</uri>
   10.50 +			</binding>
   10.51 +			<binding name='x2'>
   10.52 +				<uri>http://example.org/item7</uri>
   10.53 +			</binding>
   10.54 +		</result>
   10.55 +		<result>
   10.56 +			<binding name='x1'>
   10.57 +				<uri>http://example.org/item2</uri>
   10.58 +			</binding>
   10.59 +			<binding name='x2'>
   10.60 +				<uri>http://example.org/item8</uri>
   10.61 +			</binding>
   10.62 +		</result>
   10.63 +		<result>
   10.64 +			<binding name='x1'>
   10.65 +				<uri>http://example.org/item7</uri>
   10.66 +			</binding>
   10.67 +			<binding name='x2'>
   10.68 +				<uri>http://example.org/item8</uri>
   10.69 +			</binding>
   10.70 +		</result>
   10.71  	</results>
   10.72 -</sparql>
   10.73 +</sparql>
   10.74 \ No newline at end of file
    11.1 --- a/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/starts.srx	Thu Jan 22 19:33:24 2015 +0200
    11.2 +++ b/testsuite/src/test/resources/stSPARQL/TemporalRelationsTest/starts.srx	Fri Jan 23 18:40:23 2015 +0200
    11.3 @@ -6,12 +6,28 @@
    11.4  	</head>
    11.5  	<results>
    11.6  		<result>
    11.7 +			<binding name='x1'>
    11.8 +				<uri>http://example.org/item1</uri>
    11.9 +			</binding>
   11.10  			<binding name='x2'>
   11.11  				<uri>http://example.org/item2</uri>
   11.12  			</binding>
   11.13 +		</result>
   11.14 +		<result>
   11.15  			<binding name='x1'>
   11.16  				<uri>http://example.org/item1</uri>
   11.17  			</binding>
   11.18 +			<binding name='x2'>
   11.19 +				<uri>http://example.org/item3</uri>
   11.20 +			</binding>
   11.21 +		</result>
   11.22 +		<result>
   11.23 +			<binding name='x1'>
   11.24 +				<uri>http://example.org/item2</uri>
   11.25 +			</binding>
   11.26 +			<binding name='x2'>
   11.27 +				<uri>http://example.org/item3</uri>
   11.28 +			</binding>
   11.29  		</result>
   11.30  	</results>
   11.31 -</sparql>
   11.32 \ No newline at end of file
   11.33 +</sparql>