Strabon

changeset 1141:28339cc4a227

added tests for strdf:union function
author Stella Giannakopoulou <sgian@di.uoa.gr>
date Tue Apr 30 15:01:36 2013 +0300 (2013-04-30)
parents 6ba723d60c7d
children 9a328f20752e
files testsuite/src/test/java/eu/earthobservatory/testsuite/stSPARQL/UnionTest.java testsuite/src/test/resources/stSPARQL/UnionTest/UnionAsConstructBinary.rq testsuite/src/test/resources/stSPARQL/UnionTest/UnionAsConstructBinary.srx testsuite/src/test/resources/stSPARQL/UnionTest/UnionAsConstructUnary.rq testsuite/src/test/resources/stSPARQL/UnionTest/UnionAsConstructUnary.srx testsuite/src/test/resources/stSPARQL/UnionTest/UnionAsConstructUnaryGroupBy.rq testsuite/src/test/resources/stSPARQL/UnionTest/UnionAsConstructUnaryGroupBy.srx testsuite/src/test/resources/stSPARQL/UnionTest/UnionTest.nt
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/UnionTest.java	Tue Apr 30 15:01:36 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 strdf:union function.
    1.19 + * 
    1.20 + * @author Stella Giannakopoulou <sgian@di.uoa.gr
    1.21 + */
    1.22 +
    1.23 +public class UnionTest extends TemplateTest {}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/testsuite/src/test/resources/stSPARQL/UnionTest/UnionAsConstructBinary.rq	Tue Apr 30 15:01:36 2013 +0300
     2.3 @@ -0,0 +1,7 @@
     2.4 +select (strdf:union(?g1, ?g2) as ?union)
     2.5 +where
     2.6 +{
     2.7 +	?x <http://example.org/ontology/hasGeometry> ?g1 .
     2.8 +	?y <http://example.org/ontology/hasGeometry> ?g2 .
     2.9 +	FILTER(?x != ?y)
    2.10 +}
    2.11 \ 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/UnionTest/UnionAsConstructBinary.srx	Tue Apr 30 15:01:36 2013 +0300
     3.3 @@ -0,0 +1,68 @@
     3.4 +<?xml version='1.0' encoding='UTF-8'?>
     3.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
     3.6 +	<head>
     3.7 +		<variable name='union'/>
     3.8 +	</head>
     3.9 +	<results>
    3.10 +		<result>
    3.11 +			<binding name='union'>
    3.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>GEOMETRYCOLLECTION (POINT (23.6423757 37.9521198), POLYGON ((-7 4.2, -7.1 4.2, -7.1 4.3, -7 4.2)))</literal>
    3.13 +			</binding>
    3.14 +		</result>
    3.15 +		<result>
    3.16 +			<binding name='union'>
    3.17 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>MULTIPOINT ((23.6423757 37.9521198), (21.841968 38.045047))</literal>
    3.18 +			</binding>
    3.19 +		</result>
    3.20 +		<result>
    3.21 +			<binding name='union'>
    3.22 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>GEOMETRYCOLLECTION (POINT (23.6423757 37.9521198), POLYGON ((34.8 19.37, 41.74 19.37, 41.74 29.64, 34.8 29.64, 34.8 19.37)))</literal>
    3.23 +			</binding>
    3.24 +		</result>
    3.25 +		<result>
    3.26 +			<binding name='union'>
    3.27 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>GEOMETRYCOLLECTION (POLYGON ((-7 4.2, -7.1 4.2, -7.1 4.3, -7 4.2)), POINT (23.6423757 37.9521198))</literal>
    3.28 +			</binding>
    3.29 +		</result>
    3.30 +		<result>
    3.31 +			<binding name='union'>
    3.32 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>GEOMETRYCOLLECTION (POLYGON ((-7 4.2, -7.1 4.2, -7.1 4.3, -7 4.2)), POINT (21.841968 38.045047))</literal>
    3.33 +			</binding>
    3.34 +		</result>
    3.35 +		<result>
    3.36 +			<binding name='union'>
    3.37 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>MULTIPOLYGON (((-7 4.2, -7.1 4.2, -7.1 4.3, -7 4.2)), ((34.8 19.37, 41.74 19.37, 41.74 29.64, 34.8 29.64, 34.8 19.37)))</literal>
    3.38 +			</binding>
    3.39 +		</result>
    3.40 +		<result>
    3.41 +			<binding name='union'>
    3.42 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>MULTIPOINT ((21.841968 38.045047), (23.6423757 37.9521198))</literal>
    3.43 +			</binding>
    3.44 +		</result>
    3.45 +		<result>
    3.46 +			<binding name='union'>
    3.47 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>GEOMETRYCOLLECTION (POINT (21.841968 38.045047), POLYGON ((-7 4.2, -7.1 4.2, -7.1 4.3, -7 4.2)))</literal>
    3.48 +			</binding>
    3.49 +		</result>
    3.50 +		<result>
    3.51 +			<binding name='union'>
    3.52 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>GEOMETRYCOLLECTION (POINT (21.841968 38.045047), POLYGON ((34.8 19.37, 41.74 19.37, 41.74 29.64, 34.8 29.64, 34.8 19.37)))</literal>
    3.53 +			</binding>
    3.54 +		</result>
    3.55 +		<result>
    3.56 +			<binding name='union'>
    3.57 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>GEOMETRYCOLLECTION (POLYGON ((34.8 19.37, 41.74 19.37, 41.74 29.64, 34.8 29.64, 34.8 19.37)), POINT (23.6423757 37.9521198))</literal>
    3.58 +			</binding>
    3.59 +		</result>
    3.60 +		<result>
    3.61 +			<binding name='union'>
    3.62 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>MULTIPOLYGON (((34.8 19.37, 41.74 19.37, 41.74 29.64, 34.8 29.64, 34.8 19.37)), ((-7 4.2, -7.1 4.2, -7.1 4.3, -7 4.2)))</literal>
    3.63 +			</binding>
    3.64 +		</result>
    3.65 +		<result>
    3.66 +			<binding name='union'>
    3.67 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>GEOMETRYCOLLECTION (POLYGON ((34.8 19.37, 41.74 19.37, 41.74 29.64, 34.8 29.64, 34.8 19.37)), POINT (21.841968 38.045047))</literal>
    3.68 +			</binding>
    3.69 +		</result>
    3.70 +	</results>
    3.71 +</sparql>
    3.72 \ 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/UnionTest/UnionAsConstructUnary.rq	Tue Apr 30 15:01:36 2013 +0300
     4.3 @@ -0,0 +1,6 @@
     4.4 +select (strdf:union(?g) as ?union)
     4.5 +where
     4.6 +{
     4.7 +	?x <http://example.org/ontology/hasGeometry> ?g .
     4.8 +	?x rdf:type <http://example.org/ontology/b> .
     4.9 +}
    4.10 \ No newline at end of file
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/testsuite/src/test/resources/stSPARQL/UnionTest/UnionAsConstructUnary.srx	Tue Apr 30 15:01:36 2013 +0300
     5.3 @@ -0,0 +1,13 @@
     5.4 +<?xml version='1.0' encoding='UTF-8'?>
     5.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
     5.6 +	<head>
     5.7 +		<variable name='union'/>
     5.8 +	</head>
     5.9 +	<results>
    5.10 +		<result>
    5.11 +			<binding name='union'>
    5.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>MULTIPOLYGON (((-7 4.2, -7.1 4.2, -7.1 4.3, -7 4.2)), ((34.8 19.37, 34.8 29.64, 41.74 29.64, 41.74 19.37, 34.8 19.37)));http://www.opengis.net/def/crs/EPSG/0/4326</literal>
    5.13 +			</binding>
    5.14 +		</result>
    5.15 +	</results>
    5.16 +</sparql>
    5.17 \ 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/UnionTest/UnionAsConstructUnaryGroupBy.rq	Tue Apr 30 15:01:36 2013 +0300
     6.3 @@ -0,0 +1,7 @@
     6.4 +select (strdf:union(?g) as ?union)
     6.5 +where
     6.6 +{
     6.7 +	?x <http://example.org/ontology/hasGeometry> ?g .
     6.8 +	?x rdf:type <http://example.org/ontology/b> .
     6.9 +}
    6.10 +group by ?x
    6.11 \ No newline at end of file
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/testsuite/src/test/resources/stSPARQL/UnionTest/UnionAsConstructUnaryGroupBy.srx	Tue Apr 30 15:01:36 2013 +0300
     7.3 @@ -0,0 +1,19 @@
     7.4 +<?xml version='1.0' encoding='UTF-8'?>
     7.5 +<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
     7.6 +	<head>
     7.7 +		<variable name='union'/>
     7.8 +	</head>
     7.9 +	<results>
    7.10 +		<result>
    7.11 +			<binding name='union'>
    7.12 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>POLYGON ((-7 4.2, -7.1 4.2, -7.1 4.3, -7 4.2));http://www.opengis.net/def/crs/EPSG/0/4326</literal>
    7.13 +			</binding>
    7.14 +		</result>
    7.15 +		<result>
    7.16 +			<binding name='union'>
    7.17 +				<literal datatype='http://strdf.di.uoa.gr/ontology#WKT'>POLYGON ((34.8 19.37, 41.74 19.37, 41.74 29.64, 34.8 29.64, 34.8 19.37));http://www.opengis.net/def/crs/EPSG/0/4326</literal>
    7.18 +			</binding>
    7.19 +		</result>
    7.20 +	</results>
    7.21 +</sparql>
    7.22 +
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/testsuite/src/test/resources/stSPARQL/UnionTest/UnionTest.nt	Tue Apr 30 15:01:36 2013 +0300
     8.3 @@ -0,0 +1,8 @@
     8.4 +<http://example.org/id/Point/5531> <http://example.org/ontology/hasGeometry> "POINT(23.6423757 37.9521198)"^^<http://strdf.di.uoa.gr/ontology#WKT> .
     8.5 +<http://example.org/id/Point/5531> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/ontology/a> .
     8.6 +<http://example.org/id/Point/5532> <http://example.org/ontology/hasGeometry> "POLYGON((-7 4.2,-7.1 4.2,-7.1 4.3,-7 4.2))"^^<http://strdf.di.uoa.gr/ontology#WKT> .
     8.7 +<http://example.org/id/Point/5532> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/ontology/b> .
     8.8 +<http://example.org/id/Point/5533> <http://example.org/ontology/hasGeometry> "POINT(21.841968 38.045047)"^^<http://strdf.di.uoa.gr/ontology#WKT> .
     8.9 +<http://example.org/id/Point/5533> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/ontology/a> .
    8.10 +<http://example.org/id/Point/5534> <http://example.org/ontology/hasGeometry> "POLYGON((34.80 19.37,41.74 19.37,41.74 29.64 ,34.80 29.64,34.80 19.37))"^^<http://strdf.di.uoa.gr/ontology#WKT> .
    8.11 +<http://example.org/id/Point/5534> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/ontology/b> .