Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Jena 4.4.0
-
None
Description
Using the GeoSPARQL component via assembler doesn't load the geospatial index from disk and therefore doesn't register it to the context of the dataset which makes querying fail on a second startup.
In the method prepareSpatialExtension in GeoAssembler class we have currently the following cases handled:
case 1: no file given
case 2: file given and either doesn't exists yet or empty
Thus, case 3 is missing:
case 3: file given and it isn't empty, i.e. the index has been precomputed
First I thought just ignore the file existence/emptyness check and go with
GeoSPARQLConfig.setupSpatialIndex(dataset, spatialIndexPath.toFile());
But this would lead to an unnecessary retrieval of the SRS occurrences.
What I did for testing is to add
SpatialIndex si = SpatialIndex.load(spatialIndexPath.toFile()); SpatialIndex.setSpatialIndex(dataset, si);
but maybe we want to have this case also encapsulated in the GeoSPARQLConfig class? Something like
GeoSPARQLConfig.setupFromPrecomputedIndex(dataset, spatialIndexPath.toFile());
maybe?
Attachments
Issue Links
- links to