stardog-union / pellet

Pellet is an OWL 2 reasoner in Java; open source (AGPL) and commercially licensed, commercial support available.
http://clarkparsia.com/pellet
Other
302 stars 153 forks source link

Got decimal type for integer value inferred via hasValue restriction #38

Open patrickwestphal opened 7 years ago

patrickwestphal commented 7 years ago

When working with an ontology having an owl:hasValue restriction, the inferred type of an xsd:integer value will be xsd:decimal. Given, for example, these two axioms

<owl:Class rdf:about="http://example.com/Bat">
  <rdfs:subClassOf>
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://example.com/hasLegs"/>
      <owl:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">2</owl:hasValue>
    </owl:Restriction>
  </rdfs:subClassOf>
</owl:Class>
<owl:NamedIndividual rdf:about="http://example.com/bat01">
  <rdf:type rdf:resource="http://example.com/Bat"/>
</owl:NamedIndividual>

Pellet will infer

<rdf:Description rdf:about="http://example.com/bat01">
  <j.0:hasLegs rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">2</j.0:hasLegs>
  <rdf:type rdf:resource="http://example.com/Bat"/>
</rdf:Description>

which is unexpected to me and differs from the behavior when having the number of legs defined in the ABox, i.e.

<owl:NamedIndividual rdf:about="http://example.com/bat01">
  <rdf:type rdf:resource="http://example.com/Bat"/>
  <ex:hasLegs rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">2</ex:hasLegs>
</owl:NamedIndividual>

My question now is if there is a good reason to get an xsd:decimal or whether this is a bug. I attached a minimal ontology for the owl:hasValue and one for the assertion case.

minimal_examples.zip