Open jvendetti opened 4 years ago
As an initial troubleshooting step, I attempted to open the ontology in Protege (v 5.5.0). The Protege log file displayed many axiom transform errors:
ERROR 16:29:04 Attempt to transform an axiom to correct misuse of properties failed. Property replacement: {<http://www.w3.org/2008/05/skos#prefLabel>=<http://www.w3.org/2008/05/skos#prefLabel>, <http://www.w3.org/2008/05/skos#hiddenLabel>=<http://www.w3.org/2008/05/skos#hiddenLabel>, <http://www.w3.org/2008/05/skos#definition>=<http://www.w3.org/2008/05/skos#definition>, <http://www.w3.org/2008/05/skos#altLabel>=<http://www.w3.org/2008/05/skos#altLabel>}, axiom: AnnotationAssertion(<http://www.w3.org/2008/05/skos#definition> <http://www.w3.org/2008/05/skos#historyNote> "A note about the past state/use/meaning of a concept."@en), error: uk.ac.manchester.cs.owl.owlapi.OWLLiteralImplPlain cannot be cast to org.semanticweb.owlapi.model.IRI
Contacted the author and asked if he could resolve the errors and resubmit. The author replied that he had fixed the errors and resubmitted the ontology. The re-submission still failed to process, so I downloaded the new version and found the errors were still present in Protege.
I contacted the author a second time and asked him to send me a copy of the "fixed" ontology privately in the event something had gone wrong with the re-submission. I received a response with a private copy of the ontology, but again - the errors were still present in Protege.
I then corresponded with Rafael from the Protege team to see if he could tell me the source of the errors in Protege. His response:
I think the problem is that the ontology imports the skos and foaf vocabularies explicitly. Generally, there is no need to do that. One can just use whatever property from skos (e.g., prefLabel) or from foaf. By removing those 2 imported ontologies, the ModSci ontology loads without errors/warnings in Protege Same way one doesn’t have to import RDFS vocabulary to use rdfs:label
I removed the skos and foaf vocabulary imports as Rafael recommended and uploaded the modified version. However, the ontology still fails to process with the same exception as above.
More troubleshooting: the rapper RDF parsing utility reports no errors converting from RDF/XML format to N-Triples:
[ncbo-deployer@ncbo-prd-app-31 3]$ pwd
/srv/ncbo/repository/MODSCI/3
[ncbo-deployer@ncbo-prd-app-31 3]$ rapper -i rdfxml -o ntriples owlapi.xrdf > data.triples
rapper: Parsing URI file:///srv/ncbo/share/env/production/repository/MODSCI/3/owlapi.xrdf with parser rdfxml
rapper: Serializing with serializer ntriples
rapper: Parsing returned 1132 triples
[ncbo-deployer@ncbo-prd-app-31 3]$ rapper -i ntriples -c data.triples
rapper: Parsing URI file:///srv/ncbo/share/env/production/repository/MODSCI/3/data.triples with parser ntriples
rapper: Parsing returned 1132 triples
More troubleshooting: wrote a snippet of OWL API code to convert the RDF/XML to N-Triples format. Just like the rapper utility, the OWL API throws no errors during the conversion.
File xrdfFile = new File("/Users/jvendetti/Development/Examples/ontologies/modsci/owlapi.xrdf");
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.loadOntologyFromOntologyDocument(xrdfFile);
File nTriplesFile = new File("/Users/jvendetti/Development/Examples/ontologies/modsci/owlapi.ntriples");
manager.saveOntology(ontology, new NTriplesDocumentFormat(), IRI.create(nTriplesFile));
System is unable to process the MODSCI ontology. It passes the OWL API parsing step, but fails subsequently with the following stack trace: