Strabon
changeset 1075:21509af1fd0f
added tests for distance function
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/DistanceTest.java Thu Apr 25 13:56:33 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:buffer function. 1.19 + * 1.20 + * @author Stella Giannakopoulou <sgian@di.uoa.gr 1.21 + */ 1.22 + 1.23 +public class DistanceTest extends TemplateTest {}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/testsuite/src/test/resources/stSPARQL/DistanceTest/DistanceTest.nt Thu Apr 25 13:56:33 2013 +0300 2.3 @@ -0,0 +1,3 @@ 2.4 +<http://example.org/id/Point/5531> <http://example.org/ontology/hasGeometry> "POINT(23.6423757 37.9521198)"^^<http://strdf.di.uoa.gr/ontology#WKT> . 2.5 +<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> . 2.6 +<http://example.org/id/Point/5533> <http://example.org/ontology/hasGeometry> "POINT(21.841968 38.045047)"^^<http://strdf.di.uoa.gr/ontology#WKT> . 2.7 \ 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/DistanceTest/DistanceTestDegrees.rq Thu Apr 25 13:56:33 2013 +0300 3.3 @@ -0,0 +1,8 @@ 3.4 +PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 3.5 + 3.6 +select (strdf:distance(?g1, ?g2, <http://www.opengis.net/def/uom/OGC/1.0/degree>) as ?dist) 3.7 +where 3.8 +{ 3.9 + <http://example.org/id/Point/5531> <http://example.org/ontology/hasGeometry> ?g1 . 3.10 + <http://example.org/id/Point/5532> <http://example.org/ontology/hasGeometry> ?g2 . 3.11 +} 3.12 \ 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/DistanceTest/DistanceTestDegrees.srx Thu Apr 25 13:56:33 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='dist'/> 4.8 + </head> 4.9 + <results> 4.10 + <result> 4.11 + <binding name='dist'> 4.12 + <literal datatype='http://www.w3.org/2001/XMLSchema#double'>45.58024597167969</literal> 4.13 + </binding> 4.14 + </result> 4.15 + </results> 4.16 +</sparql> 4.17 \ 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/DistanceTest/DistanceTestMetres.rq Thu Apr 25 13:56:33 2013 +0300 5.3 @@ -0,0 +1,8 @@ 5.4 +PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 5.5 + 5.6 +select (strdf:distance(?g1, ?g2, <http://www.opengis.net/def/uom/OGC/1.0/metre>) as ?dist) 5.7 +where 5.8 +{ 5.9 + <http://example.org/id/Point/5531> <http://example.org/ontology/hasGeometry> ?g1 . 5.10 + <http://example.org/id/Point/5532> <http://example.org/ontology/hasGeometry> ?g2 . 5.11 +} 5.12 \ 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/DistanceTest/DistanceTestMetres.srx Thu Apr 25 13:56:33 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='dist'/> 6.8 + </head> 6.9 + <results> 6.10 + <result> 6.11 + <binding name='dist'> 6.12 + <literal datatype='http://www.w3.org/2001/XMLSchema#double'>4860346.0</literal> 6.13 + </binding> 6.14 + </result> 6.15 + </results> 6.16 +</sparql>
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/testsuite/src/test/resources/stSPARQL/DistanceTest/DistanceTestWithUnion.rq Thu Apr 25 13:56:33 2013 +0300 7.3 @@ -0,0 +1,9 @@ 7.4 +PREFIX strdf: <http://strdf.di.uoa.gr/ontology#> 7.5 + 7.6 +select (strdf:distance(strdf:union(?g1, ?g2), ?g3, <http://www.opengis.net/def/uom/OGC/1.0/metre>) as ?dist) 7.7 +where 7.8 +{ 7.9 + <http://example.org/id/Point/5531> <http://example.org/ontology/hasGeometry> ?g1 . 7.10 + <http://example.org/id/Point/5532> <http://example.org/ontology/hasGeometry> ?g2 . 7.11 + <http://example.org/id/Point/5533> <http://example.org/ontology/hasGeometry> ?g3 . 7.12 +} 7.13 \ No newline at end of file
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8.2 +++ b/testsuite/src/test/resources/stSPARQL/DistanceTest/DistanceTestWithUnion.srx Thu Apr 25 13:56:33 2013 +0300 8.3 @@ -0,0 +1,13 @@ 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='dist'/> 8.8 + </head> 8.9 + <results> 8.10 + <result> 8.11 + <binding name='dist'> 8.12 + <literal datatype='http://www.w3.org/2001/XMLSchema#double'>158470.796875</literal> 8.13 + </binding> 8.14 + </result> 8.15 + </results> 8.16 +</sparql> 8.17 \ No newline at end of file