0

I am trying to import Pellet reasoner into Jena, the newest version of Pellet is 2.3.1 where I can't find any .jar file to be imported. Also, I followed the Wiki/FAQ to run the bash file in the release folder under Mac OS. The error message shown as:

Error: Unable to access jarfile lib/pellet-cli.jar

It seems that I have to export a jar file by myself and import the jar into my Jena workplace and I did, but Java exception appears when I use OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );

The exception message is:

java.lang.NoClassDefFoundError:
org/mindswap/pellet/utils/progress/ProgressMonitor
at org.mindswap.pellet.jena.PelletReasoner.bind(PelletReasoner.java:95)
at org.mindswap.pellet.jena.PelletReasoner.bind(PelletReasoner.java:1)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.generateGraph(OntModelImpl.java:2852)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.<init>(OntModelImpl.java:142)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.<init>(OntModelImpl.java:131)
at com.hp.hpl.jena.rdf.model.ModelFactory.createOntologyModel(ModelFactory.java:300)
at smarthome.ReasoningController.main(ReasoningController.java:113)
at smarthome.SmartHomeGUI.main(SmartHomeGUI.java:34)
... 11 more
Caused by: java.lang.ClassNotFoundException: org.mindswap.pellet.utils.progress.ProgressMonitor
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)
... 19 more` 

How can I fix this problem? Thanks in advance.

Ev3rlasting
  • 2,145
  • 4
  • 18
  • 31
  • May be you have to check your imports, if you are using pellet with Jena. You have to use the reasoner factory designed for Jena, for your code example, those imports works for me : import org.mindswap.pellet.jena.PelletReasonerFactory; import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.rdf.model.ModelFactory; – Hatim Apr 07 '15 at 12:47

2 Answers2

0

User ignazio1977 over on google groups created a git repository from which you can download a .zip archive of the various jars needed for pellet. It looks like your missing a class package and this might solve your problem.

https://github.com/ignazio1977/pellet/blob/releases/pellet-distribution-2.3.2-SNAPSHOT-dist.zip

Batman22
  • 376
  • 4
  • 25
-1

first off @Pranay's answer is dead on. However both Jena and Pellet have been updated since then. Jena is now in version 2.13.x and pellet is in 2.4.0 Therefore if you want to update to the latest you are going to have to create a new pellet .jar file. Please refer to this file https://github.com/Complexible/pellet/blob/master/pom.xml
in order to find out all of the dependencies and their respective versions.

Kunal Khaladkar
  • 493
  • 3
  • 16
  • The latest version of Pellet is v2.4.0-SNAPSHOT at the point of this writing and not 4.0.0. And Ignazios branch has been merged into Pellet. – F Lekschas Sep 02 '15 at 22:04