I guess dynamic imports is what I need. But will they get triggered if I
remove and then re-add the whole Model (as shown in my example), rather
than statements?

I could probably removeAll() statements from it instead of removing it from
cache.

On Fri, Apr 6, 2018 at 1:59 PM, Martynas Jusevičius <[email protected]>
wrote:

> Hi,
>
> we have an ontology editor that stores ontologies and their terms in a
> triplestore. On the other end, they are being loaded by OntDocumentManager.
>
> The question is: what is the proper way to clear and reload an ontology
> and its imports in OntDocumentManager?
>
> Because, for example, a user could totally change owl:imports statements
> of an ontology, and we need this feature to be able to reload a completely
> new OntModel without any old imported submodels.
>
> Right now I'm simply doing the following:
>
>   OntDocumentManager.getInstance().getFileManager()
> .removeCacheModel(ontologyURI)
>   OntDocumentManager.getInstance().addModel(ontologyURI, infModel);
>   OntModel ontModel = 
> OntDocumentManager.getInstance().getOntology(ontologyURI,
> ontModelSpec);
>
> But this is not enough, because doing ontModel.listImportedOntologyURIs()
> lists all the old imports from before.
>
> Am I getting this right and what needs to be done to reload the imports as
> well?
>
> I can see there is a concept of dynamic imports in OntModel, but not sure
> it's related.
>
>
> Martynas
>

Reply via email to