phenoscape/owlery

Error in loading ontologies

rpgoldman opened this issue · 1 comments

Previously, I had a single main ontology that imported all of the others, and I used that ontology's IRI in the owlery configuration file.

I now have two such ontologies, so instead of having the IRI of the single "leaf" ontology, I replaced that with the pathname of the directory holding all of my OWL files.

Now I get the following error trying to start up Owlery:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.phenoscape.owlery.Main$.initializeReasoners(Main.scala:81)
	at org.phenoscape.owlery.Main$.delayedEndpoint$org$phenoscape$owlery$Main$1(Main.scala:83)
	at org.phenoscape.owlery.Main$delayedInit$body.apply(Main.scala:23)
	at scala.Function0.apply$mcV$sp(Function0.scala:39)
	at scala.Function0.apply$mcV$sp$(Function0.scala:39)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
	at scala.App.$anonfun$main$1(App.scala:76)
	at scala.App.$anonfun$main$1$adapted(App.scala:76)
	at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
	at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:919)
	at scala.App.main(App.scala:76)
	at scala.App.main$(App.scala:74)
	at org.phenoscape.owlery.Main$.main(Main.scala:23)
	at org.phenoscape.owlery.Main.main(Main.scala)
Caused by: org.semanticweb.owlapi.model.OWLOntologyDocumentAlreadyExistsException
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1130)
	at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1097)
	at org.phenoscape.owlery.Owlery$.$anonfun$loadOntologyFromFolder$2(Owlery.scala:69)
	at scala.collection.StrictOptimizedIterableOps.map(StrictOptimizedIterableOps.scala:99)
	at scala.collection.StrictOptimizedIterableOps.map$(StrictOptimizedIterableOps.scala:86)
	at scala.collection.mutable.ArrayBuffer.map(ArrayBuffer.scala:42)
	at org.phenoscape.owlery.Owlery$.loadOntologyFromFolder(Owlery.scala:69)
	at org.phenoscape.owlery.Owlery$.loadKnowledgebase(Owlery.scala:54)
	at org.phenoscape.owlery.Owlery$.$anonfun$loadKnowledgebases$1(Owlery.scala:48)
	at scala.collection.StrictOptimizedIterableOps.map(StrictOptimizedIterableOps.scala:99)
	at scala.collection.StrictOptimizedIterableOps.map$(StrictOptimizedIterableOps.scala:86)
	at scala.collection.immutable.Set$Set1.map(Set.scala:156)
	at org.phenoscape.owlery.Owlery$.loadKnowledgebases(Owlery.scala:48)
	at org.phenoscape.owlery.Owlery$.<clinit>(Owlery.scala:23)
	... 15 more

I'm kind of at a loss for how to diagnose and repair this, since owlapi isn't telling me what ontology it thinks already exists (nor why it's a problem to load an ontology twice -- shouldn't that be an idempotent operation?).

I'm inclined to try to fix this by making a dummy leaf ontology that just loads the two leaf ontologies, provide that IRI, and leave it at that. But this seems yucky.

As a follow-up:

Any chance Owlery could log the contents of any OWLAPI exceptions it sees? This one has an ontologyDocumentIRI property that would be super helpful to see..

I'm going to close this, because I think I have figured it out.