简体   繁体   中英

OWLAPI: Use of 'Imports' enum

Is it possible to configure OWLAPI not to go for importing ontology/ontologies present inside current working ontology?

How Imports enum works? (available at org.semanticweb.owlapi.model.parameters) [An enumeration for human readable values to include/exclude imports from searches]. How to add this to OWLAPI code in JAVA ?

This enum has two constants INCLUDE and EXCLUDE .

The Imports enumeration is not related to loading imported ontologies, it is related to searching axioms in those ontologies. INCLUDE will search imported ontologies as well as the current ontology in any method call that accepts an Import parameter.

I don't believe there is any switch to just stop import resolution. You can work around this by creating an empty ontology and a SimpleIRIMapper that returns the empty ontology IRI for any input. This effectively redirects all import directives to include the empty ontology in place of actual ontologies.

Example with OWLOntologyIRIMapper :

final IRI emptyOntologyIRI=...
OWLOntologyIRIMapper mapper = new OWLOntologyIRIMapper() {
    public IRI getDocumentIRI(IRI in) {
        return emptyOntologyIRI;
    }
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM