I downloaded OWL API maven project and opened OWL API Default Implementation. I just want to load an ontology but it gives me an error.
public static final IRI example_iri2 = IRI.create("http://mged.sourceforge.net/ontologies/MGEDOntology.owl");
public static void main(String[] arg) throws OWLOntologyCreationException {
OWLDataFactoryImpl factoryImpl = new OWLDataFactoryImpl();
ReadWriteLock readWriteLock = new NoOpReadWriteLock();
OWLOntologyManagerImpl managerImpl = new OWLOntologyManagerImpl(factoryImpl, readWriteLock);
OWLOntology ontology = managerImpl.loadOntology(example_iri2);
}
The output is:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" org.semanticweb.owlapi.model.OWLOntologyFactoryNotFoundException: Could not find an appropriate factory to load ontology from ontology document: <http://mged.sourceforge.net/ontologies/MGEDOntology.owl>
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:1048)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:935)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:891)
at com.main.main.main(main.java:33)
------------------------------------------------------------------------
BUILD FAILURE
How can I fix this? I tried this and it's not working.
File file = new File("pizza3.owl");
OWLOntology ontology = managerImpl.loadOntologyFromOntologyDocument(file);
OWLOntologyManagerwill be created viaOWLOntologyManager manager = OWLManager.createOWLOntologyManager();- UninformedUser