Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OWLAPI : how load ontology having import works?

I have ontology which has another ontology imported in it. I want to know how OWLOntologyManager's loadOntologyFromOntologyDocument(OWLOntologyDocumentSource documentSource, OWLOntologyLoaderConfiguration config) works internally. I have used OWLOntologyLoaderConfiguration class to handle the Missing Imports (want to know which import fails with help of MissingImportListener class).

I am able to listen the missing imports. But if any of my ontology file having import for WEB resource then above method fetches it from its location. Is there any way so that I can restrict the call for WEB resource and asks to load the copy which I have in my system ?

e.g In case of BBC's sport ontology loading method loads following ontologies internally :

  1. http://purl.org/NET/c4dm/event.owl
  2. FOAF (http://xmlns.com/foaf/0.1/)
  3. Time (http://www.w3.org/2006/time)

just like opening BBC's sport ontology inside Protege.

like image 891
SuhasD Avatar asked Oct 30 '22 00:10

SuhasD


1 Answers

You can use AutoIRIMapper - create one pointing at the folder containing local copies and add it to the manager before loading the ontology you're after.

For ontologies that are available at a different address, use SimpleIRIMapper, which will act as a redirect from the original address to a new address.

like image 132
Ignazio Avatar answered Nov 15 '22 05:11

Ignazio