[Pellet-users] NPE When trying to create Pellet OntModel
Daniel E. Renfer
duck at kronkltd.net
Thu Feb 21 19:08:36 UTC 2008
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/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.owldl.com/pipermail/pellet-users/attachments/20080221/969a8552/attachment.pgp
More information about the Pellet-users
mailing list