information-artifact-ontology / IAO

information artifact ontology
Creative Commons Attribution 4.0 International
77 stars 25 forks source link

Reasoning error with HermiT #195

Closed jamesaoverton closed 7 years ago

jamesaoverton commented 7 years ago

I'm seeing a reasoning error when I open the current IAO OWL file from http://purl.obolibrary.org/obo/iao.owl (https://raw.githubusercontent.com/information-artifact-ontology/IAO/master/releases/2017-01-06/iao-merged.owl) in Protege 5.1.0 (macOS 10.12.3) then run HermiT 1.3.8 (413). I see the same error when I run HermiT from ROBOT. ELK 0.4.3 reasons without any errors (using Protege and ROBOT). I do not see the error with IAO 2015-02-23.

I don't recognize this error. Can anyone replicate?

2017-02-22 11:38:40.038 [Classification Thread] ERROR OWLReasonerManager    An error occurred during reasoning: Non-simple property '<http://purl.obolibrary.org/obo/BFO_0000066>' or its inverse appears in asymmetric object property axiom..
java.lang.IllegalArgumentException: Non-simple property '<http://purl.obolibrary.org/obo/BFO_0000066>' or its inverse appears in asymmetric object property axiom.
    at org.semanticweb.HermiT.structural.ObjectPropertyInclusionManager.rewriteAxioms(ObjectPropertyInclusionManager.java:104) ~[na:na]
    at org.semanticweb.HermiT.structural.OWLClausification.preprocessAndClausify(OWLClausification.java:161) ~[na:na]
    at org.semanticweb.HermiT.Reasoner.loadOntology(Reasoner.java:208) ~[na:na]
    at org.semanticweb.HermiT.Reasoner.<init>(Reasoner.java:199) ~[na:na]
    at org.semanticweb.HermiT.Reasoner.<init>(Reasoner.java:173) ~[na:na]
    at org.semanticweb.HermiT.ReasonerFactory.createHermiTOWLReasoner(ReasonerFactory.java:51) ~[na:na]
    at org.semanticweb.HermiT.ReasonerFactory.createReasoner(ReasonerFactory.java:19) ~[na:na]
    at org.protege.editor.owl.model.inference.ReasonerUtilities.createReasoner(ReasonerUtilities.java:20) ~[na:na]
    at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.ensureRunningReasonerInitialized(OWLReasonerManagerImpl.java:428) ~[na:na]
    at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.run(OWLReasonerManagerImpl.java:386) ~[na:na]
    at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_40]
zhengj2007 commented 7 years ago

The issue caused by IAO made some changes on the term in the imported RO core file. The logical axiom of BFO_000066 ('occurs in') has axiom 'inverse ('occurs in') under inverse of. And the Asymmetric, Irreflexive were also checked.

@alanruttenberg Could you please check and fix the issue? Thanks!

jonathanbona commented 7 years ago

It looks like this issue is caused by the subproperty chains in 'occurs in':

'occurs in' o 'part of' SubPropertyOf: 'occurs in' 'part of' o 'occurs in' SubPropertyOf: 'occurs in'

@alanruttenberg : are those necessary?

Taking thse out lets Hermit run far enough to decide that the ontology is inconsistent. In particular, it seems to think that both 'part of' and 'has part' are equivalent to a bunch of properties they shouldn't be, including each other.

alanruttenberg commented 7 years ago

Nasty. I will look into it.

alanruttenberg commented 7 years ago

Very strange. There are a bunch of properties marked irreflexive and antisymmetric in the merged file that don't appear in any of the source files. Try importing https://raw.githubusercontent.com/information-artifact-ontology/IAO/master/releases/2017-01-06/iao-main.owl - you should see that it reasons correctly.

I will now look to see how it's possible that these axioms are getting in there. My bad - while my release code runs the reasoner on the final ontology unmerged, it didn't run it on the merged ontology. I guess I didn't think there was any chance of the merge being problematic. Will dig further.

@jonathanbona those axioms look fine to me. In english:

if occurs in part of then it occurs in if a <some process (#1) > is part of <another process (#2)> that occurs in then #1 occurs in

Yes?

The problem is with the inexplicably (at the moment) added irreflexive and antisymmetric property declarations. To see that they are in the merge only, grep -r irreflexive in releases/2017-01-06/ . There is one hit in ro core, and many hits in iao-merged, but nowhere else.

alanruttenberg commented 7 years ago

As part of the merge inferred axioms are computed using org.semanticweb.owlapi.util.InferredOntologyGenerator This takes as one of its arguments a type of inference to generate. I was computing inferences for most of the types, including org.semanticweb.owlapi.util.InferredObjectPropertyCharacteristicAxiomGenerator Turns out that was adding the irreflexive and asymmetric axioms. I'm assuming they are incorrect, but I'll check. I suppose it is possible that they are correct but that adding them violates the global restrictions. Will figure out which and file a report/warning to the OWLAPI folks.

I'll add a reasoning check on the merged ontology to my release code.

Two choices: I can cut a new release, or I can just fix the 2017-01-06 release in place. Generally I wouldn't change a release, but in this case the release is garbage as is. Opinion?

FYI:

Code for making the release is at https://github.com/alanruttenberg/lsw2/blob/owlapiv4/owl2/release.lisp

Code that adds the inferred axioms is at https://github.com/alanruttenberg/lsw2/blob/owlapiv4/owl2/inferred-axioms.lisp

alanruttenberg commented 7 years ago

Interesting. Using InferredSubObjectPropertyAxiomGenerator causes there to be unsatisfiable classes. Now that's a puzzle. Anyways, removed that too for now. https://github.com/alanruttenberg/lsw2/commit/fa59709cba88c79251d100f46c6b824ce3ad18cf

jamesaoverton commented 7 years ago

Thanks for looking into this. My opinion is that a new release would be better.

zhengj2007 commented 7 years ago

@alanruttenberg Thanks for fixing the issue. I'd prefer to have a new release. Meanwhile, I think the 2017-01-06 release should be removed at least the PURL links. It don't make sense to keep a garbage version.

jamesaoverton commented 7 years ago

@zhengj2007 When we make a PURL, we're make a promise that the resource will be available permanently. This release has been out for two months, and people might be using it. It's not "garbage", it just has a bug.

alanruttenberg commented 7 years ago

New release committed and pull request https://github.com/OBOFoundry/purl.obolibrary.org/pull/315 to update the PURLs