-
Notifications
You must be signed in to change notification settings - Fork 315
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
RDF/XML parser is silently failing to load ontology containing XMLLiteral #496
Comments
The datatype IRI is correct for XMLLiterals, but it does not seem to be used in RDF/XML - only the Stands to reason that the datatype declaration should be used as well, but I can't find references saying that it's al allowed behaviour. XMLLiteral is defined in RDF, so I took a look, but the definition seems almost circular, in that it refers RDF/XML, and is quite terse: https://www.w3.org/TR/2004/REC-rdf-concepts-20040210/#dfn-rdf-XMLLiteral I'd be tempted to allow both forms under lax parsing, although if possible it would be better to change the tools that created these literals. Regarding the lack of thrown exceptions, this is because the default parsing mode is lax; under lax mode, remaining unparsed triples do not cause exceptions to be thrown - a conforming parser really shouldn't do that, but the whole lax parsing functionality is designed to handle data with syntactic errors, to avoid throwing errors on so many real world ontologies. |
Incidentally, the example in the specs:
is not great, as the namespace |
/shame |
Speaking of which, I got exceptions attempting to parse this with RDF/XML - I suspect the lack of exceptions in this case is due to not specifying a format, and another parser not throwing an error. In the past, this has happened because of the OBO parser (e.g., it accepts a preamble in Manchester syntax). |
Oh guess I did forget to mention that I produced the ontology programmatically with the OWL API 4.2.0. I didn't specify a format when parsing it, so that explains it. The empty ontology is reported to be in RDF/XML syntax. |
I fixed the incorrect output in 4.2.0 (4.2.1 has just been released). The empty ontology still needs investigation. However, you should no longer get in this situation with 4.2.1 |
OWLAPI bug caused unparseable output. Allow it to be read and saved correctly.
OWLAPI bug caused unparseable output. Allow it to be read and saved correctly.
Loading the ontology below yields no errors/exceptions, yet the resulting OWLOntology object contains 0 axioms and 0 entities. I guess it's failing due to the XMLLiteral, but I expected an exception.
By replacing
rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"
, withrdf:parseType="Literal"
the ontology loads fine, and Protégé correctly interprets the literal as an XMLLiteral, though this is perhaps a separate issue--maybe related to #412 or #439 .The text was updated successfully, but these errors were encountered: