[Pellet-users] bug listing RDFTypes
Evren Sirin
evren at clarkparsia.com
Fri Mar 30 20:30:58 UTC 2007
On 3/30/07 2:59 PM, Benjamin Good wrote:
> Dear Pellet people,
>
> I've noticed what appears to me to be a bug in Pellet1.4 (latest
> from svn).
>
> Using the files attached and the code below, I ~sometimes get a
> NullPointerException from the jena method ListRDFTypes . The fun part
> is that if I run exactly the same test program repeatedly, sometimes
> it works and sometimes it throws the exception.
Yes, this is a bug and it depends on which order the statements are
added to the KB. The internal hash tables change the order so that is
why the code sometimes works.
I will fix this bug but meanwhile you can get rid of the problem by
editing the OWL file. The problem would go away if the individual in
exceptions-listing-types.owl had rdf:type values that are only named
classes, i.e. [x rdf:type C], [C equivalentClass ...restriction...].
Regards,
Evren
>
> Any advice appreciated
>
> -Ben
>
>
>
>
> package org.icapture.ontology.evaluation;
>
> import org.mindswap.pellet.jena.PelletReasonerFactory;
>
> import com.hp.hpl.jena.ontology.Individual;
> import com.hp.hpl.jena.ontology.OntModel;
> import com.hp.hpl.jena.ontology.OntModelSpec;
> import com.hp.hpl.jena.rdf.model.ModelFactory;
> import com.hp.hpl.jena.rdf.model.Resource;
> import com.hp.hpl.jena.util.iterator.ExtendedIterator;
>
> public class BugCheck {
>
> /**
> * @param args
> */
> public static void main(String[] args) {
>
> OntModelSpec init = new OntModelSpec(PelletReasonerFactory.THE_SPEC);
> OntModel m = ModelFactory.createOntologyModel(init);
>
>
> m.read("file:ontologies/phosphabase-no-QCRS-Ben2.owl");
> m.read("file:ontologies/exception-listing-types.owl");
>
> Individual classified =
> m.getIndividual("http://www.owl-ontologies.com/unnamed.owl#rand9");
> //add all the type info to the original Ind
> try{
> ExtendedIterator r = classified.listRDFTypes(true);
> }catch(NullPointerException e){
> e.printStackTrace();
> }
>
>
> }
>
> }
>
> java.lang.NullPointerException
> at org.mindswap.pellet.Individual.isRedundantMin(Individual.java:406)
> at org.mindswap.pellet.Individual.addType(Individual.java:273)
> at org.mindswap.pellet.Individual.addType(Individual.java:262)
> at org.mindswap.pellet.ABox.addType(ABox.java:1633)
> at org.mindswap.pellet.KnowledgeBase.addType(KnowledgeBase.java:401)
> at org.mindswap.pellet.jena.OWLLoader.processTypes(OWLLoader.java:1182)
> at org.mindswap.pellet.jena.OWLLoader.load(OWLLoader.java:1985)
> at org.mindswap.pellet.jena.OWLReasoner.load(OWLReasoner.java:180)
> at
> org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:248)
> at
> org.mindswap.pellet.jena.PelletInfGraph.findWithContinuation(PelletInfGraph.java:198)
> at
> com.hp.hpl.jena.reasoner.BaseInfGraph.graphBaseFind(BaseInfGraph.java:344)
> at com.hp.hpl.jena.graph.impl.GraphBase.find(GraphBase.java:246)
> at
> com.hp.hpl.jena.rdf.model.impl.ModelCom.listStatements(ModelCom.java:379)
> at
> com.hp.hpl.jena.rdf.model.impl.ModelCom.listStatements(ModelCom.java:384)
> at
> com.hp.hpl.jena.ontology.impl.OntResourceImpl.listDirectPropertyValues(OntResourceImpl.java:1452)
> at
> com.hp.hpl.jena.ontology.impl.OntResourceImpl.listRDFTypes(OntResourceImpl.java:796)
> at org.icapture.ontology.evaluation.BugCheck.main(BugCheck.java:28)
>
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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