Aklakan commented on issue #3717:
URL: https://github.com/apache/jena/issues/3717#issuecomment-3789722187
We are using this pattern involving `spatialF:intersectBoxGeom` alot:
```java
SELECT * {
BIND("POLYGON ((6.475457372470345 51.7037981703763, 6.475457372470346
51.2481032780451, 7.544268491722988 51.24810327804511, 7.544268491722988
51.70379817037631, 6.475457372470345 51.7037981703763))"^^geo:wktLiteral AS
?areaWkt)
# Pre-filter features by the bbox of the area that DOES use the spatial
index
?feature spatialF:intersectBoxGeom(?areaWkt) .
# Get the feature's wkt literal(s)
?feature geo:hasGeometry/geo:asWKT ?featureWkt .
# Exact post-filter that does NOT use the spatial index
FILTER(!bound(?areaWkt) || geof:sfIntersects(?featureWkt, ?areaWkt))
}
```
In the code, the `SpatialIndex` is only used in the **property functions**
(based on the `GenericPropertyFunction` and `GenericSpatialPropertyFunction`
class hierarchies). I don't see any use of the spatial index in any of the
filter functions.
For `FILTER(geof:sfWithin(?geom1, ?geom2))` to use the spatial index one,
way this could be accomplished (in the future) is an additional algebra rewrite
in the optimizer that
- expands the FILTER into the described pattern
- places the `?feature spatialF:intersectBoxGeom(?areaWkt)` property
function appropriately (usually as early as possible).
--
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]