Strabon

changeset 1091:809b0dad329d

Added sfWithin test.
author Panayiotis Smeros <psmeros@di.uoa.gr>
date Fri Apr 26 17:05:45 2013 +0300 (2013-04-26)
parents e1252c903fbf
children 520e5778e59b
files testsuite/src/test/java/eu/earthobservatory/testsuite/geoSPARQL/SfSpatialRelationsTest.java testsuite/src/test/java/eu/earthobservatory/testsuite/utils/Utils.java testsuite/src/test/resources/geoSPARQL/SfSpatialRelationsTest/SfWithinTest.rq testsuite/src/test/resources/geoSPARQL/SfSpatialRelationsTest/SfWithinTest.srx
line diff
     1.1 --- a/testsuite/src/test/java/eu/earthobservatory/testsuite/geoSPARQL/SfSpatialRelationsTest.java	Fri Apr 26 15:46:10 2013 +0300
     1.2 +++ b/testsuite/src/test/java/eu/earthobservatory/testsuite/geoSPARQL/SfSpatialRelationsTest.java	Fri Apr 26 17:05:45 2013 +0300
     1.3 @@ -13,7 +13,7 @@
     1.4  
     1.5  
     1.6  /**
     1.7 - * GeoSPARQL Feature Class test. Something that has a geometry is a Feature. 
     1.8 + * GeoSPARQL Simple Features' spatial relations test. 
     1.9   * 
    1.10   * @author Panayiotis Smeros <psmeros@di.uoa.gr
    1.11   */
     2.1 --- a/testsuite/src/test/java/eu/earthobservatory/testsuite/utils/Utils.java	Fri Apr 26 15:46:10 2013 +0300
     2.2 +++ b/testsuite/src/test/java/eu/earthobservatory/testsuite/utils/Utils.java	Fri Apr 26 17:05:45 2013 +0300
     2.3 @@ -155,7 +155,7 @@
     2.4  
     2.5  		List<String> eBindingNames = expectedResults.getBindingNames();
     2.6  		List<String> aBindingNames = actualResults.getBindingNames();
     2.7 -		assertTrue("Results are not the expected.", aBindingNames.containsAll(aBindingNames) && eBindingNames.containsAll(aBindingNames));		
     2.8 +		assertTrue("Results are not the expected. QueryFile: "+queryFile, aBindingNames.containsAll(aBindingNames) && eBindingNames.containsAll(aBindingNames));		
     2.9  		
    2.10  		//Sort each binding's values
    2.11  		List<String> eBindingList = new ArrayList<String>();
    2.12 @@ -178,7 +178,7 @@
    2.13  			aBindingList.add(aBindingValues);
    2.14  		}
    2.15  		
    2.16 -		assertFalse("Results are not the expected.", expectedResults.hasNext() || actualResults.hasNext());
    2.17 +		assertFalse("Results are not the expected. QueryFile: "+queryFile, expectedResults.hasNext() || actualResults.hasNext());
    2.18  		
    2.19  		//Sort bindings alphabetically
    2.20  		Collections.sort(eBindingList);
    2.21 @@ -190,7 +190,7 @@
    2.22  
    2.23  		while(eBindingListIterator.hasNext() && aBindingListIterator.hasNext())
    2.24  		{
    2.25 -			assertEquals("Results are not the expected.", eBindingListIterator.next(), aBindingListIterator.next());
    2.26 +			assertEquals("Results are not the expected. QueryFile: "+queryFile, eBindingListIterator.next(), aBindingListIterator.next());
    2.27  		}
    2.28  		
    2.29  		actualResults.close();
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/testsuite/src/test/resources/geoSPARQL/SfSpatialRelationsTest/SfWithinTest.rq	Fri Apr 26 17:05:45 2013 +0300
     3.3 @@ -0,0 +1,10 @@
     3.4 +SELECT ?x ?y
     3.5 +WHERE
     3.6 +{
     3.7 +?x geo:hasGeometry ?geom1.
     3.8 +?geom1 geo:asWKT ?g1.
     3.9 +
    3.10 +?y geo:hasGeometry ?geom2.
    3.11 +?geom2 geo:asWKT ?g2.
    3.12 +
    3.13 +FILTER((?x != ?y) && (geof:sfWithin(?g1, ?g2)))}
    3.14 \ 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/geoSPARQL/SfSpatialRelationsTest/SfWithinTest.srx	Fri Apr 26 17:05:45 2013 +0300
     4.3 @@ -0,0 +1,42 @@
     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='x'/>
     4.8 +		<variable name='y'/>
     4.9 +	</head>
    4.10 +	<results>
    4.11 +		<result>
    4.12 +			<binding name='y'>
    4.13 +				<uri>http://example.org#B</uri>
    4.14 +			</binding>
    4.15 +			<binding name='x'>
    4.16 +				<uri>http://example.org#A</uri>
    4.17 +			</binding>
    4.18 +		</result>
    4.19 +		<result>
    4.20 +			<binding name='y'>
    4.21 +				<uri>http://example.org#B</uri>
    4.22 +			</binding>
    4.23 +			<binding name='x'>
    4.24 +				<uri>http://example.org#G</uri>
    4.25 +			</binding>
    4.26 +		</result>
    4.27 +		<result>
    4.28 +			<binding name='y'>
    4.29 +				<uri>http://example.org#E</uri>
    4.30 +			</binding>
    4.31 +			<binding name='x'>
    4.32 +				<uri>http://example.org#D</uri>
    4.33 +			</binding>
    4.34 +		</result>
    4.35 +		<result>
    4.36 +			<binding name='y'>
    4.37 +				<uri>http://example.org#D</uri>
    4.38 +			</binding>
    4.39 +			<binding name='x'>
    4.40 +				<uri>http://example.org#E</uri>
    4.41 +			</binding>
    4.42 +		</result>
    4.43 +	</results>
    4.44 +</sparql>
    4.45 +