You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Johan Kumps <jo...@telenet.be> on 2021/01/28 23:08:19 UTC
sfWithin filter question
Hi all,
Let's consider this query (1) and corresponding results:
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
SELECT ?s ?o
WHERE{
?s geo:sfWithin ?o .
} ORDER by ?o
Results query 1:
?s ?o
<http://example.org/Feature#A> <http://example.org/Feature#A>
<http://example.org/Geometry#PointA> <http://example.org/Feature#A>
<http://example.org/Geometry#testPoint> <http://example.org/Feature#A>
<http://example.org/Feature#A> <http://example.org/Feature#H>
<http://example.org/Feature#H> <http://example.org/Feature#H>
<http://example.org/Geometry#PointA> <http://example.org/Feature#H>
<http://example.org/Geometry#PolygonH> <http://example.org/Feature#H>
<http://example.org/Geometry#testPoint> <http://example.org/Feature#H>
<http://example.org/Feature#A> <http://example.org/Geometry#PointA>
<http://example.org/Geometry#PointA> <http://example.org/Geometry#PointA>
<http://example.org/Geometry#testPoint> <http://example.org/Geometry#PointA>
<http://example.org/Feature#A> <http://example.org/Geometry#PolygonH>
<http://example.org/Feature#H> <http://example.org/Geometry#PolygonH>
<http://example.org/Geometry#PointA> <http://example.org/Geometry#PolygonH>
<http://example.org/Geometry#PolygonH> <http://example.org/Geometry#PolygonH
>
<http://example.org/Geometry#testPoint> <
http://example.org/Geometry#PolygonH>
What is wrong with this query (2) as it is returning no results:
SELECT ?wkt
WHERE{
<http://example.org/Geometry#PolygonH> geo:asWKT ?wkt .
FILTER(geo:sfWithin(?wkt, "<http://www.opengis.net/def/crs/EPSG/0/27700>
POLYGON((30 40, 30 70, 90 70, 90 40, 30 40))"^^<
http://www.opengis.net/ont/geosparql#wktLiteral>)) .
} ORDER by ?wkt
WKT value for <http://example.org/Geometry#PolygonH> is according to this
query:
SELECT ?wkt
WHERE{
<http://example.org/Geometry#PolygonH> geo:asWKT ?wkt .
} ORDER by ?wkt
Result:
"<http://www.opengis.net/def/crs/EPSG/0/27700> POLYGON((30 40, 30 70, 90
70, 90 40, 30 40))"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
So I expect <http://example.org/Geometry#testPoint> as well as <
http://example.org/Geometry#PointA> to be in the result of the query 2.
What am I missing?
Thanks for your help!
Johan,