Search code examples
rdfowlprotege

Protege: why FaCT++ doesn't report inconsitency?


The generated rdf file:

<?xml version="1.0"?>


<!DOCTYPE rdf:RDF [
    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
    <!ENTITY untitled-ontology-28 "http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#" >
]>


<rdf:RDF xmlns="http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#"
     xml:base="http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:untitled-ontology-28="http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#">
    <owl:Ontology rdf:about="http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28"/>



    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Data properties
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->




    <!-- http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#hasPattern -->

    <owl:DatatypeProperty rdf:about="&untitled-ontology-28;hasPattern">
        <rdfs:range rdf:resource="&xsd;string"/>
    </owl:DatatypeProperty>



    <!-- http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#hasString -->

    <owl:DatatypeProperty rdf:about="&untitled-ontology-28;hasString">
        <rdfs:range rdf:resource="&xsd;string"/>
    </owl:DatatypeProperty>



    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Classes
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->




    <!-- http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#PatternTestClass -->

    <owl:Class rdf:about="&untitled-ontology-28;PatternTestClass">
        <rdfs:subClassOf>
            <owl:Restriction>
                <owl:onProperty rdf:resource="&untitled-ontology-28;hasString"/>
                <owl:someValuesFrom>
                    <rdfs:Datatype>
                        <owl:onDatatype rdf:resource="&xsd;string"/>
                        <owl:withRestrictions rdf:parseType="Collection">
                            <rdf:Description>
                                <xsd:length rdf:datatype="&xsd;string">8</xsd:length>
                            </rdf:Description>
                        </owl:withRestrictions>
                    </rdfs:Datatype>
                </owl:someValuesFrom>
            </owl:Restriction>
        </rdfs:subClassOf>
        <rdfs:subClassOf>
            <owl:Restriction>
                <owl:onProperty rdf:resource="&untitled-ontology-28;hasPattern"/>
                <owl:someValuesFrom>
                    <rdfs:Datatype>
                        <owl:onDatatype rdf:resource="&xsd;string"/>
                        <owl:withRestrictions rdf:parseType="Collection">
                            <rdf:Description>
                                <xsd:pattern>[ABC]</xsd:pattern>
                            </rdf:Description>
                        </owl:withRestrictions>
                    </rdfs:Datatype>
                </owl:someValuesFrom>
            </owl:Restriction>
        </rdfs:subClassOf>
    </owl:Class>



    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Individuals
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->




    <!-- http://www.semanticweb.org/jack/ontologies/2016/3/untitled-ontology-28#PatternA -->

    <owl:NamedIndividual rdf:about="&untitled-ontology-28;PatternA">
        <rdf:type rdf:resource="&untitled-ontology-28;PatternTestClass"/>
        <hasString rdf:datatype="&xsd;string">qwerasd</hasString>
        <hasPattern rdf:datatype="&xsd;string">zzzzz</hasPattern>
    </owl:NamedIndividual>
</rdf:RDF>



<!-- Generated by the OWL API (version 3.5.1) http://owlapi.sourceforge.net -->

Well, I have checked the string pattern, [ABC] means either letter A or B or C. But the NamedIndividual PatternA has string zzzzz, which doesn't conform [ABC].

It looks like HermiT doesn't support reasoning integer:

org.semanticweb.HermiT.datatypes.UnsupportedFacetException: The datatype rdf:PlainLiteral accepts only integers as facet values for the facet with URI 'http://www.w3.org/2001/XMLSchema#length', but in the ontology we have a datatype restriction org.semanticweb.HermiT.datatypes.rdfplainliteral.RDFPlainLiteralDatatypeHandler@685f8461. The value '"8"^^xsd:string' does not seem to be an integer.

The question is updated: reasoner changed. And a new property added

Now I got the error:

FaCT++.Kernel: Reasoner for the SROIQ(D) Description Logic, 64-bit
Copyright (C) Dmitry Tsarkov, 2002-2015. Version 1.6.4-SNAPSHOT (10 April 2015)
Error logged
org.semanticweb.owlapi.reasoner.ReasonerInternalException: FaCT++ Kernel: unsupported facet 'getLength'
    at uk.ac.manchester.cs.factplusplus.FaCTPlusPlus.getLength(Native Method)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$DataRangeTranslator.visit(Unknown Source)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$DataRangeTranslator.visit(Unknown Source)
    at uk.ac.manchester.cs.owl.owlapi.OWLDatatypeRestrictionImpl.accept(OWLDatatypeRestrictionImpl.java:154)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner.toDataTypeExpressionPointer(Unknown Source)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$ClassExpressionTranslator.visit(Unknown Source)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$ClassExpressionTranslator.visit(Unknown Source)
    at uk.ac.manchester.cs.owl.owlapi.OWLDataSomeValuesFromImpl.accept(OWLDataSomeValuesFromImpl.java:105)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner.toClassPointer(Unknown Source)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$AxiomTranslator.visit(Unknown Source)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner$AxiomTranslator.visit(Unknown Source)
    at uk.ac.manchester.cs.owl.owlapi.OWLSubClassOfAxiomImpl.accept(OWLSubClassOfAxiomImpl.java:168)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner.loadAxiom(Unknown Source)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner.loadReasonerAxioms(Unknown Source)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasoner.<init>(Unknown Source)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasonerFactory.createReasoner(Unknown Source)
    at uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasonerFactory.createReasoner(Unknown Source)
    at org.protege.editor.owl.model.inference.ReasonerUtilities.createReasoner(ReasonerUtilities.java:21)
    at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.ensureRunningReasonerInitialized(OWLReasonerManagerImpl.java:434)
    at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.run(OWLReasonerManagerImpl.java:390)
    at java.lang.Thread.run(Thread.java:745)

Solution

  • The exception from FaCT++ says that the facets you're using are not supported - this is a limitation of FaCT++ implementation.

    about HermiT, the error you're getting is due to this:

    <xsd:length rdf:datatype="&xsd;string">8</xsd:length>

    the datatype needs to be int (or integer), not string.