I am trying to execute following code.
import java.io.File;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.AddAxiom;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLAxiom;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
public class Snippet {
public static void main(String[] args) throws OWLOntologyCreationException {
File file = new File(
"file:///c/Users/DTN/Desktop/Final SubmissionFilteringMechanism_Ontology.owl");
OWLOntologyManager m = OWLManager.createOWLOntologyManager();
OWLDataFactory f = OWLManager.getOWLDataFactory();
OWLOntology o;
o = m.loadOntologyFromOntologyDocument(file);
OWLClass clsA = f.getOWLClass(IRI.create("urn:test#ClassA"));
OWLClass clsB = f.getOWLClass(IRI.create("urn:test#ClassB"));
OWLAxiom ax1 = f.getOWLSubClassOfAxiom(clsA, clsB);
AddAxiom addAxiom1 = new AddAxiom(o, ax1);
m.applyChange(addAxiom1);
for (OWLClass cls : o.getClassesInSignature()) {
System.out.println(cls.getIRI());
}
m.removeOntology(o);
}
}
It is generating following error.
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/Provider at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at test.main(test.java:18) Caused by: java.lang.ClassNotFoundException: com.google.inject.Provider at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 25 more
Please some body help me out. thanks in advance.