Lalonde Marc kirjoitti 25.01.2018 klo 23:25:
Thanks for your reply. I'm not using fuseki so far, all I did was take JenaSpatialExample1.java and modify a few things. But it definitely has to do with the indexing mechanism: when I systematically destroy the index folder before reloading the model(via  RDFDataMgr.read(...)), the behavior is good. I took a peek at the code under jena-spatial, as far as I can tell there's nothing meant for removing old indexed stuff. Is there a proper way of handling live or dynamic spatial data, apart from reindexing every time a model update needs to be done?

You are right. The deletion of stale index entries from a jena-text Lucene index [1] was a feature that was implemented a while ago (Jena 3.0.0). The same hasn't been implemented for jena-spatial although the same approach would probably work there too. So when you update your triples, new entries will be added to the jena-spatial index (at least I hope so) but old ones will not be deleted.

The only way currently to handle updates is to reindex every time the data changes. Alternatively, if it's possible to adapt your SPARQL query in such a way that it double-checks the results coming from the spatial index (for example checking that the coordinates of objects are actually within the area you queried), that might work too in some cases but it's obviously not a general solution.

Pull requests welcome ;)

-Osma

[1] https://jena.apache.org/documentation/query/text-query.html#uid-field-and-automatic-document-deletion

--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Kaikukatu 4)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
[email protected]
http://www.nationallibrary.fi

Reply via email to