Inferring Inverse Property in Protege

Viewed 1013

I have created the relationship A 'is functional parent of' B and defined 'has functional parent' as the inverse of 'is functional parent of'. 'A' and 'B' are both subclasses of 'chemical entity'.

I want Protege to infer B 'has functional parent' A. The query 'has functional parent' some A fails.

Error #1: Not understanding open world

I realized that some implies that not all B have the relationship 'has functional parent' with 'A'. However, the query 'chemical entity' and 'has functional parent' still fails.

My ontology has no instances. I was hoping the query wound find subclasses.

Turtle File

@prefix : <http://www.semanticweb.org/michaelchary/ontologies/2020/8/untitled-ontology-10#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://www.semanticweb.org/michaelchary/ontologies/2020/8/untitled-ontology-10> .

<http://www.semanticweb.org/michaelchary/ontologies/2020/8/untitled-ontology-10> rdf:type owl:Ontology .

#################################################################
#    Object Properties
#################################################################

###  http://www.semanticweb.org/michaelchary/ontologies/2020/8/untitled-ontology-10#hasFunctionalParent
:hasFunctionalParent rdf:type owl:ObjectProperty ;
                     owl:inverseOf :isFunctionalParentOf .


###  http://www.semanticweb.org/michaelchary/ontologies/2020/8/untitled-ontology-10#isFunctionalParentOf
:isFunctionalParentOf rdf:type owl:ObjectProperty .


#################################################################
#    Classes
#################################################################

###  http://www.semanticweb.org/michaelchary/ontologies/2020/8/untitled-ontology-10#A
:A rdf:type owl:Class ;
   rdfs:subClassOf :Z ,
                   [ rdf:type owl:Restriction ;
                     owl:onProperty :isFunctionalParentOf ;
                     owl:someValuesFrom :B
                   ] .


###  http://www.semanticweb.org/michaelchary/ontologies/2020/8/untitled-ontology-10#B
:B rdf:type owl:Class ;
   rdfs:subClassOf :Z .


###  http://www.semanticweb.org/michaelchary/ontologies/2020/8/untitled-ontology-10#Z
:Z rdf:type owl:Class .


###  Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi
1 Answers

From the axioms you stated in your ontology, there is absolutely nothing from which the reasoner can derive that B hasFunctionalParent A.

To understand why this is the case, it is helpful to think in terms of individuals even though your ontology does not include any explicit individuals. When the reasoner runs, it tries to generate a model based on the axioms in the ontology. A model consists of generated individuals that adheres to the axioms of your ontology.

For illustration purposes, let us assume the universe of individuals consists of the following numbers:

Domain = {0, 1, 2, 3, 4, 5, 6, 7},

Z = {1, 2, 3, 5, 6, 7},

A = {5, 7} and

B = {2, 3, 6}

Then you have an object property hasFunctionalParent with its inverse. For short I will refer to hasFunctionalParent as R and its inverse as invR. What does R and invR mean? It basically states that when 2 individuals in our domain are related via R, they are also related via invR. That is, if we have R(1, 2), then invR(2, 1) also hold.

Stating that A subClassOf invR some B implies that each individual of A is related via invR to at least 1 individual of B. Thus, if we have invR(5, 2) and invR(7, 3), we also will have R(2, 5) and R(3, 7). However, this says nothing about the class B in general. It is completely possible that R(6, 0) holds. Therefore the reasoner cannot infer that B hasFunctionalParent A.

To get B and Z for the query "find the super classes of hasFunctionalParent some B" (that means "superclasses" must be ticked in Protege when doing the query) you have to state that isFunctionalParentOf has domain A and range B. This states that whenever 2 individuals x and y are related via isFunctionalParentOf, we can assume x is an instance of A and y is an instance of B.

Lastly, you will note that you will need to use the DL query tab in Protege to get to this inference. In particular it is not shown as part of the inferences after reasoning. Why is that? That is because Protege only shows inferences of named classes. hasFunctionalParent some B is an anonymous class, therefore this inference is not shown. A trick to make this show in Protege is to add an arbitrary concept say X that you set as equivalent to hasFunctionalParent some B. If you now run the reasoner, Protege will infer that X subClassOf B.

Related