我想用Jena Pellet API
as来推断owl 文件Reasoner
中的新数据。我已经下载了jar 文件pellet.jar并将它附加到我的Eclipse java 项目中。但是,我在运行我的项目时仍然收到此错误消息。
有人可以知道我在这里错过了什么吗?
这是我的代码
public class Mainprogram {
public static String FILENAME = "file:./sample.owl";
public static void main( String[] args ) {
new Mainprogram().run();
}
protected OntModel getSoctraceOntology(){
OntModel model = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
model.read(FILENAME, null, "RDF/XML");
// validation report
ValidityReport report = model.validate();
printIterator(report.getReports(), "Validation Rresults");
return model;
}
}
这是错误消息
Exception in thread "main" java.lang.NoClassDefFoundError: com/clarkparsia/pellet/rules/ContinuousRulesStrategy
at org.mindswap.pellet.jena.OWLReasoner.<init>(OWLReasoner.java:90)
at org.mindswap.pellet.jena.PelletInfGraph.<init>(PelletInfGraph.java:146)
at org.mindswap.pellet.jena.PelletReasoner.bind(PelletReasoner.java:78)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.generateGraph(OntModelImpl.java:2744)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.<init>(OntModelImpl.java:139)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.<init>(OntModelImpl.java:128)
at com.hp.hpl.jena.rdf.model.ModelFactory.createOntologyModel(ModelFactory.java:410)
at soctrace.Mainprogram.getSoctraceOntology(Mainprogram.java:72)
at soctrace.Mainprogram.run(Mainprogram.java:39)
at soctrace.Mainprogram.main(Mainprogram.java:34)
Caused by: java.lang.ClassNotFoundException: com.clarkparsia.pellet.rules.ContinuousRulesStrategy
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 10 more
谢谢你的帮助。
版
我正在使用pellet-1.3.zip
从 mindswap.org 下载的文件和从java2s.com下载的pellet.core.jar
文件