Home » Posts tagged 'reasoner'
Tag Archives: reasoner
In creating their first OWL ontology, there are at least two aspects of
SubClassOf that perplex users. The first is when to use
EquivalentTo and when to use
SubClassOf. The second problem is best illustrated by the following example:
ObjectProperty: a_to_b Class: A1 EquivalentTo: (a_to_b some B) Class: A2 SubClassOf: (a_to_b some B) Class: B Individual: b1 Types: B Individual: x Facts: a_to_b b1
When running a reasoner on this example, the individual
x is inferred to be of type
A1. What perplex users sometimes is that
x is not inferred to be of type
A2 as well. This is shown in the next figure.
The difference between
The first thing to be aware of wrt
equivalentTo is that
Class: C EquivalentTo: D
is an abbreviation for
Class: C SubClassOf: D Class: D SubClassOf: C
The semantics of
SubClassOf is subset. Thus, the above states that the set
C is a subset of the set
D and the set
D is a subset of the set
C. Which means that the sets
D are exactly the same set. We say they are equivalent.
Note that if I know that the classes
C2 are both subclasses of class
C, there is nothing more I can say about how class
C1 relates to class
C2. This is a bit like knowing that bicycles and trucks are both vehicles – I can say nothing more about how bicycles relate to trucks beyond knowing that they are both vehicles.
Back to our initial example
Understanding the semantics of
EquivalentTo we can see that indeed the individual
x is an instance of
A1. Understanding the semantics of
SubClassOf helps us to understand why
x is not inferred to be of type
A2. We know that
A2 is a subclass of
a_to_b some B and that
x is an instance of
a_to_b some B, but there is nothing that can force the reasoner to infer that
x is necessarily an instance of the class
A2. This is illustrated in the next figure.
When to use
EquivalentTo is used for definitions. That is when you want to state the necessary and sufficient conditions for a concept.
SubClassOf is used when you want to define a hierarchy from the most general to the most specific. I.e., it is typically what you see in taxonomies or in object oriented programming languages where one can define class hierarchies. In fact there is a strong relation between OWL 2 ontologies and object orientation which I explore here in more detail.
In this post I explained the difference between
SubClassOf and how they are used, as well as some inferences thatmay be confusing to new users. You can find the example ontology on GitHub.
A most frustrating problem often encountered by people, with experience in relational databases when they are introduced to OWL ontologies, is that OWL ontology reasoners seem to ignore constraints. In this post I give examples of this problem, explain why they happen and I provide ways to deal with each example.
A typical example encountered in relational databases is that of modeling orders with orderlines, which can be modeled via
Orderlines tables where the
Orderlines table has a foreign key constraint to the
Orders table. A related OWL ontology is given in Figure 1. It creates as expected
Orderline classes with a
hasOrder object property. That individuals of
Orderline are necessarily associated with one order is enforced by
Orderline being a subclass of
exactly 1 owl:Thing
Two frustrating and most surprising errors given the Order ontology are: (1) if an
Orderline individual is created for which no associated
Order individual exists, the reasoner will not give an inconsistency, and (2) if an
Orderline individual is created for which two or more
Order individuals exist, the reasoner will also not give an inconsistency.
Missing Association Problem
Say we create an individual
orderline123 of type
Orderline, which is not associated with an individual of type Order, in this case the reasoner will not give an inconsistency. The reason for this is due to the open world assumption. Informally it means that the only inferences that the reasoner can make from an ontology is based on explicit information stated in the ontology or what can derived from explicit stated information.
When you state
orderline123 is an
Orderline, there is no explicit information in the ontology that states that
orderline123 is not associated with an individual of
Order via the
hasOrder property. To make explicit that
orderline123 is not in such a relation, you have to define
orderline123 as in Figure 2.
hasOrder max 0 owl:Thing states that it is known that
orderline123 is not associated with an individual via the
Too Many Associated Individuals Problem
Assume we now change our definition of our
orderline123 individual to be associated via
hasOrder to two individuals of
Order as shown in Figure 3. Again, most frustratingly the reasoner does not find that the ontology is inconsistent. The reason for this is that OWL does not make the unique name assumption. This means that individuals with different names can be assumed by the reasoner to represent a single individual. To force the reasoner to see
order2 as necessarily different, you can state
order1 is different from
order2 by adding
order1 (or similarly for
Constraint Checking versus Deriving Inferences
The source of the problems described here is due to the difference between the
purposes of a relational database and an OWL reasoner. The main purpose of a
relational database is to enable view and edit access of the data in such a way that the integrity of the data is maintained. A relational database will ensure that the data adheres to the constraints of its schema, but it cannot make any claims beyond what is stated by the data it contains. The main purpose of an OWL reasoner is to derive inferences from statements and facts. As an example, from the statement
Class: Dog SubclassOf: Animal and the fact
Individual: pluto Type: Dog it can be derived that
pluto is an
Animal, even though the ontology nowhere states explicitly that
pluto is an
Many newcomers to OWL ontologies get tripped up by the difference in purpose of relational databases and OWL ontologies. In this post I explained these pitfalls and how to deal with them.
If you have an ontology modeling problem, you are welcome leaving a comment detailing the problem.
Description logics (DLs) are syntactic variants of first-order logic that are specifically designed for the conceptual representation of an application domain in terms of concepts and relationships between concepts .
Expressions in DLs are constructed from atomic concepts (unary predicates), atomic roles (binary predicates) and individuals (constants). Complex expressions can be built inductively from these atomic elements using concept constructors. Formally a concept represents a set of individuals and a role a binary relation between individuals .
Formally every DL ontology consists of a set of axioms that are based on finite sets of concepts, roles and individuals. Axioms in a DL ontology are divided into the TBox, the RBox and the ABox. A TBox is used to define concepts and relationships between concepts (that is the terminology or taxonomy) and an ABox is used to assert knowledge regarding the domain of interest (i.e. that an individual is a member of a concept). Depending on the expressivity of the DL used, an ontology may include an RBox. An RBox is used to define relations between roles as well as properties of roles .
A feature of DLs is that they have decidable reasoning procedures for standard reasoning tasks. This means these reasoning procedures will give an answer, unlike undecidable reasoning procedures which may not terminate and thus may not give an answer. A fundamental goal of DL research is to preserve decidability to the point that decidability is considered to be a precondition for claiming that a formalism is a DL. Standard DL reasoning algorithms are sound and complete and, even though the worst-case computational complexity of these algorithms is ExpTime and worse, in practical applications they are well-behaved .
Standard reasoning procedures for DLs are the following .
- Satisfiability checking checks that every axiom in an ontology can be instantiated. Axioms that cannot be instantiated indicates that modelling errors exist within the ontology.
- Consistency checking checks whether there are axioms that contradict each other, which again is indicative of modelling errors.
- Subsumption checking checks whether an axiom subsumes another axiom, which is used for classifying axioms into a parent-child taxonomy.
Various DLs exist with different levels of expressivity and computational complexity. The most widely supported DL is SROIQ(D) which forms the mathematical basis of the W3C OWL 2 standard . In OWL concepts are referred to as classes, roles are referred to as properties and individuals are still referred to as individuals.
In subsequent posts I will provide an intuitive understanding of OWL 2 and explain some of its uses. If you are using OWL or other semantic technologies, I will love to hear from you. Please leave a comment and feel free to explain the novel ways in which you use semantic technologies.
 D. Berardi, D. Calvanese and G. De Giacomo, “Reasoning on UML class diagrams,” Artificial Intelligence, vol. 168, no. 1-2, p. 70–118, 2005.
 F. Baader, D. Calvanese, D. L. McGuinness, D. Nardi and P. F. Patel-Schneider, The Description Logic Handbook: Theory, Implementation and Applications, Cambridge University Press, 2007.
 F. Baader, “What’s new in Description Logics,” Informatik-Spektrum, vol. 34, no. 5, p. 434–442, 2011.
 W3C, “OWL 2 Web Ontology Language – Document Overview (Second Edition),” W3C, 11 December 2012. [Online]. Available: https://www.w3.org/TR/owl2-overview/. [Accessed 9 September 2017].