A similar small issue seems to be when the index is built:
SpatialIndex.getGeoPredicateIndexItems, line 460 may cause a
NullPointerException if a resource happens to have a geo:lat but no
geo:long. With messy data this doesn't look very robust:
Literal lat =
feature.getProperty(SpatialExtension.GEO_LAT_PROP).getLiteral();
Literal lon =
feature.getProperty(SpatialExtension.GEO_LON_PROP).getLiteral();
Thanks
Holger
On 17/02/2020 12:48, Holger Knublauch wrote:
Hi,
I am starting to look into GeoSPARQL and run into an issue related to
this line 135 in SpatialObjectGeometryLiteral:
Node lat = graph.find(targetSpatialObject,
SpatialExtension.GEO_LAT_NODE, null).next().getObject();
This is creating an Iterator in the find() and then just calls next()
without checking whether the iterator is exhausted. However, a subject
may have multiple values for that geo:lat property and then we end up
with an unclosed iterator. This breaks our assumptions in that each
Jena iterator must be either exhausted by reaching the end, or closed
with .close().
Isn't this a bug?
Thanks
Holger