FAIR-IMPACT / MOD

Metadata for Ontology Description and Publication Ontology
Creative Commons Attribution 4.0 International
20 stars 8 forks source link

mod-v2.0_ontology.owl is malformed / unparseable #62

Closed jvendetti closed 4 months ago

jvendetti commented 4 months ago

I'm unable to open the mod-v2.0_ontology.owl ontology either via the Protege ontology editor (v5.6.3), or programmatically using the OWL API (v4.5.26).

This is the error dialog that appears after attempting to open the OWL file in Protege:

Screenshot 2024-02-21 at 1 40 41 PM

This is a code snippet to load the OWL file via the OWL API:

File file = new File("src/test/resources/MOD/mod-v2.0_ontology.owl");
FileDocumentSource fileDocumentSource = new FileDocumentSource(file);
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.loadOntologyFromOntologyDocument(fileDocumentSource);

... which results in the following stack trace:

org.semanticweb.owlapi.io.UnparsableOntologyException: Problem parsing file:/Users/vendetti/Development/IntelliJProjects/owlapi-example-code/src/test/resources/MOD/mod-v2.0_ontology.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) org.semanticweb.owlapi.rdf.rdfxml.parser.RDFXMLParser@18245eb0
2) org.semanticweb.owlapi.owlxml.parser.OWLXMLParser@740abb5
3) org.semanticweb.owlapi.functional.parser.OWLFunctionalSyntaxOWLParser@61a002b1
4) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.RioTurtleDocumentFormatFactory@95fd655c
5) org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxOntologyParser@160396db
6) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.NQuadsDocumentFormatFactory@6f9c39ad
7) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.RDFJsonDocumentFormatFactory@cd748dc3
8) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.NTriplesDocumentFormatFactory@937ecd36
9) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.TrigDocumentFormatFactory@27e81c
10) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.RDFJsonLDDocumentFormatFactory@dcacc47d
11) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.BinaryRDFDocumentFormatFactory@3bf24493
12) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.RioRDFXMLDocumentFormatFactory@69b9a3bc
13) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.N3DocumentFormatFactory@9a5
14) org.semanticweb.owlapi.rdf.turtle.parser.TurtleOntologyParser@6fa0450e
15) org.semanticweb.owlapi.oboformat.OBOFormatOWLAPIParser@7b27e8f4
16) org.semanticweb.owlapi.krss2.parser.KRSS2OWLParser@43f9dd56
17) org.semanticweb.owlapi.rio.RioParserImpl : org.semanticweb.owlapi.formats.RDFaDocumentFormatFactory@264e8d

Are there any plans to rectify this?

jonquet commented 4 months ago

This file is still maintained by @biswanathdutta . Surprised it does not parse (anymore?).

New release of MOD is planned soon but maybe @biswanathdutta you can still look into this ?

@jvendetti FYI: I am mostly using the file: https://github.com/FAIR-IMPACT/MOD/blob/main/mod-v2.0_profile.ttl Which is a bit different (avoid the issues related to represent MOD as an ontology) and focus only on the listing of properties MOD recommend.

biswanathdutta commented 4 months ago

@jonquet I am unable to edit the file. Seems some access problem. Anyway, got the solution.

@agbeltran @jonquet @jvendetti The solution: end rdfs:label with ";" (line no. 2981) and rdfs:comment by "." (line no. 2982).

This will solve the parsing problem. Please let me know.

jvendetti commented 4 months ago

Thanks @biswanathdutta! I can confirm that these modifications fix the loading errors. I've submitted a pull request just now with the necessary modifications.

jvendetti commented 4 months ago

FYI @jonquet - the mod-v2.0_profile.ttl file is also malformed:

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.turtle.parser.TurtleOntologyParser@fd46303

Detailed logs:
--------------------------------------------------------------------------------
Parser: org.semanticweb.owlapi.rdf.turtle.parser.TurtleOntologyParser@fd46303
    Stack trace:
org.semanticweb.owlapi.rdf.turtle.parser.ParseException: Encountered " <PNAME_LN> "schema:Dataset "" at line 1409, column 45.
Was expecting:
    "." ...

Let me know if you'd like a separate ticket on this. Or if you know the fix, I can add another commit to my pull request.

biswanathdutta commented 4 months ago

@jonquet @agbeltran @jvendetti Please end line 1406 with ";" (instead of ".").

This will resolve the parsing problem. Please let me know.