Aklakan commented on issue #3473:
URL: https://github.com/apache/jena/issues/3473#issuecomment-3351250977

   Thanks for the detailed report. The issue is related to the inferences. 
Restarting the server with inferences enabled adds `geo:Geometry` triples which 
impact the execution:
   
   * `geo:sfWithin` goes to `GenericPropertyFunction.queryRewrite`
   
   
https://github.com/apache/jena/blob/968c43039586506111a942d62de44fb6a2e17051/jena-geosparql/src/main/java/org/apache/jena/geosparql/geo/topological/GenericPropertyFunction.java#L100
 
   
   * which then checks for the presence of (among other things) a geo:Geometry 
type:
   
   
https://github.com/apache/jena/blob/968c43039586506111a942d62de44fb6a2e17051/jena-geosparql/src/main/java/org/apache/jena/geosparql/geo/topological/SpatialObjectGeometryLiteral.java#L120
   
   So simply adding`geo:Geometry` types to your input data makes you query work 
immediately (no restart or spatial index needed):
   
   ```ttl
   :geoStrasbourg a ogcsf:Point,  geo:Geometry ; .
   
   :geoFrance a ogcsf:Polygon, geo:Geometry ; .
   ```
   
   Also, the way your query is executed does not use the spatial index at all: 
   ```sparql
     ?s a ogcsf:Point . # Here, ?s is bound first.
   
     # Here bound sides of geo:sfWithin bound 
     # Query execution fetches the geometries of both sides and tests for the 
relation (within)
     # No spatial index access is involved.
     ?s geo:sfWithin <urn:test:geosparql#geoFrance> . #
   ```
   
   That said, to me it seems that the dataset-level `queryRewriteIndex` is 
susceptible to going out of sync under updates (I didn't write this part of the 
code). I wonder if this index could be removed or at least moved to request 
level. Perhaps this is a separate issue though.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to