Pellet internalReasonerException in OWL API

57 views
Skip to first unread message

林雅

unread,
Jan 23, 2016, 4:36:38 AM1/23/16
to Pellet Users

Have been stuck one day and would someone be kind enough to help? 


I have loaded an ontology which imported SWEET(Semantic Web for Earth and Environmental Ontology). I did some SPARQL query on it, and I got such answer: "Object Property hasLowerBound is used with a hasValue restriction where the value is a literal: "0"^^integer". (hasLowerBound, which I have checked in the SWEET, is an Datatype Ontology in SWEET)

How can I solve this problem?







Here is the code I wrote and the error I got,Thank you so much for your help~




package loadOnto;


//import static org.semanticweb.owlapi.search.EntitySearcher.getAnnotationObjects;

//import static org.semanticweb.owlapi.search.Searcher.annotationObjects;


import java.io.ByteArrayOutputStream;

import java.io.File;

import java.util.*;


import javax.annotation.Nonnull;


import org.semanticweb.owlapi.apibinding.OWLManager;

//import org.semanticweb.owlapi.formats.OWLXMLDocumentFormat;

import org.semanticweb.owlapi.io.StreamDocumentTarget;

import org.semanticweb.owlapi.io.StringDocumentSource;

import org.semanticweb.owlapi.io.StringDocumentTarget;

import org.semanticweb.owlapi.model.*;

import org.semanticweb.owlapi.profiles.OWL2DLProfile;

import org.semanticweb.owlapi.profiles.OWLProfileReport;

import org.semanticweb.owlapi.profiles.OWLProfileViolation;

import org.semanticweb.owlapi.reasoner.*;

import org.semanticweb.owlapi.reasoner.structural.StructuralReasonerFactory;

import org.semanticweb.owlapi.util.*;

import org.semanticweb.owlapi.vocab.OWL2Datatype;

import org.semanticweb.owlapi.vocab.OWLFacet;

import org.semanticweb.owlapi.vocab.OWLRDFVocabulary;


import com.clarkparsia.pellet.owlapiv3.PelletReasoner;

import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory;

import com.clarkparsia.pellet.sparqldl.jena.SparqlDLExecutionFactory;

import com.clarkparsia.pellet.sparqldl.model.Query;

import com.hp.hpl.jena.query.QueryExecution;

import com.hp.hpl.jena.query.QueryFactory;

import com.hp.hpl.jena.query.ResultSet;

import com.hp.hpl.jena.query.ResultSetFormatter;

import com.hp.hpl.jena.rdf.model.InfModel;

import com.hp.hpl.jena.rdf.model.ModelFactory;


import uk.ac.manchester.cs.owlapi.modularity.ModuleType;

import uk.ac.manchester.cs.owlapi.modularity.SyntacticLocalityModuleExtractor;




public class load {

public static void main(String[] args) throws OWLOntologyCreationException {

// Get hold of an ontology manager

OWLOntologyManager manager = OWLManager.createOWLOntologyManager();


// We can also load ontologies from files. Create a file object that points to the local copy

File file = new File("G:/Protege/owlfiles/sweetAll.owl");

// Load the local copy

OWLOntology loadMODIS = manager.loadOntologyFromOntologyDocument(file);

PelletReasoner reasoner = PelletReasonerFactory.getInstance().createNonBufferingReasoner( loadMODIS );

System.out.println("CheckParsing.should() " + reasoner.isConsistent());

System.out.println("Loaded ontology: " + loadMODIS);

    }

}




Error

Exception in thread "main" org.mindswap.pellet.exceptions.InternalReasonerException: Object Property hasLowerBound is used with a hasValue restriction where the value is a literal: "0"^^integer at org.mindswap.pellet.tableau.completion.rule.SomeValuesRule.applySomeValuesRule(SomeValuesRule.java:204) at org.mindswap.pellet.tableau.completion.rule.SomeValuesRule.apply(SomeValuesRule.java:64) at org.mindswap.pellet.tableau.completion.rule.AbstractTableauRule.apply(AbstractTableauRule.java:64) at org.mindswap.pellet.tableau.completion.SROIQStrategy.complete(SROIQStrategy.java:157) at org.mindswap.pellet.ABox.isConsistent(ABox.java:1423) at org.mindswap.pellet.ABox.isConsistent(ABox.java:1260) at org.mindswap.pellet.KnowledgeBase.consistency(KnowledgeBase.java:1987) at org.mindswap.pellet.KnowledgeBase.isConsistent(KnowledgeBase.java:2061) at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:258) at org.mindswap.pellet.jena.PelletInfGraph.prepare(PelletInfGraph.java:241) at com.clarkparsia.pellet.sparqldl.jena.SparqlDLExecutionFactory.create(SparqlDLExecutionFactory.java:113) at com.clarkparsia.pellet.sparqldl.jena.SparqlDLExecutionFactory.create(SparqlDLExecutionFactory.java:261) at com.clarkparsia.pellet.sparqldl.jena.SparqlDLExecutionFactory.create(SparqlDLExecutionFactory.java:226) at loadMODIS.load.main(load.java:78)


Attached is the ontology I've been reason on.


Thank you very much for your kind help!

sweetAll.rar

林雅

unread,
Jan 23, 2016, 4:40:02 AM1/23/16
to Pellet Users
Here is the version information:

Version of Pellet: 2.3.0 Version of OWL API: 3.4.10

在 2016年1月23日星期六 UTC+8下午5:36:38,林雅写道:

Ignazio Palmisano

unread,
Jan 23, 2016, 7:22:37 AM1/23/16
to Pellet Users
On 23 January 2016 at 09:40, 林雅 <julya...@gmail.com> wrote:
> Here is the version information:
>
> Version of Pellet: 2.3.0 Version of OWL API: 3.4.10


hasLowerBound is parsed as a data property and an annotation property.

Pellet is checking for a data property case and assumes that if a
property is not a data property it must be an object property. This is
always the case for OWL 2 ontologies, but this ontology is not being
parsed as an OWL 2 compatible ontology - punning of an annotation
property and a data property is not allowed.

I'm not sure yet whether the problem is in the ontology or in the
OWLAPI parsing of it.

Edit: It's a parsing issue. hasLowerBound is declared in relaMath.owl
as data property. However relaMath.owl imports reprMath.owl, which
uses hasLowerBound but does not declare it. reprMath.owl imports
relaMath.owl, so there is a cyclic import there.

The problem is that, during parsing: - relaMath.owl is parsed, import
is found, reprMath.owl import is resolved; no declarations are parsed
yet. - reprMath.owl is parsed, import is found. relaMath.owl is
already being parsed, so call does nothing. All entities declared in
relaMath.owl are included while parsing reprMath.owl. PROBLEM: the
entities have not been parsed yet, so this set is empty. hasLowerBound
is found in reprMath but no declaration exists yet. Therefore OWLAPI
defaults to AnnotationProperty. - relaMath.owl parsing continues,
declaration is found.

Final result: Any ontology importing relaMath.owl has illegal punning
for hasLowerBound. OWLAPI bug.

Workaround: Add data property declaration to reprMath.owl:

<owl:DatatypeProperty rdf:about="#hasLowerBound"/>

This might need to be done in more than one ontology. The bug affects
all OWLAPI versions.
Cheers,
I.
> --
> You received this message because you are subscribed to the Google Groups
> "Pellet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pellet-users...@googlegroups.com.
> To post to this group, send email to pellet...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pellet-users/dae2cd36-c9ae-4b84-9adb-b3abce453305%40googlegroups.com.

Ignazio Palmisano

unread,
Jan 23, 2016, 8:10:24 AM1/23/16
to Pellet Users
On 23 January 2016 at 12:22, Ignazio Palmisano
<ipalmisan...@gmail.com> wrote:
> On 23 January 2016 at 09:40, 林雅 <julya...@gmail.com> wrote:
>> Here is the version information:
>>
>> Version of Pellet: 2.3.0 Version of OWL API: 3.4.10
>
>
> hasLowerBound is parsed as a data property and an annotation property.

I've raised https://github.com/owlcs/owlapi/issues/483 to fix the
underlying issue.
I.

林雅

unread,
Jan 25, 2016, 2:33:58 AM1/25/16
to Pellet Users
You've been a lot of help. Thank you very much~~


在 2016年1月23日星期六 UTC+8下午5:36:38,林雅写道:

Have been stuck one day and would someone be kind enough to help? 

Reply all
Reply to author
Forward
0 new messages