Jena 3.0 and Pellet

356 views
Skip to first unread message

Chris Snyder

unread,
Dec 3, 2015, 2:31:37 PM12/3/15
to Pellet Users

Hello,

I’m trying out some different reasoners in my test application which is using Jena 3.0. I wanted to try Pellet so I updated my Maven to grab:
<dependency>
<groupId>com.github.ansell.pellet</groupId>
<artifactId>pellet-jena</artifactId>
<version>2.3.6-ansell</version>
</dependency>

When I try to access the reasoner factory it is apparent from the error that the Pellet jar is using its own Jena version. 
java.lang.ClassCastException: org.mindswap.pellet.jena.PelletReasonerFactory cannot be cast to org.apache.jena.reasoner.ReasonerFactory

And upon further inspection I see:
package org.mindswap.pellet.jena;

import com.hp.hpl.jena.ontology.OntModelSpec;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.reasoner.Reasoner;
import com.hp.hpl.jena.reasoner.ReasonerFactory;
import com.hp.hpl.jena.reasoner.ReasonerRegistry;
import com.hp.hpl.jena.vocabulary.RDFS;
import com.hp.hpl.jena.vocabulary.ReasonerVocabulary;

/**
* @author Evren Sirin
*
*/
public class PelletReasonerFactory implements ReasonerFactory {

and I can understand why there is a class cast error. Is there a version of the Pellet reasoner that I can plug in to an application already using the org.apache.jena.* ?

I saw that Nicolas Paris had a similar question for an earlier Jena version but that solution did not help.

Thanks,
Chris

Chris Snyder

unread,
Dec 8, 2015, 3:22:26 PM12/8/15
to Pellet Users
To get Pellet to work with Jena 3.0.0 I believe I would need to fork the Pellet code and update all the Jena package paths in it to use the new “org.apache.jena.” location. Can anyone comment on that?

Soheil Roshankish

unread,
Mar 6, 2019, 9:33:42 AM3/6/19
to Pellet Users
Ciao Chris,  

I have kind of the same problem, could you use jena and pellet together? do you have such a program in GitHub and can you share it please to see how it looks like? Thanks.

Ignazio Palmisano

unread,
Mar 6, 2019, 3:22:01 PM3/6/19
to Soheil Roshankish, Pellet Users
I recommend using Openllet, it works with Jena 3.+

https://github.com/Galigator/openllet
> --
> You received this message because you are subscribed to the Google Groups "Pellet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pellet-users...@googlegroups.com.
> To post to this group, send email to pellet...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pellet-users/7e717570-39f2-40fe-89c9-e25469c36e78%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages