Galigator / openllet

Openllet is an OWL 2 reasoner in Java, build on top of Pellet.
https://www.w3.org/TR/owl2-primer/
Other
99 stars 26 forks source link

USE_UNIQUE_NAME_ASSUMPTION = true leads to contradictions #64

Closed nschejtman closed 1 year ago

nschejtman commented 3 years ago

Consider the simplest of ontologies with two individuals A and B

@prefix :     <http://test#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@base <http://test#> .

:A rdf:type owl:NamedIndividual .
:B rdf:type owl:NamedIndividual .

Writing the inferred models leads to:

:A      a                  owl:Thing , owl:NamedIndividual ;
        owl:differentFrom  :B , :A ;
        owl:sameAs         :A .

As you can see A is different from A and the same as A, which is a contradiction. The same happens with B

The code to reproduce this is (Scala):

    val data = ModelFactory.createDefaultModel()
    OpenlletOptions.USE_UNIQUE_NAME_ASSUMPTION = true
    data.read("src/test/resources/two-individuals/data.ttl", "TTL")

    val reasoner = PelletReasonerFactory.theInstance().create()
    val infModel = ModelFactory.createInfModel(reasoner, data)

    infModel.write(new FileWriter("src/test/resources/two-individuals/data.inferred.ttl"), "TTL")
Galigator commented 1 year ago

Thank for this very nice report. I just pushed a fix for this on the 'test' branch.