I am using Apache Jena Fuseki Server for Storing Geo Coordinates of
location. How to find out that if two polygons or two rectangles intersect
each other inside Fuseki.

I have stored geocoordinates in WKT serialization format. When I execute
below query

*PREFIX xsd: <http://www.w3.org/2001/XMLSchema#
<http://www.w3.org/2001/XMLSchema#>>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>>
PREFIX geo: <http://www.opengis.net/ont/geosparql#
<http://www.opengis.net/ont/geosparql#>>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#
<http://www.w3.org/2001/XMLSchema#>>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#
<http://www.w3.org/2000/01/rdf-schema#>>
PREFIX : <http://example.org/# <http://example.org/#>>
PREFIX geo: <http://www.opengis.net/ont/geosparql#
<http://www.opengis.net/ont/geosparql#>>
PREFIX spatial: <http://jena.apache.org/spatial#
<http://jena.apache.org/spatial#>>
SELECT ?object
WHERE {
GRAPH <http://project/base/default <http://project/base/default>> {
    ?subject geo:asWKT ?object .
} }*

I get these below results.

object
1
"POLYGON((8.463699817657472 48.99872928913063,8.463887572288515
48.998644821906865,8.46399486064911
48.998764483764916,8.46425771713257
48.99865538031766,8.464375734329225
48.998746886450874,8.463919758796694
48.99893693711346,8.463699817657472 48.99872928913063))"
2
"POLYGON((8.463560342788698 48.99847940651206,8.463560342788698
48.99864834137738,8.46377491950989 48.99864834137738,8.46377491950989
48.99847940651206,8.463560342788698 48.99847940651206))"
3
"POLYGON((8.463447690010073 48.99835974396915,8.463447690010073
48.99849348443939,8.463646173477175
48.99849348443939,8.463646173477175
48.99835974396915,8.463447690010073 48.99835974396915))"
4
"POLYGON((8.463254570961 48.99821544463795,8.463254570961
48.99838438039854,8.463635444641115
48.99838438039854,8.463635444641115 48.99821544463795,8.463254570961
48.99821544463795))"
5
"POLYGON((8.463689088821413 48.99826823712468,8.463689088821413
48.99845477012966,8.46402168273926 48.99845477012966,8.46402168273926
48.99826823712468,8.463689088821413 48.99826823712468))"
6
"POLYGON((8.463892936706545 48.99843013373508,8.463892936706545
48.998588510344774,8.464316725730898
48.998588510344774,8.464316725730898
48.99843013373508,8.463892936706545 48.99843013373508))"
7
"POLYGON((8.463093638420107 48.99805354732974,8.463093638420107
48.998243600637835,8.463737368583681
48.998243600637835,8.463737368583681
48.99805354732974,8.463093638420107 48.99805354732974))"
8
"POLYGON((8.463619351387026 48.99797963751407,8.463619351387026
48.998180249615714,8.464118242263796
48.998180249615714,8.464118242263796
48.99797963751407,8.463619351387026 48.99797963751407))"
9
"POLYGON((8.464407920837404 48.998303432084754,8.464407920837404
48.99857443244431,8.46477270126343 48.99857443244431,8.46477270126343
48.998303432084754,8.464407920837404 48.998303432084754))"
10
"POLYGON((8.464225530624391 48.99806762537742,8.464225530624391
48.99839141937611,8.464820981025698
48.99839141937611,8.464820981025698
48.99806762537742,8.464225530624391 48.99806762537742))"

Then later I want to filter out these geo:WKT objects based on
geo:intersection (Intersection or equals or contains methods). And I
updated my query as below.

*PREFIX xsd: <http://www.w3.org/2001/XMLSchema#
<http://www.w3.org/2001/XMLSchema#>>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>>
PREFIX geo: <http://www.opengis.net/ont/geosparql#
<http://www.opengis.net/ont/geosparql#>>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#
<http://www.w3.org/2001/XMLSchema#>>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#
<http://www.w3.org/2000/01/rdf-schema#>>
PREFIX : <http://example.org/# <http://example.org/#>>
PREFIX geo: <http://www.opengis.net/ont/geosparql#
<http://www.opengis.net/ont/geosparql#>>
PREFIX spatial: <http://jena.apache.org/spatial#
<http://jena.apache.org/spatial#>>
SELECT ?object
WHERE {
GRAPH <http://project/base/default <http://project/base/default>> {
    ?subject geo:asWKT ?object .
    ?object geo:equals "POLYGON((8.463699817657472
48.99872928913063,8.463887572288515
48.998644821906865,8.46399486064911
48.998764483764916,8.46425771713257
48.99865538031766,8.464375734329225
48.998746886450874,8.463919758796694
48.99893693711346,8.463699817657472 48.99872928913063))"
} } *

Which should result me atleast the coordinates of first geo object
which really equals the POLYGON coordinates but I get empty results as
shown in below image. Please suggest me where I am getting it wrong.

But I get no results as attached in snapshot. Please help me regarding this.

Reply via email to