On 25/11/2019 00:23, Steve Vestal wrote:
If I had three OntModels, each with their own OntDocumentManager, FileManager, and choice of reasoner, OntModel ontoA OntModel ontoB OntModel ontoCommon and I then do the following ontoA.addSubModel(ontoCommon) ontoB.addSubModel(ontoCommon) how is ontoCommon loaded into ontoA and ontoB? Whose settings for import closure, alternate URL lookup, caching, etc., are used? Which reasoner? Will the settings for ontoA determine how import closure, reasoning, etc., is handled when ontoCommon is added to ontoA?
The OntModels act as if they were Models (with a richer API) but potentially with additional triples in them as a result of import processing and inference.
When you create ontoCommon there may have been some import processing depending on what the settings for it are. If you have configured inference for it then it will act as if there are more inferred triples present (some may have been manifest, some may be lazily evaluated).
When you add ontoCommon to ontoA then none of that goes away. Whatever triples are in (appear to be in) ontoCommon will now be visible as part of the ontoA union.
Separately the settings for import processing etc for ontoA will control how ontoA was created. Note that addSubModel itself does not trigger any import processing, it just adds the model as one more element of the union. However, it does optionally reset ("rebind") the ontoA reasoner state. So if you have inference configured for ontoA then that inference will still be run but it'll now have as the base triples to work from those in ontoCommon which will including any as a result of *its* import and inference settings.
In general, having one reason work over the top of another is a bad idea in terms of performance.
Dave
