[Pellet-users] Working on a copy of an OntModel raises an InternalReasonerException

Evren Sirin evren at clarkparsia.com
Wed Mar 19 18:23:32 UTC 2008


Hi Franz,

I've recorded this issue in the tracker [1]. My initial guess is this is 
a non-deterministic bug that occurs when the axioms in your ontology are 
processed in some certain order. This is probably why the exception is 
not thrown with the first model but with the copy. I'll look into this 
issue to figure out what exactly causes the exception.

Cheers,
Evren

[1] http://cvsdude.com/trac/clark-parsia/pellet-devel/ticket/109

On 3/19/08 10:43 AM, Franz Schenk wrote:
> Hi,
>
> i created a copy of an OntModel (which was in turn created using  Pellet
> as a reasoning engine), see the java-code below for details.
>
> However, working with that copy (esp. iterating over instances and their
> properties) reveals an unexpected (at least unexpected to me) behaviour.
>
> (The interested reader will find the error message below the program
> code at the end of this message.)
>
> Note that the error disappears when the copy of the pellet-model is
> created using any different OntModelSpec.
>
> What I'd like to ask here is whether there is anything obvious going
> wrong with either my approach or the behaviour of the reasoning engine?
>
> Best regards,
> Franz
>
>
>
>
> import org.mindswap.pellet.jena.PelletReasonerFactory;
> import com.hp.hpl.jena.ontology.Individual;
> import com.hp.hpl.jena.ontology.OntClass;
> import com.hp.hpl.jena.ontology.OntModel;
> import com.hp.hpl.jena.rdf.model.Model;
> import com.hp.hpl.jena.rdf.model.ModelFactory;
> import com.hp.hpl.jena.rdf.model.Statement;
> import com.hp.hpl.jena.rdf.model.StmtIterator;
> import com.hp.hpl.jena.util.iterator.ExtendedIterator;
>
> public class TestOntModelCopy {
> public static void main(String[] args){
>
> Model model = ModelFactory.createDefaultModel();
> model.read("http://user.informatik.uni-goettingen.de/~schenk/data/family_ont.n3","N3");
>
> OntModel pelletmodel = ModelFactory.
> createOntologyModel(PelletReasonerFactory.THE_SPEC);
>
> pelletmodel.add(model);
>
> OntModel copyModel =
> ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
>
> //OntModel copyModel =
> // ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
> 		
> copyModel.add(pelletmodel);
> OntClass owlThing =
> copyModel.getOntClass("http://www.w3.org/2002/07/owl#Thing");
> 		
> ExtendedIterator instanceIter = owlThing.listInstances();
> while (instanceIter.hasNext()) {
> 	Object ind_obj = instanceIter.next();
> 	if (ind_obj instanceof Individual ) {
> 		Individual individual = (Individual) ind_obj;
> 		StmtIterator propertyiter2 =
> 	 		individual.listProperties();
> 		while (propertyiter2.hasNext()) {
> 			Statement statement =
> 				propertyiter2.nextStatement();
> 			System.out.println(statement.toString());
> 		}
> 		propertyiter2.close();
> 	}
> }
> instanceIter.close();
> }
> }
>
>
>
> ========================================================================================
>
> Exception in thread "main"
> org.mindswap.pellet.exceptions.InternalReasonerException: Trying to
> remove a non-existing edge [http://foo.org/dummy#Deby,
> http://foo.org/dummy#hasAncestor, http://foo.org/dummy#Charlene] - [0-{0}]
> 	at org.mindswap.pellet.Node.removeInEdge(Node.java:291)
> 	at org.mindswap.pellet.Individual.prune(Individual.java:1068)
> 	at
> org.mindswap.pellet.CompletionStrategy.mergeIndividuals(CompletionStrategy.java:2144)
> 	at
> org.mindswap.pellet.CompletionStrategy.mergeTo(CompletionStrategy.java:2064)
> 	at
> org.mindswap.pellet.CompletionStrategy.applyNominalRule(CompletionStrategy.java:1983)
> 	at
> org.mindswap.pellet.CompletionStrategy.applyNominalRule(CompletionStrategy.java:1896)
> 	at
> org.mindswap.pellet.CompletionStrategy.applyNominalRule(CompletionStrategy.java:1867)
> 	at org.mindswap.pellet.SROIQStrategy.complete(SROIQStrategy.java:150)
> 	at org.mindswap.pellet.ABox.isConsistent(ABox.java:1605)
> 	at org.mindswap.pellet.ABox.isType(ABox.java:1088)
> 	at org.mindswap.pellet.KnowledgeBase.retrieve(KnowledgeBase.java:3395)
> 	at org.mindswap.pellet.KnowledgeBase.getInstances(KnowledgeBase.java:2681)
> 	at org.mindswap.pellet.KnowledgeBase.getDifferents(KnowledgeBase.java:2395)
> 	at
> org.mindswap.pellet.jena.PelletInfGraph.differentFromIterator(PelletInfGraph.java:1022)
> 	at
> org.mindswap.pellet.jena.PelletInfGraph.findInABox(PelletInfGraph.java:375)
> 	at
> org.mindswap.pellet.jena.PelletInfGraph.findWithContinuation(PelletInfGraph.java:212)
> 	at
> com.hp.hpl.jena.reasoner.BaseInfGraph.graphBaseFind(BaseInfGraph.java:345)
> 	at com.hp.hpl.jena.graph.impl.GraphBase.find(GraphBase.java:257)
> 	at
> com.hp.hpl.jena.rdf.model.impl.ModelCom.listStatements(ModelCom.java:385)
> 	at
> com.hp.hpl.jena.rdf.model.impl.ModelCom.listStatements(ModelCom.java:390)
> 	at
> com.hp.hpl.jena.rdf.model.impl.ResourceImpl.listProperties(ResourceImpl.java:152)
> 	at
> org.semwebtech.dlflorid.test.TestOntModelCopy.main(TestOntModelCopy.java:34)
> _______________________________________________
> 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