When parsing a set of ontologies, some of the files give me the following error while others work well (Note that I am using OWL API 5.1.6):
uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1033)
uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:933)
uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadImports(OWLOntologyManagerImpl.java:1630)
....
Could not parse JSONLD org.eclipse.rdf4j.rio.jsonld.JSONLDParser.parse(JSONLDParser.java:110)
org.semanticweb.owlapi.rio.RioParserImpl.parseDocumentSource(RioParserImpl.java:172)
org.semanticweb.owlapi.rio.RioParserImpl.parse(RioParserImpl.java:125)
....
Stack trace:
org.eclipse.rdf4j.rio.RDFParseException: unqualified attribute 'class' not allowed [line 3, column 65]
org.semanticweb.owlapi.rio.RioParserImpl.parse(RioParserImpl.java:138)
uk.ac.manchester.cs.owl.owlapi.OWLOntologyFactoryImpl.loadOWLOntology(OWLOntologyFactoryImpl.java:193)
uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.load(OWLOntologyManagerImpl.java:1071)
uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1033)
uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:933)
uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadImports(OWLOntologyManagerImpl.java:1630)
....
and many errors like those. Any idea how to fix this problem(s)?
update:
The snippet that loads the ontology is:
File file = new File("C:\\vocabs\\" + Ontofile.getName());
OWLOntologyManager m = OWLManager.createOWLOntologyManager();
OWLOntology o;
o = m.loadOntologyFromOntologyDocument(file);
OWLDocumentFormat format = m.getOntologyFormat(o);
OWLOntologyXMLNamespaceManager nsManager = new
OWLOntologyXMLNamespaceManager(o, format);