[Pellet-users] NPE When trying to create Pellet OntModel

Evren Sirin evren at clarkparsia.com
Sun Feb 24 16:04:50 UTC 2008


Daniel,

It seems that you are also affected by the xsdlib incompatibility issue. 
The second exception you report regarding BigTimeDurationValueType 
suggests this. This is similar to the problems reported by other people 
when they were trying to use Pellet inside Sun application server. I'm 
not sure how that exception causes the other NullPointerException but 
they certainly look related.

Cheers,
Evren

On 2/21/08 2:08 PM, Daniel E. Renfer wrote:
> Hello,
>
> I am trying to create an ontology model to do some reasoning with 
> Pellet against a model stored in MySQL for a servlet. Creating and 
> using the db-backed model and running SPARQL queries against it is 
> working fine, but when I try to create an OntModel, I am getting an 
> error.
>
> My code looks more or less like this:
>
> OntModelSpec spec = new OntModelSpec(PelletReasonerFactory.THE_SPEC );
> spec.setImportModelMaker( maker );
> Reasoner reasoner = PelletReasonerFactory.theInstance().create();
> spec.setReasoner(reasoner);
> OntModel ontModel = ModelFactory.createOntologyModel(spec, dbModel); 
> /* line 101 */
>
> and the error I'm getting is this:
>
> java.lang.NullPointerException
>     at java.util.Hashtable.put(Unknown Source)
>     at 
> org.mindswap.pellet.datatypes.DatatypeReasoner.defineDatatype(DatatypeReasoner.java:187) 
>
>     at 
> org.mindswap.pellet.datatypes.DatatypeReasoner.<init>(DatatypeReasoner.java:101) 
>
>     at org.mindswap.pellet.ABox.<init>(ABox.java:194)
>     at org.mindswap.pellet.KnowledgeBase.clear(KnowledgeBase.java:357)
>     at org.mindswap.pellet.KnowledgeBase.<init>(KnowledgeBase.java:267)
>     at org.mindswap.pellet.jena.OWLReasoner.<init>(OWLReasoner.java:90)
>     at 
> org.mindswap.pellet.jena.PelletInfGraph.<init>(PelletInfGraph.java:163)
>     at 
> org.mindswap.pellet.jena.PelletReasoner.bind(PelletReasoner.java:84)
>     at 
> com.hp.hpl.jena.ontology.impl.OntModelImpl.generateGraph(OntModelImpl.java:2729) 
>
>     at 
> com.hp.hpl.jena.ontology.impl.OntModelImpl.<init>(OntModelImpl.java:143)
>     at 
> com.hp.hpl.jena.ontology.impl.OntModelImpl.<init>(OntModelImpl.java:124)
>     at 
> com.hp.hpl.jena.rdf.model.ModelFactory.createOntologyModel(ModelFactory.java:402) 
>
>     at 
> net.kronkltd.mycyclopedia.processor.rdf.JenaProcessor.getModel(JenaProcessor.java:101) 
>
>     at [snip]
>
> Does anyone have any idea what I am doing wrong? Could this be related 
> to the errors in the org.mindswap.pellet.datatypes.XSD{time related} 
> classes?
>
> I am using the xsdlib.jar file that came with Jena 2.5.4 (which 
> appears to be identical to the one that Pellet 1.5.1 ships with)
>
> The error I'm getting there is: "The constructor 
> BigTimeDurationValueType(BigInteger, BigInteger, BigInteger, 
> BigInteger, BigInteger, BigDecimal) is undefined"
>
> Any help would be greatly appreciated.
>
> Daniel E. Renfer
> http://kronkltd.net/
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Pellet-users mailing list
> Pellet-users at lists.owldl.com
> http://lists.owldl.com/mailman/listinfo/pellet-users
> _______________________________________________
>
> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/



More information about the Pellet-users mailing list