amp-sidebar 6
Section 4.10.1
In OWL properties define binary relations with the same semantics and characteristics as binary relations in First Order Logic.
There are two types of OWL properties for describing a domain: Object properties and Data properties.
Object properties have classes as their domain and range.
Data properties have classes as their domain and simple datatypes such as xsd:string
or xsd:dateTime
as their range.
In figure 3.3 the individual Michael
is related to the individual USA
by the property livesIn
.
Consider all the individuals who are an instance of Person
and also have the same relation, that each livesIn
the USA
.
This group is a set or OWL class such as USAResidents
.
In OWL a class can be defined by describing the various properties and values that hold for all individuals in the class. Such definitions are called restrictions in OWL.
The following are some examples of classes of individuals that we might want to define via property restrictions:
- The class of individuals with at least one
hasChild
relation. - The class of individuals with 2 or more
hasChild
relations. - The class of individuals that have at least one
hasTopping
relationship to individuals that are members ofMozzarellaTopping
– that is, the class of things that have at least a mozzarella topping. - The class of individuals that are
Pizzas
and only havehasTopping
relations to instances of the classVegetableTopping
(that is,VegetarianPizza
).
In OWL we can describe all of the above classes using restrictions. OWL restrictions fall into three main categories:
- Quantifier restrictions. These describe that a property must have some or all values that are of a particular class.
- Cardinality restrictions. These describe the number of individuals that must be related to a class by a specific property.
- hasValue restrictions. These describe specific values that a property must have.
We will initially use quantifier restrictions.
Quantifier restrictions can be further categorized as existential restrictions and universal restrictions [6].
Both types of restrictions will be illustrated with examples in this tutorial.
- Existential restrictions describe classes of individuals that participate in at least one relation along a specified property.
For example, the class of individuals who have at least one (or some)
hasTopping
relation to instances ofVegetableTopping
. In OWL the keywordsome
is used to denote existential restrictions. - Universal restrictions describe classes of individuals that for a given property only have relations along a property to individuals that are members of a specific class.
For example, the class of individuals that only have
hasTopping
relations to instances of the classVegetableTopping
. In OWL they keywordonly
is used for universal restrictions.
Let us take a closer look at an example of an existential restriction.
The restriction hasTopping some MozzarellaTopping
is an existential restriction (as indicated by the some
keyword), which restricts the hasTopping
property, and has a filler MozzarellaTopping
.
This restriction describes the class of individuals that have at least one hasTopping
relationship to an individual that is a member of the class MozzarellaTopping
.
A restriction always describes a class.
Sometimes (as we will soon see) it can be a defined class.
Other times it may be an anonymous class.
In all cases the class contains all of the individuals that satisfy the restriction, that is, all of the individuals that have the relationships required to be a member of the class.
In section 9.2 one of our SPARQL queries will return several anonymous classes.
The restrictions for a class are displayed and edited using the Class Description View shown in Figure 4.17.
The Class Description View holds most of the information used to describe a class.
The Class Description View is a powerful way of describing and defining classes. It is one of the most important differences between describing classes in OWL and in other models such as most object-oriented programming languages.
In other models there is no formal definition that describes why one class is a subclass of another, in OWL there is. Indeed, the OWL classifier can actually redefine the class hierarchy based on the logical restrictions defined by the user. We will see an example of this later in the tutorial.
Restrictions are also called axioms in OWL.
This has the same meaning as in logic.
An axiom is a logical formula defined by the user rather than deduced by the reasoner.
As described above, in Protégé all axioms are shown in normal font whereas all inferences inferred by the reasoner are highlighted in yellow.
[6] These have the same meaning as existential and universal quantification in First Order Logic.
-
Written by @mdebellis
with contributions from @gigster99 and @ldodds -
Translated by @jaygray0919