3. Ontologies and OWL Syntax
Definition
An ontology is a way of modelling a domain by identifying its concepts, organising them in relation to each other, identifying the properties that connect them, and designating the objects that represent them.
3.1 Introduction
1- OWL (Ontology Web Language)
OWL is the language recommended by the W3C for expressing ontologies. It is characterised by the following:
- It uses URIs to designate all its elements.
- It adopts a set-theoretic view of ontologies:
- concepts are sets,
- objects are elements of sets, and
- properties connect these elements.
- The set of all sets is represented by the URI
owl:Thing, whereowlis the prefix for: http://www.w3.org/2002/07/owl# - OWL classes represent sets, instances represent their elements, and properties allow links to be created between instances.
2- The set-theoretic principle of OWL
In the semantic web, an ontology defines a domain through classes, individuals, and properties. Each class can be interpreted mathematically as a set of individuals that share certain characteristics. In mathematics, the algebra of sets, defines the properties and laws of sets, the set-theoretic operations of union, intersection, and complementation and the relations of set equality and set inclusion. It also provides systematic procedures for evaluating expressions, and performing calculations, involving these operations and relations.
OWL provides constructors that map directly onto set-theoretic operations to describe relations between classes of concepts. Typical relations are :
- Inclusion and equivalence
- Union
- Intersection
- Complement
- Difference
3.2 Instance creation and characterisation
The creation of class instances in an ontology is done as follows:
- An instance can be associated with a class using
rdf:type.
|
|
- An instance can be an instance of several classes, as in the following example:
|
|
- Instances that have an URI are called individuals. OWL allows to characterize instances by specifying that they are also instances of the class
owl:NamedIndividual.
|
|
-
The same entity can be represented by two different individuals. For example,
:Jules_Verneis represented by both:- the URI https://dbpedia.org/page/Jules_Verne in the Dbpedia database, and
- the URI https://www.wikidata.org/wiki/Q33977 in the Wikidata database.
This can be expressed with the
owl:sameASrelationship.
|
|
-
Conversely, it is possible to specify that two different URIs represent two different entities using
owl:differentFrom. For example, Brest refers to two different entities in the Wikidata database:- the URI https://www.wikidata.org/wiki/Q12193, which refers to the French commune of Brest in the department of Finistère, and
- the URI https://www.wikidata.org/wiki/Q140147, which refers to a city in Belarus.
This can be expressed as follows:
|
|
3.3 Class creation and characterisation
3.3.1 Inheritance
A class B inherits from a class A if all instances of B are also instances of A (the reverse relationship is not true). We say that A is a superclass of B, and that B is a subclass of A. A class can inherit from multiple classes. From a set-theoretic point of view, inheritance is equivalent to inclusion.
The syntax for expressing inheritance is as follows: rdfs:subClassOf, for example:
:B rdfs:subClassOf :A
If a class has no superclass, the class owl:Thing must be used as the superclass, for example:
:B rdfs:subClassOf owl:Thing, which is equivalent to: :B rdf:type owl:class
There is also the class owl:noThing, which has no individuals. From a set-theoretic point of view, this is equivalent to the empty set, and therefore it is a subclass of all classes and has no subclasses. owl:Thing has no superclass.
3.3.2 Equivalence
If two classes are equivalent, then every individual in one class is also an individual in the other. This characteristic is expressed as follows:
:A owl:equivalentClass :B
This allows for what is known as ontology alignment, or ontology matching, which is the process of determining correspondences between concepts in ontologies. A set of correspondences is also called an alignment.
We can express that a class A1 in an ontology O1 (O1:A1) is equivalent to a class A2 in an ontology O2 (O2:A2), for example:
The class wd:Q215627 (Person) in Wikidata is equivalent to the class Person in the Dbpedia ontology (dpo:Person) and the class Person in the foaf ontology (foaf:Person).
|
|
3.3.3 Union
A union of classes is declared as a new class as follows (owl:unionOf): any individual in one of the constituent classes is also an individual in this new class (the union).
Example:
|
|
3.3.4 Intersection
An intersection of classes is declared as a new class as follows (owl:intersectionOf): any individual belonging to all of the classes is also an individual in the new class (the intersection) .
Example:
|
|
3.3.5. Complement
The complement of a class allows to identify all individuals that do not belong to that class (owl:complementOf).
Example :
|
|
3.3.6 Enumeration
Enumeration allows to create a class and its instances at the same time with owl:oneOf, without using rdf:type.
Example :
|
|
3.3.7 Disjunction (difference)
We can indicate that classes are disjoint or different, i.e. there is no individual that can belong to both classes at the same time. To this end, we must create an instance of the owl:AllDisjointClasses class and associate it with the list of classes that we declare as disjoint using the owl:members property.
Example :
|
|
3.3.8. Property restrictions
A restriction describes a class of individuals based on the relationships that members of the class participate in. In other words a restriction is a kind of class, in the same way that a named class is a kind of class.
1- Specifying the cardinalities of a property
The following property restrictions are used to specify the minimum, maximum, or exact cardinality of the property: owl:minCardinality, owl:maxCardinality, owl:cardinality.
-
If
owl:minCardinalityis not used, then the value 0 is used. -
If
owl:maxCardinalityis not used, then there is no cardinality limit.
Example:
|
|
2- Specifying the classe of a value property
-
owl:allValuesFromis the restriction that allows to specify that a property only takes values from a single class. -
owl:someValuesFromis the restriction that allows to specify that a property takes some of its values from a certain class. -
owl:hasValueis the restriction that allows to specify that a property has at least the specified value (it may have other values).
Example:
|
|
3.4 Property creation and characterisation
3.4.1 Creating properties
OWL distinguishes between two types of properties:
1. Object property: used when the object of the triple is an instance of a class. An object property describes a relationship between two individuals.
This property is declared as an instance of the owl:ObjectProperty class. Its domain class (rdfs:domain) and range class (rdfs:range) can be specified, as in the following example:
|
|
2. Datatype property: used when the object of the triple is a datatype. A datatype property describes a relationship
between an individual and a data value. It is an instance of the owl:DatatypeProperty class. The value types are those of XML Schema. Example :
|
|
3.4.2 Creating subproperties
Subproperties can be created using rdfs:subPropertyOf. For example:
|
|
3.4.3. Characterizing properties
OWL allows the meaning of object properties to be enriched through the use of property characteristics. The following discuss the various characteristics that properties may have:
1 - Inverse properties
If a property :p2 is the inverse of a property :p1 (:p1 and :p2 are linked by the property owl:inverseOf), then when the individual :i1 is linked to the individual :i2 by the property :p1, the individual :i2 is considered to be linked to :i1 by the property :p2.
Example :
|
|
2 - Transitive properties
If a property :p is transitive, then when an individual :i1 is linked to individual :i2 by property :p, and the same individual :i2 is linked to another individual :i3 by the same property :p, individual :i1 is also considered to be linked to :i3 by property :p.
:p must be an instance of the class owl:TransitiveProperty:
:p rdf:type owl:TransitiveProperty.
Example :
|
|
3 - Symmetric properties
If an individual :i1 is linked to another individual :i2 by the property :p and :p is symmetric, then we consider that :i2 is linked to :i1 by :p.
Example :
|
|
3 - Asymmetric properties
If an individual :i1 is linked to another individual :i2 by the property :p and :p is asymmetric, then :i2 cannot be linked to :i1 by :p under any circumstances.
Example :
|
|
4 - Functional properties
If an individual :i1 is linked to two individuals :i2 and :i3 by the property :p and :p is functional, then :i2 and :i3 represent the same individual. This property is declared as follows:
:p rdf:type Owl:FunctionalProperty.
Example :
|
|
5 - Inverse functional properties
If two individuals :i1 and :i2 are linked to another individual :i3 by property :p and :p is inverse functional, then :i1 and :i2 represent the same individual. This property is declared as follows:
:p rdf:type Owl:InverseFunctionalProperty.
Example :
|
|
6 - Chain of properties
Let us consider individuals :i0,:i1, ..., :in-1 and property :p, which is defined as the chain of properties :p1,:p2,...,:pn
|
|
The property owl:propertyChainAxiom allows this chaining to be defined.
Example:
|
|
7 - Disjoint properties
If two properties :p1 and :P2 are disjoint, and if the individual :i1 is linked to the individual :i2 by the property :p1, then the two individuals cannot be linked by the property :p2 under any circumstances.
The owl:propertyDisjointWith property allows to declare that two properties are disjoint.
Example :
|
|
8 - Equivalent properties
As with classes, the owl:equivalentProperty property allows to specify that two properties are equivalent.
Example:
|
|





