GeoSPARQL use geof:within

I want to use geoSPARQL functions, then I have followed the example from the manual:

@prefix db: http://data/# .
@prefix geo: http://www.opengis.net/ont/geosparql# .
@prefix rdfs: http://www.w3.org/2000/01/rdf-schema# .

db:redHouse a geo:Feature ;
rdfs:label “Red House” ;
geo:hasGeometry db:redHouseGeo .

db:redHouseGeo a geo:Geometry ;
geo:asWKT “Point(0 0)”^^geo:wktLiteral .

db:whiteHouse a geo:Feature ;
rdfs:label “White House” ;
geo:hasGeometry db:whiteHouseGeo .

db:whiteHouseGeo a geo:Geometry ;
geo:asWKT “Point(0 0)”^^geo:wktLiteral .

then I try to request:

PREFIX geo: http://www.opengis.net/ont/geosparql#
PREFIX geof: http://www.opengis.net/def/function/geosparql/

SELECT DISTINCT
?g
WHERE {
?g geo:asWKT ?gWKT .
FILTER geof:within(?g, “ENVELOPE(-100, 100, 100, -100)”^^geo:wktLiteral ) .
}

And I have no results.

But when I try:

PREFIX geo: http://www.opengis.net/ont/geosparql#
PREFIX geof: http://www.opengis.net/def/function/geosparql/

SELECT DISTINCT
?g
WHERE {
?g geo:asWKT ?gWKT .
}

I have a result:
---------------------| g |------------------------------
| http://data/redHouseGeo |
| http://data/whiteHouseGeo |

My problem is similar to this one: https://community.stardog.com/t/geosparql-not-working/797, but I have enable spatial indexing when creating my database.
Can you help me to understand what is wrong ?

I think the use on ENVELOPE may require JTS to be installed. I’d include a link but I’m on my phone but a quick search of the Stardog docs and you should find instructions.

Thanks, but it is because I was using the community version, now it’s work.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.