Hi,
I am currently trying to set up a Jena environment using the Pellet reasoner. For testing, I use the ontology that is attached to this post.
This is my rather simple code to link the reasoner with the ontology and read some property:
File file = fc.getSelectedFile();
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.loadOntologyFromOntologyDocument(file);
OWLReasonerFactory reasonerFactory = PelletReasonerFactory.getInstance();
OWLReasoner reasoner = reasonerFactory.createReasoner(ontology);
reasoner.precomputeInferences();
System.out.println("Ontology is consistent: " + reasoner.isConsistent());
OWLDataFactory factory = manager.getOWLDataFactory();
OWLDataProperty p = factory.getOWLDataProperty(IRI.create(ns_ontology + "orientation"));
OWLClassExpression ex1 = factory.getOWLDataHasValue(p, factory.getOWLLiteral(0));
//OWLClassExpression ex2 = factory.getOWLClass(IRI.create(ns_ontology + "SouthboundDelimiter"));
//OWLClassExpression ex3 = factory.getOWLClass(IRI.create(ns_ontology + "EastboundDelimiter"));
System.out.println("Result set: ");
Set<OWLNamedIndividual> result = reasoner.getInstances(ex1, true).getFlattened(); for (OWLNamedIndividual owlNamedIndividual : result)
System.out.println(owlNamedIndividual);
System.out.println("-END-");
The ontology describes a small apartment with some roomes (zones) and according walls (zonedelimiters). Although the ontology is consistent and running Pellet in Protege always is successful, I get sometimes an error when running the "getInstances" command (see error message below). This error occurs non-deterministically - sometimes it works, sometimes it does not without any changes in the ontology or the source. And sometimes the error is not coming any more, if a remove individuals from the ontology. However, there are not so many individuals in the ontology anyway.
Is this a known error, or is there something wrong with my ontology or the code? Can anyone please give me a hint?
Thanks in advance,
Daniel
Exception in thread "AWT-EventQueue-0" org.mindswap.pellet.exceptions.InternalReasonerException: Backtrack: Trying to backtrack to branch 205 but has only 122 branches. Clash found: [Clash "anon(5685)" EMPTY_DATATYPE [-1-[0, 108, 109, 110, 205]] [
http://www.w3.org/2001/XMLSchema#int, not(restrictedDatatype(
http://www.w3.org/2001/XMLSchema#int,[facet(http://www.w3.org/2001/XMLSchema#minInclusive,literal(135,(),http://www.w3.org/2001/XMLSchema#integer)),facet(http://www.w3.org/2001/XMLSchema#maxInclusive,literal(225,(),http://www.w3.org/2001/XMLSchema#integer))])), restrictedDatatype(
http://www.w3.org/2001/XMLSchema#int,[facet(http://www.w3.org/2001/XMLSchema#minInclusive,literal(0,(),http://www.w3.org/2001/XMLSchema#integer)),facet(http://www.w3.org/2001/XMLSchema#maxExclusive,literal(360,(),http://www.w3.org/2001/XMLSchema#integer))]), restrictedDatatype(
http://www.w3.org/2001/XMLSchema#int,[facet(http://www.w3.org/2001/XMLSchema#minInclusive,literal(225,(),http://www.w3.org/2001/XMLSchema#integer)),facet(http://www.w3.org/2001/XMLSchema#maxInclusive,literal(315,(),http://www.w3.org/2001/XMLSchema#integer))]), restrictedDatatype(
http://www.w3.org/2001/XMLSchema#int,[facet(http://www.w3.org/2001/XMLSchema#minInclusive,literal(0,(),http://www.w3.org/2001/XMLSchema#integer)),facet(http://www.w3.org/2001/XMLSchema#maxInclusive,literal(45,(),http://www.w3.org/2001/XMLSchema#integer))]), not(restrictedDatatype(
http://www.w3.org/2001/XMLSchema#int,[facet(http://www.w3.org/2001/XMLSchema#minInclusive,literal(45,(),http://www.w3.org/2001/XMLSchema#integer)),facet(http://www.w3.org/2001/XMLSchema#maxInclusive,literal(135,(),http://www.w3.org/2001/XMLSchema#integer))]))]]
at org.mindswap.pellet.tableau.completion.SROIQStrategy.backtrack(SROIQStrategy.java:57) at com.clarkparsia.pellet.rules.ContinuousRulesStrategy.complete(ContinuousRulesStrategy.java:344)
at org.mindswap.pellet.ABox.isConsistent(ABox.java:1423)
at org.mindswap.pellet.ABox.isType(ABox.java:852)
at org.mindswap.pellet.KnowledgeBase.partitionInstanceRetrieval(KnowledgeBase.java:4332)
at org.mindswap.pellet.KnowledgeBase.binaryInstanceRetrieval(KnowledgeBase.java:4322)
at org.mindswap.pellet.KnowledgeBase.partitionInstanceRetrieval(KnowledgeBase.java:4330)
at org.mindswap.pellet.KnowledgeBase.binaryInstanceRetrieval(KnowledgeBase.java:4322)
at org.mindswap.pellet.KnowledgeBase.retrieve(KnowledgeBase.java:4239)
at org.mindswap.pellet.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcept(CDOptimizedTaxonomyBuilder.java:1415)
at org.mindswap.pellet.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcept(CDOptimizedTaxonomyBuilder.java:1421)
at org.mindswap.pellet.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcept(CDOptimizedTaxonomyBuilder.java:1421)
at org.mindswap.pellet.taxonomy.CDOptimizedTaxonomyBuilder.realizeByConcepts(CDOptimizedTaxonomyBuilder.java:1376)
at org.mindswap.pellet.taxonomy.CDOptimizedTaxonomyBuilder.realize(CDOptimizedTaxonomyBuilder.java:1239)
at org.mindswap.pellet.KnowledgeBase.realize(KnowledgeBase.java:2119)
at org.mindswap.pellet.KnowledgeBase.getInstances(KnowledgeBase.java:3450)
at com.clarkparsia.pellet.owlapiv3.PelletReasoner.getInstances(PelletReasoner.java:587)
at at.ac.tuwien.auto.colibri.semantics.Semantics$2.actionPerformed(Semantics.java:149)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)