Tatiana Corbascio
Tatiana Corbascio

Reputation: 21

Classification issue in an OWL ontology

I am defining a simple ontology to classify a sandwich based on its ingredients. The structure is as follows:

Classes:

Ingredient

Sandwich

Data property: isBiologic (boolean)

Object property: hasIngredient (with domain Sandwich and range Ingredient)

The formal definitions are:

Bio: Ingredient and (isBiologic value true)

BioBurger: Sandwich and hasIngredient only Bio

FishBurger: Sandwich and hasIngredient some Fish

Scenario:

I created the following individuals:

salmon, of type Fish.

organicLettuce, of type Vegetable and isBiologic value true.

The reasoner correctly classifies organicLettuce as Bio.

However, when I define the individuals:

organicBurger, with hasIngredient organicLettuce

nonOrganicBurger, with hasIngredient salmon and hasIngredient organicLettuce

The reasoner does not classify organicBurger as BioBurger. It is only classified as Sandwich.

Hypothesis:

I understand the issue lies in the Open World Assumption (OWA). I probably need to define closures, but I am not sure how to implement them in practice.

Question:

How can I add the necessary closures so the reasoner correctly classifies the individuals as BioBurger or FishBurger?

I tried to create a NoBioBurger as Sandwich and Ingredient some NoBio and then define the class Bio as Sandwich and not (NoBio). But it didn't work.

Upvotes: 2

Views: 62

Answers (1)

Henriette Harmse
Henriette Harmse

Reputation: 4787

I will deal here with how to get the inference that organicBurger is of type BioBurger. Similar ideas should help you to do similar for FishBurger

You are spot-on with the OWA being part of the problem. However, there is also an issue with the understanding wrt Quantified universal restrictions, in particular BioBurger equivalentTo hasIngredient only Bio. What this means is whenever an individual is of type BioBurger it only ever has either:

  1. 0 links via hasIngredient, or
  2. all links via hasIngredient has to link to individuals of type Bio.

In your example of organicBurger equivalentTo hasIngredient organicLettuce, with organicLettuce as type of Vegetable and isBiologic value true, you hoped to satisfy (2). However, this fails because there is nothing that states that individuals of type Vegetable must be of type Bio. There are 2 possible ways to fix this:

  1. The easiest is to state that Vegetable sublassOf Bio, or
  2. state that Bio equivalentTo isBiologic value true (remove and Ingredient) AND state that Vegetable equivalentTo isBiologic value true. This will result in the reasoner inferring Vegetable and Bio to be equivalent.

These changes deal with ensuring organicLettuce adheres to the semantics of hasIngredient only Bio.

We now still need to deal with OWA. There are 2 steps:

(1) We need to fix which classes can be considered Ingredients by adding:

Ingredient equivalentTo Fish or Meat or Bio or Vegetable

(2) We also need to ensure organicBurger does not have hasIngredient links to any other ingredients :

  1. hasIngredient max 0 Fish
  2. hasIngredient max 0 Meat

With these statements we further ensure the semantics of hasIngredient only Bio is adhered to by stating that organicBurger does not have links to meat and fish.

Here is the complete ontology:

Prefix: owl: <http://www.w3.org/2002/07/owl#>
Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Prefix: xml: <http://www.w3.org/XML/1998/namespace>
Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>



Ontology: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl>
<http://henrietteharmse.com/SO/79282158/v0.0.1/classification-issue-in-an-owl-ontology>

Datatype: xsd:boolean

    
ObjectProperty: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#hasIngredient>

    Domain: 
        <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Sandwich>
    
    Range: 
        <http://henrietteharmse.com/SO#Ingredient>
    
    
DataProperty: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#isBiologic>

    
Class: <http://henrietteharmse.com/SO#Ingredient>

    EquivalentTo: 
        <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Bio> or <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Fish> or <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Meat> or <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Vegetable>
    
    
Class: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Bio>

    EquivalentTo: 
        <http://henrietteharmse.com/SO#Ingredient>
        and (<http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#isBiologic> value true)
    
    SubClassOf: 
        <http://henrietteharmse.com/SO#Ingredient>
    
    
Class: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#BioBurger>

    EquivalentTo: 
        <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Sandwich>
        and (<http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#hasIngredient> only <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Bio>)
    
    SubClassOf: 
        <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Sandwich>
    
    
Class: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Fish>

    SubClassOf: 
        <http://henrietteharmse.com/SO#Ingredient>
    
    
Class: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#FishBurger>

    EquivalentTo: 
        <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Sandwich>
        and (<http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#hasIngredient> some <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Fish>)
    
    SubClassOf: 
        <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Sandwich>
    
    
Class: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Meat>

    SubClassOf: 
        <http://henrietteharmse.com/SO#Ingredient>
    
    
Class: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Sandwich>

    
Class: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Vegetable>

    SubClassOf: 
        <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Bio>
    
    
Individual: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#nonOrganicBurger>

    Facts:  
    <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#hasIngredient>  <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#organicLettuce>,
    <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#hasIngredient>  <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#salmon>
    
    
Individual: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#organicBurger>

    Types: 
        <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#hasIngredient> max 0 <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Fish>,
        <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#hasIngredient> max 0 <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Meat>
    
    Facts:  
    <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#hasIngredient>  <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#organicLettuce>
    
    
Individual: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#organicLettuce>

    Types: 
        <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Vegetable>
        and (<http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#isBiologic> value true)
    
    
Individual: <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#salmon>

    Types: 
        <http://henrietteharmse.com/SO/79282158/classification-issue-in-an-owl-ontology.owl#Fish>

Further reading I have written about OWA and Universal restrictions on my blog. See for example:

  1. Understanding OWL Universal Property Restrictions
  2. Why does the OWL Reasoner ignore my Constraint?

Doing a search for 'open world assumption' will give a number of posts.

I also gave a presentation where I explain OWL semantics with examples in detail here

Upvotes: 1

Related Questions