[Pellet-users] bug listing RDFTypes

Benjamin Good goodb at interchange.ubc.ca
Fri Mar 30 21:02:25 UTC 2007


Great news, always glad to hear I'm not crazy.

I tried your fix, but it produced the same result  - see below for  
new file defining a troublemaking individual.  There are still  
unnamed restriction classes in the main ontology, could these be  
causing the problem?

thanks for your help - and for keeping Pellet public
-Ben


<rdf:RDF
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:daml="http://www.daml.org/2001/03/daml+oil#"
     xmlns:j.0="http://www.owl-ontologies.com/unnamed.owl#" >
   <rdf:Description rdf:about="http://www.owl-ontologies.com/ 
unnamed.owl#rand9GenRcontainsDomainIPR003961ORIPR008957">
     <owl:cardinality rdf:datatype="http://www.w3.org/2001/ 
XMLSchema#int">2</owl:cardinality>
     <owl:onProperty rdf:resource="http://www.owl-ontologies.com/ 
unnamed.owl#containsDomainIPR003961ORIPR008957"/>
     <rdf:type rdf:resource="http://www.w3.org/2002/07/ 
owl#Restriction"/>
   </rdf:Description>
   <rdf:Description rdf:about="http://www.owl-ontologies.com/ 
unnamed.owl#rand9GenRcontainsDomainIPR001071">
     <owl:cardinality rdf:datatype="http://www.w3.org/2001/ 
XMLSchema#int">3</owl:cardinality>
     <owl:onProperty rdf:resource="http://www.owl-ontologies.com/ 
unnamed.owl#containsDomainIPR001071"/>
     <rdf:type rdf:resource="http://www.w3.org/2002/07/ 
owl#Restriction"/>
   </rdf:Description>
   <rdf:Description rdf:about="http://www.owl-ontologies.com/ 
unnamed.owl#rand9">
     <rdf:type rdf:resource="http://www.owl-ontologies.com/ 
unnamed.owl#rand9GenRcontainsDomainIPR001071"/>
     <rdf:type rdf:resource="http://www.owl-ontologies.com/ 
unnamed.owl#rand9GenRcontainsDomainIPR003961ORIPR008957"/>
   </rdf:Description>
</rdf:RDF>





On Mar 30, 2007, at 1:30 PM, Evren Sirin wrote:

> 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.listDirectPropertyValue 
>> s(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/
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20070330/b35cf5ec/attachment-0001.htm 


More information about the Pellet-users mailing list