Reputation: 21
I am defining a simple ontology to classify a sandwich based on its ingredients. The structure is as follows:
Classes:
Ingredient
Bio
Vegetable
Fish
Meat
Sandwich
BioBurger
FishBurger
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
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:
hasIngredient
, orhasIngredient
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:
Vegetable sublassOf Bio
, orBio 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 :
hasIngredient max 0 Fish
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:
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