[Pellet-users] bug listing RDFTypes

Benjamin Good goodb at interchange.ubc.ca
Fri Mar 30 18:59:07 UTC 2007


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.

  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)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20070330/1a028acb/attachment-0003.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: exception-listing-types.owl
Type: application/octet-stream
Size: 1827 bytes
Desc: not available
Url : http://lists.owldl.com/pipermail/pellet-users/attachments/20070330/1a028acb/attachment-0002.obj 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20070330/1a028acb/attachment-0004.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phosphabase-no-QCRs-Ben2.owl
Type: application/octet-stream
Size: 126366 bytes
Desc: not available
Url : http://lists.owldl.com/pipermail/pellet-users/attachments/20070330/1a028acb/attachment-0003.obj 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owldl.com/pipermail/pellet-users/attachments/20070330/1a028acb/attachment-0005.htm 


More information about the Pellet-users mailing list