protegeproject / protege-distribution

Build files for the protege distribution that includes 3rd party plugins
BSD 2-Clause "Simplified" License
125 stars 39 forks source link

Parsing OBO file fails if it imports another OBO file #28

Open cbielow opened 2 years ago

cbielow commented 2 years ago

Trying to open https://raw.githubusercontent.com/HUPO-PSI/psi-ms-CV/master/psi-ms.obo in Protege 5.5 fails. The log shows:

  INFO  11:02:13  Finished loading https://raw.githubusercontent.com/HUPO-PSI/psi-ms-CV/master/psi-ms.obo
  ERROR  11:02:13  An error occurred whilst loading the ontology at https://raw.githubusercontent.com/HUPO-PSI/psi-ms-CV/master/psi-ms.obo. Cause: Could not load imported ontology: <http://purl.obolibrary.org/obo/pato.obo> Cause: Problem parsing http://purl.obolibrary.org/obo/pato.obo
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) org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParser@334b08db
2) org.semanticweb.owlapi.owlxml.parser.OWLXMLParser@251ad59c
3) org.semanticweb.owlapi.functional.parser.OWLFunctionalSyntaxOWLParser@56ed667f

which mean that Protege is trying to parse this line in psi-ms.obo:

import: http://purl.obolibrary.org/obo/pato.obo

using an XML parser (and fails, since OBO is not XML...)

Now, obviously, Protege knows how to parse OBO, but seems to invoke the wrong parser when encountering an import.

Quickfix: Replacing the imports to use OWL instead of OBO leads to successful parse:

import: http://purl.obolibrary.org/obo/pato.owl

But I feel this is a bug in Protege, unless import ... should not be used for OBOs, but I don't see why that would be?!

cbielow commented 2 years ago

Here is a minimal example, which I feel should parse successfully:

Minimal example (save as bug.obo)

import: http://purl.obolibrary.org/obo/pato.obo

[Typedef]
id: has_regexp
name: has regexp