Skip to content

Commit

Permalink
Suppress ontology loading errors in the OWLAPI Driver. When the ontol…
Browse files Browse the repository at this point in the history
…ogy file does not exist, it is not necessary to display stacktrace.
  • Loading branch information
ledsoft committed May 11, 2016
1 parent 5a466db commit 3960d0c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.FileNotFoundException;
import java.util.List;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
Expand Down Expand Up @@ -83,7 +84,11 @@ protected void initializeConnector() throws OwlapiDriverException {
" but the loaded ontology has IRI " + ontology.getOntologyID().getOntologyIRI());
}
} catch (OWLOntologyCreationException e) {
LOG.trace("Unable to load ontology from document.", e);
if (e.getCause() instanceof FileNotFoundException) {
LOG.trace("Ontology file {} does not exist.", storageProperties.getPhysicalURI());
} else {
LOG.trace("Unable to load ontology from document.", e);
}
tryCreatingOntology();
}
initializeReasonerFactory();
Expand Down

0 comments on commit 3960d0c

Please sign in to comment.