简体   繁体   中英

“Could not parse ontology” that was included into other ontology(owl-api)

I try to load an ontology (test.owl) that includes bfo.owl. Versions of the used APIs:

OWL-API 3.4.3

hermit 1.3.8.4

It is possible to open the test ontology with Protégé 5. But when I try to load test.owl with my code, I get the error message below, which I don't understand. Is there anybody out there who can help me understanding the message and finding a way to load the ontology?

org.semanticweb.owlapi.model.UnloadableImportException: Could not load imported ontology: http://purl.obolibrary.org/obo/bfo/2014-05-03/bfo.owl Cause: Problem parsing http://purl.obolibrary.org/obo/bfo/2014-05-03/bfo.owl

Could not parse ontology.  Either a suitable parser could not be found, or parsing failed.  See parser logs below for explanation.
The following parsers were tried:
1) RDFXMLParser
2) OWLXMLParser
3) OWLFunctionalSyntaxOWLParser
4) TurtleOntologyParser
5) OWLOBOParser
6) KRSS2OWLParser
7) ManchesterOWLSyntaxOntologyParser


Detailed logs:
--------------------------------------------------------------------------------
Parser: RDFXMLParser
org.xml.sax.SAXParseException; systemId: http://purl.obolibrary.org/obo/bfo/2014-05-03/bfo.owl; lineNumber: 1; columnNumber: 50; Leerstellen erforderlich zwischen publicId und systemId.

--------------------------------------------------------------------------------
Parser: OWLXMLParser
org.xml.sax.SAXParseException; systemId: http://purl.obolibrary.org/obo/bfo/2014-05-03/bfo.owl; lineNumber: 1; columnNumber: 50; Leerstellen erforderlich zwischen publicId und systemId

Sorry for having the second part of the error message in a different style - but as I am not allowed to have more than 2 links in a text (due to lack of reputation) and I still wanted you to be able to test the link to bfo.owl, I had to be creative.

Owlapi 3.4 is ancient and many bugs have been fixed since. Protégé 5 uses 4.2.5.

There is a HermiT release compatible with owlapi 4, search Maven Central for version 1.3.8.413 (I curated the fork, it's released under net.sourceforge.owlapi).

This is also the HermiT version bundled with Protege 5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM