我正在使用Apache Jena OWL库在java程序中编写RESTful服务。我已经创建了我的本体。 " university.owl"并尝试加载它,以便我可以对它进行sqarql查询 当我使用
创建模型时OWLOntologyManager m=OWLManager.createOWLOntologyManager();
File file = new File(("D:/ontolog_project/universityont.owl"));
IRI iri = IRI.create(file);
System.out.println(iri);
System.out.println(iri.toString());
它完美无缺,但我使用
创建的那一刻Model model = ModelFactory.createDefaultModel();
我收到这样的错误
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at com.hp.hpl.jena.util.Metadata.<clinit>(Metadata.java:39)
at com.hp.hpl.jena.JenaRuntime.<clinit>(JenaRuntime.java:34)
at com.hp.hpl.jena.rdf.model.impl.RDFReaderFImpl.<clinit>(RDFReaderFImpl.java:73)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.<clinit>(ModelCom.java:54)
at com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel(ModelFactory.java:140)
at Demo.main(Demo.java:66)
`Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 6 more
我该如何解决?