Strabon

changeset 1219:ca883cc1eb98

Added tests for spatial aggregate functions of stSPARQL (except for strdf:intersection; see http://bug.strabon.di.uoa.gr/ for more details).
author Panayiotis Smeros <psmeros@di.uoa.gr>
date Tue Jul 16 20:38:19 2013 +0300 (2013-07-16)
parents b28b826845e5
children c7a49858bfbc
files testsuite/src/test/java/eu/earthobservatory/testsuite/stSPARQL/AggregateFunctionsTest.java testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/AggregateFunctionsTest.nt testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/ExtentTest.rq testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/ExtentTest.srx testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/UnionTest.rq testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/UnionTest.srx testsuite/src/test/resources/untested/UnionUnaryTest.rq testsuite/src/test/resources/untested/UnionUnaryTest.srx
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testsuite/src/test/java/eu/earthobservatory/testsuite/stSPARQL/AggregateFunctionsTest.java	Tue Jul 16 20:38:19 2013 +0300
     1.3 @@ -0,0 +1,20 @@
     1.4 +/**
     1.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 + * 
     1.9 + * Copyright (C) 2010, 2011, 2012, 2013 Pyravlos Team
    1.10 + * 
    1.11 + * http://www.strabon.di.uoa.gr/
    1.12 + */
    1.13 +package eu.earthobservatory.testsuite.stSPARQL;
    1.14 +
    1.15 +import eu.earthobservatory.testsuite.utils.TemplateTest;
    1.16 +
    1.17 +/**
    1.18 + * A test for the aggregate functions of stSPARQL.
    1.19 + * 
    1.20 + * @author Panayiotis Smeros <psmeros@di.uoa.gr>
    1.21 + */
    1.22 +
    1.23 +public class AggregateFunctionsTest extends TemplateTest {}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/AggregateFunctionsTest.nt	Tue Jul 16 20:38:19 2013 +0300
     2.3 @@ -0,0 +1,2 @@
     2.4 +<http://example.org#A> <http://example.org#hasGeometry> "Polygon((0 0, 1 0, 1 1, 0 1, 0 0))"^^<http://strdf.di.uoa.gr/ontology#WKT>.
     2.5 +<http://example.org#B> <http://example.org#hasGeometry> "Polygon((0 0, 2 0, 2 2, 0 2 , 0 0))"^^<http://strdf.di.uoa.gr/ontology#WKT>.
     2.6 \ No newline at end of file
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/ExtentTest.rq	Tue Jul 16 20:38:19 2013 +0300
     3.3 @@ -0,0 +1,5 @@
     3.4 +select (strdf:extent(?g) as ?extent)
     3.5 +where
     3.6 +{
     3.7 +	?x ex:hasGeometry ?g.
     3.8 +}
     3.9 \ No newline at end of file
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/ExtentTest.srx	Tue Jul 16 20:38:19 2013 +0300
     4.3 @@ -0,0 +1,13 @@
     4.4 +<?xml version='1.0' encoding='UTF-8'?>
     4.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
     4.6 +	<head>
     4.7 +		<variable name='extent'/>
     4.8 +	</head>
     4.9 +	<results>
    4.10 +		<result>
    4.11 +			<binding name='extent'>
    4.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>POLYGON ((0 0, 0 2, 2 2, 2 0, 0 0));http://www.opengis.net/def/crs/EPSG/0/4326</literal>
    4.13 +			</binding>
    4.14 +		</result>
    4.15 +	</results>
    4.16 +</sparql>
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/UnionTest.rq	Tue Jul 16 20:38:19 2013 +0300
     5.3 @@ -0,0 +1,5 @@
     5.4 +select (strdf:union(?g) as ?union)
     5.5 +where
     5.6 +{
     5.7 +	?x ex:hasGeometry ?g.
     5.8 +}
     5.9 \ No newline at end of file
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/testsuite/src/test/resources/stSPARQL/AggregateFunctionsTest/UnionTest.srx	Tue Jul 16 20:38:19 2013 +0300
     6.3 @@ -0,0 +1,13 @@
     6.4 +<?xml version='1.0' encoding='UTF-8'?>
     6.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
     6.6 +	<head>
     6.7 +		<variable name='union'/>
     6.8 +	</head>
     6.9 +	<results>
    6.10 +		<result>
    6.11 +			<binding name='union'>
    6.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>POLYGON ((1 0, 0 0, 0 1, 0 2, 2 2, 2 0, 1 0));http://www.opengis.net/def/crs/EPSG/0/4326</literal>
    6.13 +			</binding>
    6.14 +		</result>
    6.15 +	</results>
    6.16 +</sparql>
     7.1 --- a/testsuite/src/test/resources/untested/UnionUnaryTest.rq	Tue Jul 16 19:30:35 2013 +0300
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,6 +0,0 @@
     7.4 -select (strdf:union(?g) as ?union)
     7.5 -where
     7.6 -{
     7.7 -?x ex:hasGeometry ?g.
     7.8 -FILTER(?x=ex:A || ?x=ex:B)
     7.9 -}
    7.10 \ No newline at end of file
     8.1 --- a/testsuite/src/test/resources/untested/UnionUnaryTest.srx	Tue Jul 16 19:30:35 2013 +0300
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,13 +0,0 @@
     8.4 -<?xml version='1.0' encoding='UTF-8'?>
     8.5 -<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
     8.6 -	<head>
     8.7 -		<variable name='union'/>
     8.8 -	</head>
     8.9 -	<results>
    8.10 -		<result>
    8.11 -			<binding name='union'>
    8.12 -				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>POLYGON ((1 0, 0 0, 0 1, 0 2, 2 2, 2 0, 1 0));http://www.opengis.net/def/crs/EPSG/0/4326</literal>
    8.13 -			</binding>
    8.14 -		</result>
    8.15 -	</results>
    8.16 -</sparql>