New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BFO fails to load in API version 4.0.X #405

Closed
digitalneoplasm opened this Issue Apr 29, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@digitalneoplasm

digitalneoplasm commented Apr 29, 2015

I'm not sure exactly why this is happening, but in the OWL API 4.0.1 and 4.0.2 The BFO (Basic Formal Ontology) fails to load, and so do any ontologies which depend on it. The error produced is:

Exception in thread "main" org.semanticweb.owlapi.model.OWLRuntimeException: 1 pending annotations should have been used by now. [Annotation(<http://purl.obolibrary.org/obo/IAO_0010000> <http://purl.obolibrary.org/obo/bfo/axiom/0000602>)]
    at org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer.setPendingAnnotations(OWLRDFConsumer.java:567)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$TypeAxiomHandler.handleTriple(TripleHandlers.java:2752)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$HandlerAccessor.applyAnnotations(TripleHandlers.java:170)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$HandlerAccessor$3.handleResourceTriple(TripleHandlers.java:199)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer.iterateResourceTriples(OWLRDFConsumer.java:2484)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$HandlerAccessor.consumeAnnotatedAxioms(TripleHandlers.java:194)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$HandlerAccessor.mopUp(TripleHandlers.java:377)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer.endModel(OWLRDFConsumer.java:1494)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.RDFParser.parse(RDFParser.java:134)
    at org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParser.parse(RDFXMLParser.java:81)
    at uk.ac.manchester.cs.owl.owlapi.ParsableOWLOntologyFactory.loadOWLOntology(ParsableOWLOntologyFactory.java:159)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:958)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:896)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:911)

Removing the offending annotations repeatedly reveals that there are four lines in BFO which bring about this error:

Line 1404: <!-- has axiom label --> <obo:IAO_0010000 rdf:resource="http://purl.obolibrary.org/obo/bfo/axiom/0000602"/>
Line 3504: <!-- has axiom label --> <obo:IAO_0010000 rdf:resource="http://purl.obolibrary.org/obo/bfo/axiom/0000601"/>
Line 3757: <!-- has axiom label --> <obo:IAO_0010000 rdf:resource="http://purl.obolibrary.org/obo/bfo/axiom/0000602"/> 
Line 3830: <!-- has axiom label --> <obo:IAO_0010000 rdf:resource="http://purl.obolibrary.org/obo/bfo/axiom/0000601"/>

BFO was known to load properly in API version 3.4.10, but seems to have broken in the 4.0 series.

@ignazio1977

This comment has been minimized.

Contributor

ignazio1977 commented May 10, 2015

The error arises because of duplicated annotation axioms in the ontology - this confuses the code enough that it's trying to add the second annotation to the first axiom parsed. However, there's really no need to fail in this case: the duplicated axiom is identical to the existing axiom, so it can be dropped silently.

The exception was introduced at some point after 3.4.10, but there is no detail on exactly what was being achieved by adding it. The exact commit that made the change seems to have been lost in history when I refactored the parsers packages.

There are no tests failing because of the change, so I'm adding a fragment of BFO that reproduces the error to our test suite.

ignazio1977 added a commit that referenced this issue May 10, 2015

@ignazio1977

This comment has been minimized.

Contributor

ignazio1977 commented May 10, 2015

Fixed in version 4 (to be released as 4.1.0) and version 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment