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

digitalneoplasm opened this Issue Apr 29, 2015 · 2 comments


None yet
2 participants

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(<> <>)]
    at org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer.setPendingAnnotations(
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$TypeAxiomHandler.handleTriple(
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$HandlerAccessor.applyAnnotations(
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$HandlerAccessor$3.handleResourceTriple(
    at org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer.iterateResourceTriples(
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$HandlerAccessor.consumeAnnotatedAxioms(
    at org.semanticweb.owlapi.rdf.rdfxml.parser.TripleHandlers$HandlerAccessor.mopUp(
    at org.semanticweb.owlapi.rdf.rdfxml.parser.OWLRDFConsumer.endModel(
    at org.semanticweb.owlapi.rdf.rdfxml.parser.RDFParser.parse(
    at org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParser.parse(

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=""/>
Line 3504: <!-- has axiom label --> <obo:IAO_0010000 rdf:resource=""/>
Line 3757: <!-- has axiom label --> <obo:IAO_0010000 rdf:resource=""/> 
Line 3830: <!-- has axiom label --> <obo:IAO_0010000 rdf:resource=""/>

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


This comment has been minimized.


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


This comment has been minimized.


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