[Pellet-users] exception when I add a second individual

Evren Sirin evren at clarkparsia.com
Fri Jul 25 02:38:25 UTC 2008


Looking at the stack trace I understand that you are using Pellet 
1.5-RC1 which is quite old. There have been many bug fixes and 
improvements since then. I strongly suggest you update to the latest 
release 1.5.2 and see if the problem goes away. If not we would need to 
see the complete program so we can run the program and reproduce the 
problem. Otherwise it is hard to tell what is going on.


Cheers,
Evren

On 7/17/08 12:30 PM, Fani wrote:
> Hi All,
> I'm  using Pellet-1.5 and OWLAPI in order to add individuals to an 
> ontology with this swrl rule : currentPosition(?x, ?y)  ?  
> mobility(?y, ?z) ->WhereCanGo(?x, ?z). This rule find out where a 
> person can go.
> I don't have problems when I add a Person individual and add to the 
> ontology the inferred axioms, but when I add another Person individual 
> the following exception is produced:
> 17-jul-2008 18:10:10 org.coode.owl.rdfxml.parser.OWLRDFConsumer endModel
> INFO: Total number of triples: 86
>
> 17-jul-2008 18:10:10 org.coode.owl.rdfxml.parser.OWLRDFConsumer endModel
>
> INFO: Loaded http://www.oomethod.com/pervml.owl
>
> Exception in thread "main" java.lang.NullPointerException
> at org.mindswap.pellet.ABox.getObjectPropertyValues(ABox.java:1264)
> at 
> org.mindswap.pellet.KnowledgeBase.getObjectPropertyValues(KnowledgeBase.java:3149) 
>
> at 
> org.mindswap.pellet.owlapi.Reasoner.getRelatedIndividuals(Reasoner.java:682) 
>
> at 
> org.mindswap.pellet.owlapi.Reasoner.getObjectPropertyRelationships(Reasoner.java:527) 
>
> at 
> org.semanticweb.owl.util.InferredPropertyAssertionGenerator.addAxioms(InferredPropertyAssertionGenerator.java:44) 
>
> at 
> org.semanticweb.owl.util.InferredPropertyAssertionGenerator.addAxioms(InferredPropertyAssertionGenerator.java:39) 
>
> at 
> org.semanticweb.owl.util.InferredEntityAxiomGenerator.createAxioms(InferredEntityAxiomGenerator.java:51) 
>
> at 
> org.semanticweb.owl.util.InferredOntologyGenerator.fillOntology(InferredOntologyGenerator.java:120) 
>
> at 
> axiomsInference.EjecucionReglas_inicial.executeRules(EjecucionReglas_inicial.java:145) 
>
> at 
> axiomsInference.EjecucionReglas_inicial.main(EjecucionReglas_inicial.java:56) 
>
>
>
> Can Anyone help me?
> I've attached my first ontology (ontology_location_person.owl) and the 
> ontology that I've obtained when I've added the first individual 
> (ontology_with_an_individual_added.owl).
>
> Thanks in advance.
>
> Regards,
> Fani
>
> The code that I use to add the person individual and add the inferred 
> axioms is the following:
>    ...
>    // Now create the new individual assertion axiom
>            OWLIndividual 
> newInd=factory.getOWLIndividual(URI.create("http://www.oomethod.com/pervml.owl#pepe")); 
>
>            OWLDescription 
> person=factory.getOWLClass(URI.create("http://www.oomethod.com/pervml.owl#Person")); 
>
>            OWLClassAssertionAxiom  assertion = 
> factory.getOWLClassAssertionAxiom(newInd, person);
>         // Finally, add the axiom to our ontology and save
>           AddAxiom addAxiomChange = new AddAxiom(ontology, assertion);
>                 // Now instanciate an object property from the new 
> individual and add the axiom to our ontology
>           OWLObjectProperty currentPosition= 
> factory.getOWLObjectProperty(URI.create("http://www.oomethod.com/pervml.owl#currentPosition")); 
>
>           OWLIndividual 
> kitchen=factory.getOWLIndividual(URI.create("http://www.oomethod.com/pervml.owl#Kitchen")); 
>
>                    OWLObjectPropertyAssertionAxiom  assertion2= 
> factory.getOWLObjectPropertyAssertionAxiom(newInd, currentPosition, 
> kitchen);
>           AddAxiom addAxiomChange2 = new AddAxiom(ontology, assertion2);
>                 // Now instanciate the name from the new individual 
> and add the axiom to our ontology
>           OWLDataProperty name= 
> factory.getOWLDataProperty(URI.create("http://www.oomethod.com/pervml.owl#name")); 
>
>           OWLDataType strin= 
> factory.getOWLDataType(URI.create("http://www.w3.org/2001/XMLSchema#string")); 
>
>           OWLConstant cons=factory.getOWLTypedConstant("pepe", strin); 
> //El string indica el tipo de la constante
>                    OWLDataPropertyAssertionAxiom  assertion3= 
> factory.getOWLDataPropertyAssertionAxiom(newInd, name, cons);
>           AddAxiom addAxiomChange3 = new AddAxiom(ontology, assertion3);
>                           manager.applyChange(addAxiomChange);
>           manager.applyChange(addAxiomChange2);
>           manager.applyChange(addAxiomChange3);
>           reasoner.refresh();
>           reasoner.classify();
>                    ///INFERRED AXIOMS
>           try {
>                             List gens = new ArrayList();
>                             gens.add(new 
> InferredClassAssertionAxiomGenerator());
>                gens.add(new InferredPropertyAssertionGenerator());
>                OWLOntology infOnt = 
> manager.createOntology(URI.create(ontology.getURI() + "_inferred"));
>
>                InferredOntologyGenerator iog = new 
> InferredOntologyGenerator(reasoner, gens);
>                iog.fillOntology(manager, ontology); //HERE THE 
> EXCEPTION IS PRODUCED
>                           manager.saveOntology(ontology, 
> URI.create(absolutePath);                   }
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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