I'm getting a ClassCastException when importing the Foodon ontology owl file. An earlier version of the ontology owl file works, but newer revisions fail with the following error:
Failed to invoke procedure n10s.onto.import.fetch: Caused by: java.lang.ClassCastException: class org.eclipse.rdf4j.model.impl.SimpleIRI cannot be cast to class org.eclipse.rdf4j.model.Literal (org.eclipse.rdf4j.model.impl.SimpleIRI and org.eclipse.rdf4j.model.Literal are in unnamed module of loader 'app')
I believe I've found the offending change. Revision 28bc881f27a24687269b5ad75eb99217f5c6c464 adds <rdfs:comment rdf:resource="&obo;IAO_0000122"/> at line 13025. When I comment this out, the import works fine. With it in, the import fails.
I can also import the current revision by commenting out all rdfs:comment tags that use the rdf:resource attribute.
Is the rdf:resource attribute not allowed on the rdfs:comment tag? Or is this a bug with neosemantics?
The RDFSchema spec says that the range of the rdfs:comment predicate is meant to be a literal.
This means that in RDF/XML serialisation the usage of the rdfs:comment tag should be like in the rest of the cases: <rdfs:comment xml:lang="en">...some text...</rdfs:comment>
and not use the rdf:resource attribute.
Which leads me to think that this is a malformed RDF document.
That said, it would be relatively easy to have neosemantics deal with it and transform the uri in rdf:resource into a literal value. My concern is whether doing it would make neosemantics silently accept an error that should be flagged.
Let me think about it but I would suggest reporting it to the editors of the food onto.