Description Logics for Conceptual Modeling Diego Calvanese KRDB - - PowerPoint PPT Presentation

description logics for conceptual modeling
SMART_READER_LITE
LIVE PREVIEW

Description Logics for Conceptual Modeling Diego Calvanese KRDB - - PowerPoint PPT Presentation

Description Logics for Conceptual Modeling Diego Calvanese KRDB Research Centre for Knowledge and Data Free University of Bozen-Bolzano, Italy Currently on sabbatical leave at Technical University Vienna, Austria EPCL Basic Training Camp


slide-1
SLIDE 1

Description Logics for Conceptual Modeling

Diego Calvanese

KRDB Research Centre for Knowledge and Data Free University of Bozen-Bolzano, Italy Currently on sabbatical leave at Technical University Vienna, Austria EPCL Basic Training Camp 2012/2013 10–21/12/2012 Dresden, Germany

slide-2
SLIDE 2

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (1/113)

slide-3
SLIDE 3

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (2/113)

slide-4
SLIDE 4

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Modeling information systems

Information system Is a system that collects, stores, and processes information about the state of a domain of interest. To function properly, an information system needs to: maintain an internal representation of the state of the domain, provide information about the state, change the state by performing actions. Note: In this lecture, we ignore the dynamic aspects related to modeling the evolution of the state and the state changes, and concentrate on modeling the static aspects only.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (3/113)

slide-5
SLIDE 5

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Designing information systems

To design an information system, we need proper formalisms for representing the state of the domain of interest. We are interested in capturing the semantics of the domain of interest, through suitable constraints that rule out undesired states. We are also interested in automated support to the design tasks, by suitably manipulating the representation at the semantic level. Increasingly, information systems may use the semantic representation also at operation time, to better support the user interaction with the system, and the functioning of the system itself.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (4/113)

slide-6
SLIDE 6

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Semantic model of the domain of interest

We aim at obtaining a description of the state of the domain of interest in semantic terms. One can proceed as follows:

1

Represent the domain of interest as a conceptual schema, similar to those used at design time to design a database.

2

Formalize the conceptual schema as a logical theory (also called an

  • ntology).

3

Use the resulting logical theory to:

reason about the domain of interest at design time, and extract information from the representation at run-time, through query answering.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (5/113)

slide-7
SLIDE 7

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Let’s start with an exercise

Requirements: We are interested in building a software application to manage filmed scenes for realizing a movie, by following the so-called “Hollywood Approach”. Every scene is identified by a code (a string) and is described by a text in natural language. Every scene is filmed from different positions (at least one), each of this is called a

  • setup. Every setup is characterized by a code (a string) and a text in natural language

where the photographic parameters are noted (e.g., aperture, exposure, focal length, filters, etc.). Note that a setup is related to a single scene. For every setup, several takes may be filmed (at least one). Every take is characterized by a (positive) natural number, a real number representing the number

  • f meters of film that have been used for shooting the take, and the code (a string) of

the reel where the film is stored. Note that a take is associated to a single setup. Scenes are divided into internals that are filmed in a theater, and externals that are filmed in a location and can either be “day scene” or “night scene”. Locations are characterized by a code (a string) and the address of the location, and a text describing them in natural language. Write a precise specification of this domain using any formalism you like!

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (6/113)

slide-8
SLIDE 8

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Solution 1: Use conceptual modeling diagrams (UML)!

code: String photographicPars: Text

Setup

code: String description: Text

Scene

theater: String

Internal

nightScene: Boolean

External 1..* 1..1 stpForScn Location

name: String address: String description: Text

1..* 1 . . 1 0..* tkOfStp located 1..1

{disjoint, complete}

Take

nbr: Integer filmedMeters: Real reel: String

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (7/113)

slide-9
SLIDE 9

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Solution 1: Use conceptual modeling diagrams – Discussion

Good points: Easy to generate (it’s the standard in software design). Easy to understand for humans. Well disciplined, well-established methodologies available. Bad points: No precise semantics (people that use it wave hands about it). Verification (or better validation) done informally by humans. Machine incomprehensible (because of lack of formal semantics). Automated reasoning and query answering out of question. Limited expressiveness (∗).

(∗) Not really a bad point, in fact.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (8/113)

slide-10
SLIDE 10

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Solution 2: Use logic!!

Alphabet: Scene(x), Setup(x), Take(x), Internal(x), External(x), Location(x), stpForScn(x, y), tkOfStp(x, y), located(x, y), . . . . Axioms: ∀x, y. codeScene(x, y) → Scene(x) ∧ String(y) ∀x, y. description(x, y) → Scene(x) ∧ Text(y) ∀x, y. codeSetup(x, y) → Setup(x) ∧ String(y) ∀x, y. photographicPars(x, y) → Setup(x) ∧ Text(y) ∀x, y. nbr(x, y) → Take(x) ∧ Integer(y) ∀x, y. filmedMeters(x, y) → Take(x) ∧ Real(y) ∀x, y. reel(x, y) → Take(x) ∧ String(y) ∀x, y. theater(x, y) → Internal(x) ∧ String(y) ∀x, y. nightScene(x, y) → External(x) ∧ Boolean(y) ∀x, y. name(x, y) → Location(x) ∧ String(y) ∀x, y. address(x, y) → Location(x) ∧ String(y) ∀x, y. description(x, y) → Location(x) ∧ Text(y) ∀x. Scene(x) → (1 ≤ ♯{y | codeScene(x, y)} ≤ 1) ∀x. Internal(x) → Scene(x) ∀x. External(x) → Scene(x) ∀x. Internal(x) → ¬External(x) ∀x. Scene(x) → Internal(x) ∨ External(x) ∀x, y. stpForScn(x, y) → Setup(x) ∧ Scene(y) ∀x, y. tkOfStp(x, y) → Take(x) ∧ Setup(y) ∀x, y. located(x, y) → External(x) ∧ Location(y) ∀x. Setup(x) → (1 ≤ ♯{y | stpForScn(x, y)} ≤ 1) ∀y. Scene(y) → (1 ≤ ♯{x | stpForScn(x, y))} ∀x. Take(x) → (1 ≤ ♯{y | tkOfStp(x, y)} ≤ 1) ∀x. Setup(y) → (1 ≤ ♯{x | tkOfStp(x, y)}) ∀x. External(x) → (1 ≤ ♯{y | located(x, y)} ≤ 1) · · ·

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (9/113)

slide-11
SLIDE 11

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Solution 2: Use logic – Discussion

Good points: Precise semantics. Formal verification. Allows for query answering. Machine comprehensible. Virtually unlimited expressiveness (∗). Bad points: Difficult to generate. Difficult to understand for humans. Too unstructured (making reasoning difficult), no well-established methodologies available. Automated reasoning may be impossible.

(∗) Not really a bad point, in fact.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (10/113)

slide-12
SLIDE 12

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Solution 3: Use both!!!

Note: these two approaches seem to be orthogonal, but in fact they can be used together cooperatively. Basic idea: Assign formal semantics to constructs of the conceptual design diagrams. Use conceptual design diagrams as usual, taking advantage of methodologies developed for them in Software Engineering. Read diagrams as logical theories when needed, i.e., for formal understanding, verification, automated reasoning, etc. Added values: Inherited from conceptual modeling diagrams: ease-to-use for humans inherit from logic: formal semantics and reasoning tasks, which are needed for formal verification and machine manipulation.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (11/113)

slide-13
SLIDE 13

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Solution 3: Use both!!! (cont’d)

Important: The logical theories that are obtained from conceptual modeling diagrams are

  • f a specific form.

Their expressiveness is limited (or better, well-disciplined). One can exploit the particular form of the logical theory to simplify reasoning. The aim is getting:

decidability, and reasoning procedures that match the intrinsic computational complexity of reasoning over the conceptual modeling diagrams.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (12/113)

slide-14
SLIDE 14

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Conceptual models vs. logic

We illustrate now what we get from interpreting conceptual modeling diagrams in logic. We will use: As conceptual modeling diagrams: UML Class Diagrams.

Note: we could equivalently use Entity-Relationship Diagrams instead of UML.

As logic:

First-Order Logic, to formally capture semantics and the different forms of reasoning over conceptual modeling diagrams. Description Logics, to show that automated reasoning over conceptual modeling diagrams is feasible.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (13/113)

slide-15
SLIDE 15

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL Classes Associations Attributes Generalizations Associations classes

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (14/113)

slide-16
SLIDE 16

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

The Unified Modeling Language (UML)

The Unified Modeling Language (UML) was developed in 1994 by unifying and integrating the most prominent object-oriented modeling approaches: Booch Rumbaugh: Object Modeling Technique (OMT) Jacobson: Object-Oriented Software Engineering (OOSE) History: 1995, version 0.8, Booch, Rumbaugh; 1996, version 0.9, Booch, Rumbaugh, Jacobson; version 1.0 BRJ + Digital, IBM, HP, . . . UML 1.4.2 is industrial standard ISO/IEC 19501. Current version: 2.3 (May 2010): http://www.omg.org/spec/UML/ 1999–today: de facto standard object-oriented modeling language. References: Grady Booch, James Rumbaugh, Ivar Jacobson, “The unified modeling language user guide”, Addison Wesley, 1999 (2nd ed., 2005) http://www.omg.org/ → UML http://www.uml.org/

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (15/113)

slide-17
SLIDE 17

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

UML Class Diagrams

In this lecture we deal only with one of the most prominent components of UML: UML Class Diagrams. A UML Class Diagram is used to represent explicitly the information on a domain of interest (typically the application domain of software). Note: This is exactly the goal of all conceptual modeling formalism, such as Entity-Relationship Diagrams (standard in Database design) or Ontologies.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (16/113)

slide-18
SLIDE 18

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

UML Class Diagrams (cont’d)

The UML class diagram models the domain of interest in terms of:

  • bjects grouped into classes;

associations, representing relationships between classes; attributes, representing simple properties of the instances of classes; Note: here we do not deal with “operations”. sub-classing, i.e., ISA and generalization relationships.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (17/113)

slide-19
SLIDE 19

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Example of a UML Class Diagram

code: String photographicPars: Text

Setup

code: String description: Text

Scene

theater: String

Internal

nightScene: Boolean

External 1..* 1..1 stpForScn Location

name: String address: String description: Text

1..* 1 . . 1 0..* tkOfStp located 1..1

{disjoint, complete}

Take

nbr: Integer filmedMeters: Real reel: String

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (18/113)

slide-20
SLIDE 20

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Use of UML Class Diagrams

UML Class Diagrams are used in various phases of a software design:

1

During the so-called analysis, where an abstract precise view of the domain

  • f interest needs to be developed.

❀ the so-called “conceptual perspective”.

2

During software development, to maintain an abstract view of the software to be developed. ❀ the so-called “implementation perspective”. In this lecture we focus on 1!

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (19/113)

slide-21
SLIDE 21

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

UML Class Diagrams and ER Schemas

UML class diagrams (when used for the conceptual perspective) closely resemble Entity-Relationship (ER) Diagrams. Example of UML vs. ER:

paySlipNumber: Integer salary: Integer

Employee Manager AreaManager TopManager

projectCode: String

Project 1..* 1..1 worksFor manages

{disjoint, complete} Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (20/113)

slide-22
SLIDE 22

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Classes

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL Classes Associations Attributes Generalizations Associations classes

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (21/113)

slide-23
SLIDE 23

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Classes

Classes in UML

A class in UML models a set of objects (its “instances”) that share certain common properties, such as attributes, operations, etc. Each class is characterized by: a name (which must be unique in the whole class diagram), a set of (local) properties, namely attributes and operations (see later). Example

title: String pages: Integer

Book – the name of the class is ‘Book’ – the class has two properties (attributes)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (22/113)

slide-24
SLIDE 24

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Classes

Classes in UML: instances

The objects that belong to a class are called instances of the class. They form a so-called instantiation (or extension) of the class. Example Here are some possible instantiations of our class Book: {booka, bookb, bookc, bookd, booke} {bookα, bookβ} {book1, book2, book3, . . . , book500, . . . } Which is the actual instantiation? We will know it only at run-time!!! – We are now at design time!

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (23/113)

slide-25
SLIDE 25

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Classes

Classes in UML: formalization

A class represents a set of objects. . . . But which set? We don’t actually know. So, how can we assign a semantics to such a class? We represent a class as a FOL unary predicate! Example For our class Book, we introduce a predicate Book(x).

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (24/113)

slide-26
SLIDE 26

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL Classes Associations Attributes Generalizations Associations classes

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (25/113)

slide-27
SLIDE 27

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations

Associations

An association in UML models a relationship between two or more classes. At the instance level, an association is a relation between the instances of two or more classes. Associations model properties of classes that are non-local, in the sense that they involve other classes. An association between n classes is a property of each of these classes. Example

Author writtenBy

title: String pages: Integer

Book

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (26/113)

slide-28
SLIDE 28

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations

Associations: formalization

Cn C1 A C2

...

We can represent an n-ary association A among classes C1, . . . , Cn as an n-ary predicate A in FOL. We assert that the components of the predicate must belong to the classes participating to the association: ∀x1, . . . , xn. A(x1, . . . , xn) → C1(x1) ∧ · · · ∧ Cn(xn) Example ∀x1, x2. writtenBy(x1, x2) → Book(x1) ∧ Author(x2)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (27/113)

slide-29
SLIDE 29

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations

Associations: multiplicity

On binary associations, we can place multiplicity constraints, i.e., a minimal and maximal number of tuples in which every object participates as first (second) component. Example

1..* 0..* Author writtenBy

title: String pages: Integer

Book

Note: UML multiplicities for associations are look-across and are not easy to use in an intuitive way for n-ary associations. So typically they are not used at all. In contrast, in ER Schemas, multiplicities are not look-across and are easy to use, and widely used.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (28/113)

slide-30
SLIDE 30

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations

Associations: formalization of multiplicities

A

min2..max2 min1..max1

C1 C2 Multiplicities of binary associations are easily expressible in FOL: ∀x1. C1(x1) → (min1 ≤ ♯{x2 | A(x1, x2)} ≤ max 1) ∀x2. C2(x2) → (min2 ≤ ♯{x1 | A(x1, x2)} ≤ max 2) Example ∀x. Book(x) → (1 ≤ ♯{y | written by(x, y)}) Note: this is a shorthand for a FOL formula expressing the cardinality of the set

  • f possible values for y.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (29/113)

slide-31
SLIDE 31

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations

In our example ...

code: String photographicPars: Text

Setup

code: String description: Text

Scene

theater: String

Internal

nightScene: Boolean

External 1..* 1..1 stpForScn Location

name: String address: String description: Text

1..* 1 . . 1 0..* tkOfStp located 1..1

{disjoint, complete}

Take

nbr: Integer filmedMeters: Real reel: String

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (30/113)

slide-32
SLIDE 32

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations

In our example ...

Alphabet: Scene(x), Setup(x), Take(x), Internal(x), External(x), Location(x), stpForScn(x, y), tkOfStp(x, y), located(x, y), . . . . Axioms: ∀x, y. codeScene(x, y) → Scene(x) ∧ String(y) ∀x, y. description(x, y) → Scene(x) ∧ Text(y) ∀x, y. codeSetup(x, y) → Setup(x) ∧ String(y) ∀x, y. photographicPars(x, y) → Setup(x) ∧ Text(y) ∀x, y. nbr(x, y) → Take(x) ∧ Integer(y) ∀x, y. filmedMeters(x, y) → Take(x) ∧ Real(y) ∀x, y. reel(x, y) → Take(x) ∧ String(y) ∀x, y. theater(x, y) → Internal(x) ∧ String(y) ∀x, y. nightScene(x, y) → External(x) ∧ Boolean(y) ∀x, y. name(x, y) → Location(x) ∧ String(y) ∀x, y. address(x, y) → Location(x) ∧ String(y) ∀x, y. description(x, y) → Location(x) ∧ Text(y) ∀x. Scene(x) → (1 ≤ ♯{y | codeScene(x, y)} ≤ 1) ∀x. Internal(x) → Scene(x) ∀x. External(x) → Scene(x) ∀x. Internal(x) → ¬External(x) ∀x. Scene(x) → Internal(x) ∨ External(x) ∀x, y. stpForScn(x, y) → Setup(x) ∧ Scene(y) ∀x, y. tkOfStp(x, y) → Take(x) ∧ Setup(y) ∀x, y. located(x, y) → External(x) ∧ Location(y) ∀x. Setup(x) → (1 ≤ ♯{y | stpForScn(x, y)} ≤ 1) ∀y. Scene(y) → (1 ≤ ♯{x | stpForScn(x, y))} ∀x. Take(x) → (1 ≤ ♯{y | tkOfStp(x, y)} ≤ 1) ∀x. Setup(y) → (1 ≤ ♯{x | tkOfStp(x, y)}) ∀x. External(x) → (1 ≤ ♯{y | located(x, y)} ≤ 1) · · ·

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (31/113)

slide-33
SLIDE 33

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations

Associations: most interesting multiplicities

The most interesting multiplicities are: 0..∗: unconstrained 1..∗: mandatory participation 0..1: functional participation (the association is a partial function) 1..1: mandatory and functional participation (the association is a total faction) In FOL: 0..∗: no constraint 1..∗: ∀x. C1(x) → ∃y.A(x, y) 0..1: ∀x. C1(x) → ∀y, y′.A(x, y) ∧ A(x, y′) → y = y′ (or simply ∀x, y, y′.A(x, y) ∧ A(x, y′) → y = y′) 1..1: (∀x. C1(x) → ∃y.A(x, y)) ∧ (∀x, y, y′.A(x, y) ∧ A(x, y′) → y = y′)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (32/113)

slide-34
SLIDE 34

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Attributes

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL Classes Associations Attributes Generalizations Associations classes

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (33/113)

slide-35
SLIDE 35

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Attributes

Attributes

An attribute models a local property of a class. It is characterized by: a name (which is unique only in the class it belongs to), a type (a collection of possible values), and possibly a multiplicity. Example

title: String pages: Integer

Book – The name of one of the attributes is ‘title’. – Its type is ‘String’.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (34/113)

slide-36
SLIDE 36

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Attributes

Attributes as functions

Attributes (without explicit multiplicity) are: mandatory (must have at least a value), and single-valued (can have at most one value). That is, they are total functions from the instances of the class to the values

  • f the type they have.

Example book 3 has as value for the attribute ‘title’ the String: "The little digital video book".

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (35/113)

slide-37
SLIDE 37

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Attributes

Attributes with multiplicity

More generally attributes may have an explicit multiplicity (similar to that of associations). Example

title: String pages: Integer keywords: String {1..5}

Book

– The attribute ‘title’ has an implicit multiplicity of 1..1. – The attribute ‘keywords’ has an explicit multiplicity

  • f 1..5.

Note: When the multiplicity is not specified, then it is assumed to be 1..1.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (36/113)

slide-38
SLIDE 38

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Attributes

Attributes: formalization

Since attributes may have a multiplicity different from 1..1, they are better formalized as binary predicates, with suitable assertions representing types and multiplicity. Given an attribute att of a class C with type T and multiplicity i..j, we capture it in FOL as a binary predicate attC(x, y) with the following assertions: An assertion for the attribute type: ∀x, y. attC(x, y) → C(x) ∧ T(y) An assertion for the multiplicity: ∀x. C(x) → (i ≤ ♯{y | attC(x, y)} ≤ j)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (37/113)

slide-39
SLIDE 39

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Attributes

Attributes: example of formalization

title: String pages: Integer keywords: String {1..5}

Book

∀x, y. titleB(x, y) → Book(x) ∧ String(y) ∀x. Book(x) → (1 ≤ ♯{y | titleB(x, y)} ≤ 1) ∀x, y. pagesB(x, y) → Book(x) ∧ Integer(y) ∀x. Book(x) → (1 ≤ ♯{y | pagesB(x, y)} ≤ 1) ∀x, y. keywordsB(x, y) → Book(x) ∧ String(y) ∀x. Book(x) → (1 ≤ ♯{y | keywordsB(x, y)} ≤ 5)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (38/113)

slide-40
SLIDE 40

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Attributes

In our example ...

code: String photographicPars: Text

Setup

code: String description: Text

Scene

theater: String

Internal

nightScene: Boolean

External 1..* 1..1 stpForScn Location

name: String address: String description: Text

1..* 1 . . 1 0..* tkOfStp located 1..1

{disjoint, complete}

Take

nbr: Integer filmedMeters: Real reel: String

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (39/113)

slide-41
SLIDE 41

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Attributes

In our example ...

Alphabet: Scene(x), Setup(x), Take(x), Internal(x), External(x), Location(x), stpForScn(x, y), tkOfStp(x, y), located(x, y), . . . . Axioms: ∀x, y. codeScene(x, y) → Scene(x) ∧ String(y) ∀x, y. description(x, y) → Scene(x) ∧ Text(y) ∀x, y. codeSetup(x, y) → Setup(x) ∧ String(y) ∀x, y. photographicPars(x, y) → Setup(x) ∧ Text(y) ∀x, y. nbr(x, y) → Take(x) ∧ Integer(y) ∀x, y. filmedMeters(x, y) → Take(x) ∧ Real(y) ∀x, y. reel(x, y) → Take(x) ∧ String(y) ∀x, y. theater(x, y) → Internal(x) ∧ String(y) ∀x, y. nightScene(x, y) → External(x) ∧ Boolean(y) ∀x, y. name(x, y) → Location(x) ∧ String(y) ∀x, y. address(x, y) → Location(x) ∧ String(y) ∀x, y. description(x, y) → Location(x) ∧ Text(y) ∀x. Scene(x) → (1 ≤ ♯{y | codeScene(x, y)} ≤ 1) ∀x. Internal(x) → Scene(x) ∀x. External(x) → Scene(x) ∀x. Internal(x) → ¬External(x) ∀x. Scene(x) → Internal(x) ∨ External(x) ∀x, y. stpForScn(x, y) → Setup(x) ∧ Scene(y) ∀x, y. tkOfStp(x, y) → Take(x) ∧ Setup(y) ∀x, y. located(x, y) → External(x) ∧ Location(y) ∀x. Setup(x) → (1 ≤ ♯{y | stpForScn(x, y)} ≤ 1) ∀y. Scene(y) → (1 ≤ ♯{x | stpForScn(x, y))} ∀x. Take(x) → (1 ≤ ♯{y | tkOfStp(x, y)} ≤ 1) ∀x. Setup(y) → (1 ≤ ♯{x | tkOfStp(x, y)}) ∀x. External(x) → (1 ≤ ♯{y | located(x, y)} ≤ 1) · · ·

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (40/113)

slide-42
SLIDE 42

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL Classes Associations Attributes Generalizations Associations classes

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (41/113)

slide-43
SLIDE 43

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations

ISA and generalizations

The ISA relationship is of particular importance in conceptual modeling: a class C ISA a class C′ if every instance of C is also an instance of C′. In UML, the ISA relationship is modeled through the notion of generalization. Example

name: String

Person

kindOfWriter: String

Author

The attibute ‘name’ is inherited by ‘Author’.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (42/113)

slide-44
SLIDE 44

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations

Generalizations

A generalization involves a superclass (base class) and one or more subclasses: every instance of each subclass is also an instance of the superclass. Example

Person Child Adult

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (43/113)

slide-45
SLIDE 45

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations

Generalizations with constraints

The ability of having more subclasses in the same generalization, allows for placing suitable constraints on the classes involved in the generalization. Example

{disjoint}

Person Child Adult

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (44/113)

slide-46
SLIDE 46

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations

Generalizations with constraints (cont’d)

Most notable and used constraints: Disjointness, which asserts that different subclasses cannot have common instances (i.e., an object cannot be at the same time instance of two disjoint subclasses). Completeness (aka “covering”), which asserts that every instance of the superclass is also an instance of at least one of the subclasses. Example

{disjoint, complete}

Person Child Adult Teenager

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (45/113)

slide-47
SLIDE 47

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations

Generalizations: formalization

... {disjoint,complete}

C C1 C2 Ck

ISA: ∀x. Ci(x) → C(x), for 1 ≤ i ≤ k Disjointness: ∀x. Ci(x) → ¬Cj(x), for 1 ≤ i < j ≤ k Completeness: ∀x. C(x) → k

i=1 Ci(x)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (46/113)

slide-48
SLIDE 48

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations

Generalizations: example of formalization

{disjoint, complete}

Person Child Adult Teenager

∀x. Child(x) → Person(x) ∀x. Teenager(x) → Person(x) ∀x. Adult(x) → Person(x) ∀x. Child(x) → ¬Teenager(x) ∀x. Child(x) → ¬Adult(x) ∀x. Teenager(x) → ¬Adult(x) ∀x. Person(x) → (Child(x) ∨ Teenager(x) ∨ Adult(x))

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (47/113)

slide-49
SLIDE 49

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations

In our example ...

code: String photographicPars: Text

Setup

code: String description: Text

Scene

theater: String

Internal

nightScene: Boolean

External 1..* 1..1 stpForScn Location

name: String address: String description: Text

1..* 1 . . 1 0..* tkOfStp located 1..1

{disjoint, complete}

Take

nbr: Integer filmedMeters: Real reel: String

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (48/113)

slide-50
SLIDE 50

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations

In our example ...

Alphabet: Scene(x), Setup(x), Take(x), Internal(x), External(x), Location(x), stpForScn(x, y), tkOfStp(x, y), located(x, y), . . . . Axioms: ∀x, y. codeScene(x, y) → Scene(x) ∧ String(y) ∀x, y. description(x, y) → Scene(x) ∧ Text(y) ∀x, y. codeSetup(x, y) → Setup(x) ∧ String(y) ∀x, y. photographicPars(x, y) → Setup(x) ∧ Text(y) ∀x, y. nbr(x, y) → Take(x) ∧ Integer(y) ∀x, y. filmedMeters(x, y) → Take(x) ∧ Real(y) ∀x, y. reel(x, y) → Take(x) ∧ String(y) ∀x, y. theater(x, y) → Internal(x) ∧ String(y) ∀x, y. nightScene(x, y) → External(x) ∧ Boolean(y) ∀x, y. name(x, y) → Location(x) ∧ String(y) ∀x, y. address(x, y) → Location(x) ∧ String(y) ∀x, y. description(x, y) → Location(x) ∧ Text(y) ∀x. Scene(x) → (1 ≤ ♯{y | codeScene(x, y)} ≤ 1) ∀x. Internal(x) → Scene(x) ∀x. External(x) → Scene(x) ∀x. Internal(x) → ¬External(x) ∀x. Scene(x) → Internal(x) ∨ External(x) ∀x, y. stpForScn(x, y) → Setup(x) ∧ Scene(y) ∀x, y. tkOfStp(x, y) → Take(x) ∧ Setup(y) ∀x, y. located(x, y) → External(x) ∧ Location(y) ∀x. Setup(x) → (1 ≤ ♯{y | stpForScn(x, y)} ≤ 1) ∀y. Scene(y) → (1 ≤ ♯{x | stpForScn(x, y))} ∀x. Take(x) → (1 ≤ ♯{y | tkOfStp(x, y)} ≤ 1) ∀x. Setup(y) → (1 ≤ ♯{x | tkOfStp(x, y)}) ∀x. External(x) → (1 ≤ ♯{y | located(x, y)} ≤ 1) · · ·

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (49/113)

slide-51
SLIDE 51

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL Classes Associations Attributes Generalizations Associations classes

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (50/113)

slide-52
SLIDE 52

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes

Association classes

Sometimes we may want to assert properties of associations. In UML to do so we resort to association classes: That is, we associate to an association a class whose instances are in bijection with the tuples of the association. Then we use the association class exactly as a UML class (modeling local and non-local properties).

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (51/113)

slide-53
SLIDE 53

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes

Association class – Example

1..* 0..* Author

contribution: String

writtenBy

title: String pages: Integer

Book

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (52/113)

slide-54
SLIDE 54

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes

Association class – Example (cont’d)

Contract with 1..1 0..1 1..* 0..* Author

contribution: String

writtenBy

title: String pages: Integer

Book

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (53/113)

slide-55
SLIDE 55

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes

Association classes: formalization

...

C1 C2 Cn A

The process of putting in correspondence objects of a class (the association class) with tuples in an association is formally described as reification. That is: We introduce a unary predicate A for the association class A. We introduce n new binary predicates A1, . . . , An, one for each of the components of the association. We introduce suitable assertions so that objects in the extension of the unary-predicate A are in bijection with tuples in the n-ary association A.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (54/113)

slide-56
SLIDE 56

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes

Association classes: formalization (cont’d)

... 1..1 1..1 1..1

A1 An A2 C1 A Cn C2

FOL Assertions are needed for stating a bijection between instances of the association class and instances of the association: ∀x, y. Ai(x, y) → A(x) ∧ Ci(y), for i ∈ {1, . . . , n} ∀x. A(x) → ∃y. Ai(x, y), for i ∈ {1, . . . , n} ∀x, y, y′. Ai(x, y) ∧ Ai(x, y′) → y = y′, for i ∈ {1, . . . , n} ∀x, x′, y1, . . . , yn. n

i=1(Ai(x, yi) ∧ Ai(x′, yi)) → x = x′

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (55/113)

slide-57
SLIDE 57

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes

Association classes: example of formalization

1..* 0..* Author

contribution: String

writtenBy

title: String pages: Integer

Book

∀x, y. wb1(x, y) → writtenBy(x) ∧ Book(y) ∀x, y. wb2(x, y) → writtenBy(x) ∧ Author(y) ∀x. writtenBy(x) → ∃y. wb1(x, y) ∀x. writtenBy(x) → ∃y. wb2(x, y) ∀x, y, y′. wb1(x, y) ∧ wb1(x, y′) → y = y′ ∀x, y, y′. wb2(x, y) ∧ wb2(x, y′) → y = y′ ∀x, x′, y1, y2. wb1(x, y1) ∧ wb1(x′, y1) ∧ wb2(x, y2) ∧ wb2(x′, y2) → x = x′

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (56/113)

slide-58
SLIDE 58

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (57/113)

slide-59
SLIDE 59

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Class consistency

A class is consistent, if the class diagram admits an instantiation in which the class has a non-empty set of instances. Let Γ be the set of FOL assertions corresponding to the UML Class Diagram, and C(x) the predicate corresponding to a class C of the diagram. Then C is consistent iff Γ | = ∀x. C(x) → false i.e., there exists a model of Γ in which the extension of C(x) is not the empty set. Note: Corresponding FOL reasoning task: satisfiability.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (58/113)

slide-60
SLIDE 60

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Class consistency: example (by E. Franconi)

Italian Lazy LatinLover

{disjoint, complete} {disjoint}

English Gentleman Hooligan Person

{disjoint}

Γ | = ∀x. LatinLover(x) → false

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (59/113)

slide-61
SLIDE 61

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Whole diagram consistency

A class diagram is consistent, if it admits an instantiation, i.e., if its classes can be populated without violating any of the conditions imposed by the diagram. Let Γ be the set of FOL assertions corresponding to the UML Class Diagram. Then, the diagram is consistent iff Γ is satisfiable i.e., Γ admits at least one model.

(Remember that FOL models cannot be empty.)

Note: Corresponding FOL reasoning task: satisfiability.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (60/113)

slide-62
SLIDE 62

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Class subsumption

A class C1 is subsumed by a class C2 (or C2 subsumes C1), if the class diagram implies that C2 is a generalization of C1. Let Γ be the set of FOL assertions corresponding to the UML Class Diagram, and C1(x), C2(x) the predicates corresponding to the classes C1, and C2 of the diagram. Then C1 is subsumed by C2 iff Γ | = ∀x. C1(x) → C2(x) Note: Corresponding FOL reasoning task: logical implication.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (61/113)

slide-63
SLIDE 63

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Class subsumption: example

Italian Lazy LatinLover

{disjoint, complete} {disjoint}

English Gentleman Hooligan Person

{disjoint}

Γ | = ∀x. LatinLover(x) → false Γ | = ∀x. Italian(x) → Lazy(x)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (62/113)

slide-64
SLIDE 64

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Class subsumption: another example (by E. Franconi)

Italian Lazy Mafioso

{disjoint, complete}

LatinLover ItalianProf

{disjoint}

Γ | = ∀x. ItalianProf (x) → LatinLover(x) Note: this is an example of reasoning by cases.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (63/113)

slide-65
SLIDE 65

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Class equivalence

Two classes C1 and C2 are equivalent, if C1 and C2 denote the same set of instances in all instantiations of the class diagram. Let Γ be the set of FOL assertions corresponding to the UML Class Diagram, and C1(x), C2(x) the predicates corresponding to the classes C1, and C2 of the diagram. Then C1 and C2 are equivalent iff Γ | = ∀x. C1(x) ↔ C2(x) Note: If two classes are equivalent then one of them is redundant. Determining equivalence of two classes allows for their merging, thus reducing the complexity of the diagram.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (64/113)

slide-66
SLIDE 66

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Class equivalence: example

Italian Lazy LatinLover

{disjoint, complete} {disjoint}

English Gentleman Hooligan Person

{disjoint}

Γ | = ∀x. LatinLover(x) → false Γ | = ∀x. Italian(x) → Lazy(x) Γ | = ∀x. Lazy(x) ≡ Italian(x)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (65/113)

slide-67
SLIDE 67

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Implicit consequence

The properties of various classes and associations may interact to yield stricter multiplicities or typing than those explicitly specified in the diagram. More generally . . . A property P is an (implicit) consequence of a class diagram if P holds whenever all conditions imposed by the diagram are satisfied. Let Γ be the set of FOL assertion corresponding to the UML Class Diagram, and P (the formalization in FOL of) the property of interest Then P is an implicit consequence iff Γ | = P i.e., the property P holds in every model of Γ. Note: Corresponding FOL reasoning task: logical implication.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (66/113)

slide-68
SLIDE 68

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Implicit consequences: example

Student Course 1..10 3..15 attends GradStudent AdvCourse 2..5 0..20 gradAttends 15

Γ | = ∀x. AdvCourse(x2) → ♯{x1 | gradAttends(x1, x2)} ≤ 15 Γ | = ∀x. GradStudent(x) → Student(x) Γ | = ∀x. AdvCourse(x) → Course(x)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (67/113)

slide-69
SLIDE 69

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Unrestricted vs. finite model reasoning

NaturalNumber EvenNumber 1..1 1..1 double

Due to the multiplicities, the classes NaturalNumber and EvenNumber are in bijection. As a consequence, in every instantiation of the diagram, “the classes NaturalNumber and EvenNumber contain the same number of objects”. Due to the ISA relationship, every instance of EvenNumber is also an instance of NaturalNumber, i.e., we have that Γ | = ∀x. EvenNumber(x) → NaturalNumber(x)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (68/113)

slide-70
SLIDE 70

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Unrestricted vs. finite model reasoning (cont’d)

Question: Does also the reverse implication hold, i.e., Γ | = ∀x. NaturalNumber(x) → EvenNumber(x) ? if the domain is infinite, the implication does not hold. If the domain is finite, the implication does hold. Finite model reasoning: means reasoning only with respect to models with a finite domain. Finite model reasoning is interesting for standard databases. The previous example shows that in UML Class Diagrams, finite model reasoning is different form unrestricted model reasoning.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (69/113)

slide-71
SLIDE 71

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Questions

In the above examples reasoning could be easily carried out on intuitive grounds. However, two questions come up.

  • 1. Can we develop sound, complete, and terminating procedures for reasoning
  • n UML Class Diagrams?

We cannot do so by directly relying on FOL! But we can use specialized logics with better computational properties. A form of such specialized logics are Description Logics.

  • 2. How hard is it to reason on UML Class Diagrams in general?

What is the worst-case situation? Can we single out interesting fragments on which to reason efficiently?

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (70/113)

slide-72
SLIDE 72

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics Description language Description Logics ontologies

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (71/113)

slide-73
SLIDE 73

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

What are Description Logics?

Description Logics (DLs) [Baader et al., 2003] are logics specifically designed to represent and reason on structured knowledge: The domain of interest is composed of objects and is structured into:

concepts, which correspond to classes, and denote sets of objects roles, which correspond to (binary) relationships, and denote binary relations on objects

The knowledge is asserted through so-called assertions, i.e., logical axioms. Hence, DLs have a purpose similar to that of conceptual modeling formalisms.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (72/113)

slide-74
SLIDE 74

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Ingredients of a Description Logic

A DL is characterized by:

1

A description language: how to form concepts and roles Human ⊓ Male ⊓ ∃hasChild ⊓ ∀hasChild.(Doctor ⊔ Lawyer)

2

A mechanism to specify knowledge about concepts and roles (i.e., a TBox) T = { Father ≡ Human ⊓ Male ⊓ ∃hasChild, HappyFather ⊑ Father ⊓ ∀hasChild.(Doctor ⊔ Lawyer) }

3

A mechanism to specify properties of objects (i.e., an ABox) A = { HappyFather(john), hasChild(john, mary) }

4

A set of inference services: how to reason on a given KB T | = HappyFather ⊑ ∃hasChild.(Doctor ⊔ Lawyer) T ∪ A | = (Doctor ⊔ Lawyer)(mary)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (73/113)

slide-75
SLIDE 75

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description language

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics Description language Description Logics ontologies

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (74/113)

slide-76
SLIDE 76

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description language

Formal semantics of a description language

The formal semantics of DLs is given in terms of interpretations. Def.: An interpretation I = (∆I, ·I) consists of: a nonempty set ∆I, called the interpretation domain (of I) an interpretation function ·I, which maps

each atomic concept A to a subset AI of ∆I each atomic role P to a subset P I of ∆I × ∆I

The interpretation function is extended to complex concepts and roles according to their syntactic structure.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (75/113)

slide-77
SLIDE 77

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description language

Concept constructors

Construct Syntax Example Semantics atomic concept A Doctor AI ⊆ ∆I atomic role P hasChild P I ⊆ ∆I × ∆I atomic negation ¬A ¬Doctor ∆I \ AI conjunction C ⊓ D Hum ⊓ Male CI ∩ DI (unqual.) exist. res. ∃R ∃hasChild { o | ∃o′. (o, o′) ∈ RI } value restriction ∀R.C ∀hasChild.Male {o | ∀o′. (o, o′) ∈ RI → o′ ∈ CI} bottom ⊥ ∅ (C, D denote arbitrary concepts and R an arbitrary role) The above constructs form the basic language AL of the family of AL languages.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (76/113)

slide-78
SLIDE 78

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description language

Additional concept and role constructors

Construct AL· Syntax Semantics disjunction U C ⊔ D CI ∪ DI top ⊤ ∆I

  • qual. exist. res.

E ∃R.C { o | ∃o′. (o, o′) ∈ RI ∧ o′ ∈ CI } (full) negation C ¬C ∆I \ CI number N (≥ k R) { o | #{o′ | (o, o′) ∈ RI} ≥ k } restrictions (≤ k R) { o | #{o′ | (o, o′) ∈ RI} ≤ k }

  • qual. number

Q (≥ k R. C) { o | #{o′ | (o, o′) ∈ RI ∧ o′ ∈ CI} ≥ k } restrictions (≤ k R. C) { o | #{o′ | (o, o′) ∈ RI ∧ o′ ∈ CI} ≤ k } inverse role I R− { (o, o′) | (o′, o) ∈ RI } role closure

reg

R∗ (RI)∗ Many different DL constructs and their combinations have been investigated.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (77/113)

slide-79
SLIDE 79

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description Logics ontologies

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics Description language Description Logics ontologies

5

Reasoning on UML Class Diagrams using Description Logics

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (78/113)

slide-80
SLIDE 80

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description Logics ontologies

Structural properties vs. asserted properties

We have seen how to build complex concept and roles expressions, which allow one to denote classes with a complex structure. However, in order to represent real world domains, one needs the ability to assert properties of classes and relationships between them (e.g., as done in UML class diagrams). The assertion of properties is done in DLs by means of an ontology (or knowledge base).

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (79/113)

slide-81
SLIDE 81

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description Logics ontologies

Description Logics ontology (or knowledge base)

Is a pair O = T , A, where T is a TBox and A is an ABox: Def.: Description Logics TBox Consists of a set of assertions on concepts and roles: Inclusion assertions on concepts: C1 ⊑ C2 Inclusion assertions on roles: R1 ⊑ R2 Property assertions on (atomic) roles: (transitive P) (symmetric P) (domain P C) (functional P) (reflexive P) (range P C) · · · Def.: Description Logics ABox Consists of a set of assertions on individuals:

(we use ci to denote individuals)

Membership assertions for concepts: A(c) Membership assertions for roles: P(c1, c2) Equality and distinctness assertions: c1 ≈ c2, c1 ≈ c2

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (80/113)

slide-82
SLIDE 82

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description Logics ontologies

Description Logics ontology – Example

Note: We use C1 ≡ C2 as an abbreviation for C1 ⊑ C2, C2 ⊑ C1. TBox assertions: Inclusion assertions on concepts: Father ≡ Human ⊓ Male ⊓ ∃hasChild HappyFather ⊑ Father ⊓ ∀hasChild.(Doctor ⊔ Lawyer ⊔ HappyPerson) HappyAnc ⊑ ∀descendant.HappyFather Teacher ⊑ ¬Doctor ⊓ ¬Lawyer Inclusion assertions on roles: hasChild ⊑ descendant hasFather ⊑ hasChild− Property assertions on roles: (transitive descendant), (reflexive descendant), (functional hasFather) ABox membership assertions: Teacher(mary), hasFather(mary, john), HappyAnc(john)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (81/113)

slide-83
SLIDE 83

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description Logics ontologies

Semantics of a Description Logics ontology

The semantics is given by specifying when an interpretation I satisfies an assertion α, denoted I | = α. TBox Assertions: I | = C1 ⊑ C2 if CI

1 ⊆ CI 2 .

I | = R1 ⊑ R2 if RI

1 ⊆ RI 2 .

I | = (prop P) if P I is a relation that has the property prop. (Note: domain and range assertions can be expressed by means of concept inclusion assertions.) ABox Assertions: We need first to extend the interpretation function ·I, so that it maps each individual c to an element cI of ∆I. I | = A(c) if cI ∈ AI. I | = P(c1, c2) if (cI

1, cI 2) ∈ P I.

I | = c1 ≈ c2 if cI

1 = cI 2.

I | = c1 ≈ c2 if cI

1 = cI 2.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (82/113)

slide-84
SLIDE 84

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description Logics ontologies

Model of a Description Logics ontology

Def.: Model An interpretation I is a model of: an assertion α, if it satisfies α. a TBox T , if it satisfies all assertions in T . an ABox A, if it satisfies all assertions in A. an ontology O = T , A, if it is a model of both T and A. Note: We use I | = β to denote that interpretation I is a model of β (where β stands for an assertion, TBox, ABox, or ontology).

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (83/113)

slide-85
SLIDE 85

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics Reducing reasoning in UML to reasoning in DLs Reducing reasoning in DLs to reasoning in UML

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (84/113)

slide-86
SLIDE 86

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

DLs vs. UML Class Diagrams

There is a tight correspondence between variants of DLs and UML Class Diagrams [Berardi et al., 2005; Artale et al., 2007]. We can devise two transformations:

  • ne that associates to each UML Class Diagram D a DL TBox TD.
  • ne that associates to each DL TBox T a UML Class Diagram DT .

The transformations are not model-preserving, but are based on a correspondence between instantiations of the Class Diagram and models of the associated TBox. The transformations are satisfiability-preserving, i.e., a class C is consistent in D iff the corresponding concept is satisfiable in T .

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (85/113)

slide-87
SLIDE 87

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics Reducing reasoning in UML to reasoning in DLs Reducing reasoning in DLs to reasoning in UML

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (86/113)

slide-88
SLIDE 88

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Encoding UML Class Diagrams in DLs

The ideas behind the encoding of a UML Class Diagram D in terms of a DL TBox TD are quite natural: Each class is represented by an atomic concept. Each attribute is represented by a role. Each binary association is represented by a role. Each non-binary association is reified, i.e., represented as a concept connected to its components by roles. Each part of the diagram is encoded by suitable assertions.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (87/113)

slide-89
SLIDE 89

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Encoding of classes and attributes

A UML class C is represented by an atomic concept C Each attribute a of type T for C is represented by an atomic role a.

To encode the typing of a: ∃a ⊑ C ∃a− ⊑ T To encode the multiplicity [m..n] of a: C ⊑ (≥ m a) ⊓ (≤ n a)

When m is 0, we omit the first conjunct. When n is ∗, we omit the second conjunct. When the multiplicity is [0..∗] we omit the whole assertion. When the multiplicity is missing (i.e., [1..1]), the assertion becomes: C ⊑ ∃a ⊓ (≤ 1 a)

Note: We have assumed that different classes don’t share attributes. The encoding can be extended also to operations of classes.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (88/113)

slide-90
SLIDE 90

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Encoding of classes and attributes – Example

number[1..*]: String brand: String lastDialed(): String callLength(String): Integer class name attributes

  • perations

Phone To encode the class Phone, we introduce a concept Phone. Encoding of the attributes number and brand: ∃number ⊑ Phone ∃brand ⊑ Phone ∃number− ⊑ String ∃brand− ⊑ String Encoding of the multiplicities of the attributes number and brand: Phone ⊑ ∃number Phone ⊑ ∃brand ⊓ (≤ 1 brand) We do not consider the encoding of the operations: lastDialed() and callLength(String).

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (89/113)

slide-91
SLIDE 91

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Encoding of associations

The encoding of associations depends on: the presence/absence of an association class; the arity of the association. Without With Arity association class association class Binary via a DL role via reification Non-binary via reification via reification Note: an aggregation is just a particular kind of binary association without association class and is encoded via a DL role.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (90/113)

slide-92
SLIDE 92

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Encoding of binary associations without association class

min1 .. max1 C2 A C1 min2 .. max2 An association A between C1 and C2 is represented by a DL role A, with: ∃A ⊑ C1 ∃A− ⊑ C2 To encode the multiplicities of A:

each instance of class C1 is connected through association A to at least min1 and at most max1 instances of C2: C1 ⊑ (≥ min1 A) ⊓ (≤ max1 A) each instance of class C2 is connected through association A− to at least min2 and at most max2 instances of C1: C2 ⊑ (≥ min2 A−) ⊓ (≤ max2 A−)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (91/113)

slide-93
SLIDE 93

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Binary associations without association class – Example

reference 1..1 1..∗ PhoneCall PhoneBill ∃reference ⊑ PhoneBill ∃reference− ⊑ PhoneCall PhoneBill ⊑ (≥ 1 reference) PhoneCall ⊑ (≥ 1 reference−) ⊓ (≤ 1 reference−) Note: an aggregation is just a particular kind of binary association without association class.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (92/113)

slide-94
SLIDE 94

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Encoding of associations via reification

A C1 Cn C2

. . .

A1 A2 An

a A1 An A2 C1 C2

. . . Cn

  • 1
  • 2
  • n

A

An association A is represented by a concept A. Each instance a of A represents an instance (o1, . . . , on) of the association. n (binary) roles A1, . . . , An are used to connect an object a representing a tuple to objects o1, . . . , on representing the components of the tuple. To ensure that the instances of A correctly represent tuples: ∃Ai ⊑ A, for i ∈ {1, . . . , n} ∃A−

i

⊑ Ci, for i ∈ {1, . . . , n} A ⊑ ∃A1 ⊓ · · · ⊓ ∃An ⊓ (≤ 1 A1) ⊓ · · · ⊓ (≤ 1 An) Note: when the roles of A are explicitly named in the class diagram, we can use such role names instead of A1, . . . , An.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (93/113)

slide-95
SLIDE 95

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Encoding of associations via reification

We have not ruled out the existence of two instances a1, a2 of concept A representing the same instance (o1, . . . , on) of association A:

a2 a1 C1 A

. . .

A An A2 An A2 A1 A1 Cn

  • 2
  • n

C2

  • 1

To rule out such a situation we could add an identification assertion (see later): (id A A1, . . . , An) Note: in a tree-model the above situation cannot occur. ❀ By the tree-model property of DLs, when reasoning on a KB, we can restrict the attention to tree-models. Hence we can ignore the identification assertions.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (94/113)

slide-96
SLIDE 96

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Multiplicities of binary associations with association class

A2 C2 min1 .. max1 C1 min2 .. max2 A A1

We can encode the multiplicities of association A by means of number restrictions on the inverses of roles A1 and A2: each instance of class C1 is connected through association A to at least min1 and at most max1 instances of C2: C1 ⊑ (≥ min1 A−

1 ) ⊓ (≤ max1 A− 1 )

each instance of class C2 is connected through association A− to at least min2 and at most max2 instances of C1: C2 ⊑ (≥ min2 A−

2 ) ⊓ (≤ max2 A− 2 )

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (95/113)

slide-97
SLIDE 97

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Associations with association class – Example

from 0..∗ call 1..1 Phone place: String Origin PhoneCall ∃place ⊑ Origin ∃place− ⊑ String Origin ⊑ ∃place ⊓ (≤ 1 place) ∃call ⊑ Origin ∃call− ⊑ PhoneCall ∃from ⊑ Origin ∃from− ⊑ Phone Origin ⊑ ∃call ⊓ (≤ 1 call) ⊓ ∃from ⊓ (≤ 1 from) PhoneCall ⊑ (≥ 1 call−) ⊓ (≤ 1 call−)

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (96/113)

slide-98
SLIDE 98

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Encoding of ISA and generalization

C1 C

C1 ⊑ C

C2 C C1 . . . Ck

C1 ⊑ C . . . Ck ⊑ C When the generalization is disjoint: Ci ⊑ ¬Cj for 1 ≤ i < j ≤ k When the generalization is complete: C ⊑ C1 ⊔ · · · ⊔ Ck

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (97/113)

slide-99
SLIDE 99

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Encoding of ISA between associations

Without reification:

C1 C2 C′

2

C′

1

A A′

Role inclusion assertion: A′ ⊑ A With reification:

C1 C2 C′

1

C′

2

A′ A A1 A′

1

A2 A′

2

Concept inclusion assert.: A′ ⊑ A Role inclusion assertions: A′

1

⊑ A1 A′

2

⊑ A2

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (98/113)

slide-100
SLIDE 100

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

ISA and generalization – Example

ETACSphone GSMphone UMTSphone CellPhone {disjoint, complete} ETACSphone ⊑ CellPhone ETACSphone ⊑ ¬GSMPhone GSMSphone ⊑ CellPhone ETACSphone ⊑ ¬UMTSPhone UMTSSphone ⊑ CellPhone GSMphone ⊑ ¬UMTSPhone CellPhone ⊑ ETACSphone ⊔ GSMphone ⊔ UMTSPhone

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (99/113)

slide-101
SLIDE 101

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Encoding UML Class Diagrams in DLs – Example

fromMO reference PhoneBill PhoneCall Phone MobileCall CellPhone FixedPhone MobileOrigin Origin {disjoint, complete} place: String callO fromO callMO 1..1 1..* 0..* 0..* 0..* 1..1

∃reference ⊑ PhoneBill ∃reference− ⊑ PhoneCall PhoneBill ⊑ (≥ 1 reference) PhoneCall ⊑ (≥ 1 reference−) ⊓ (≤ 1 reference−) ∃place ⊑ Origin ∃place− ⊑ String Origin ⊑ ∃place ⊓ (≤ 1 place) ∃callO ⊑ Origin ∃callO− ⊑ PhoneCall ∃fromO ⊑ Origin ∃fromO− ⊑ Phone Origin ⊑ ∃callO ⊓ (≤ 1 callO) ⊓ ∃fromO ⊓ (≤ 1 fromO) PhoneCall ⊑ (≥ 1 callO−) ⊓ (≤ 1 callO−) ∃callMO ⊑ MobileOrigin ∃callMO− ⊑ MobileCall ∃fromMO ⊑ MobileOrigin ∃fromMO− ⊑ CellPhone MobileOrigin ⊑ ∃callMO ⊓ (≤ 1 callMO) ⊓ ∃fromMO ⊓ (≤ 1 fromMO) MobileOrigin ⊑ Origin callMO ⊑ callO fromMO ⊑ fromO MobileCall ⊑ PhoneCall CellPhone ⊑ Phone FixedPhone ⊑ Phone ⊓ ¬CellPhone Phone ⊑ CellPhone ⊔ FixedPhone

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (100/113)

slide-102
SLIDE 102

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Encoding UML Class Diagrams in DLs – Example 2

empCode: Integer salary: Integer

Employee Manager AreaManager TopManager 1..* 1..1 boss

projectName: String

Project 1..* 1..1 1..1 worksFor manages 3..*

{disjoint, complete}

Manager ⊑ Employee AreaManager ⊑ Manager TopManager ⊑ Manager AreaManager ⊑ ¬TopManager Manager ⊑ AreaManager ⊔ TopManager ∃salary− ⊑ Integer ∃salary ⊑ Employee Employee ⊑ ∃salary ⊓ (≤ 1 salary) ∃worksFor ⊑ Employee ∃worksFor− ⊑ Project Employee ⊑ ∃worksFor Project ⊑ (≥ 3 worksFor−) manages ⊑ worksFor · · ·

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (101/113)

slide-103
SLIDE 103

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in UML to reasoning in DLs

Reasoning on UML Class Diagrams using DLs

The encoding shows that we can reason over UML Class Diagrams as follows:

1

Transform the UML Class Diagram D into a DL TBox TD.

2

Use standard techniques to reason on TD, and transfer the results to D. Hence, reasoning over UML Class Diagrams: is computationally not harder than reasoning over ontologies in expressive DLs, i.e., in ExpTime. can be done effectively by using state-of-the-art reasoners for expressive DLs. Questions Is it actually necessary to make use of a formalism with such a high computational complexity? Can we use instead an encoding in a computationally simpler formalism? We will show in the following that this complexity is intrinsic in UML Class Diagrams, unless we pose some restrictions on the form of the diagram.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (102/113)

slide-104
SLIDE 104

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in DLs to reasoning in UML

Outline

1

Introduction to conceptual modeling

2

Formalizing UML Class Diagrams in FOL

3

Forms of reasoning on UML Class Diagrams

4

Brief overview of Description Logics

5

Reasoning on UML Class Diagrams using Description Logics Reducing reasoning in UML to reasoning in DLs Reducing reasoning in DLs to reasoning in UML

6

References

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (103/113)

slide-105
SLIDE 105

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in DLs to reasoning in UML

Reducing reasoning in ALC to reasoning in UML

We show how to reduce reasoning over ALC TBoxes to reasoning on UML Class Diagrams: We restrict the attention to so-called primitive ALC− TBoxes, where the concept inclusion assertions have a simplified form:

there is a single atomic concept on the left-hand side; there is a single concept constructor on the right-hand side.

Given a primitive ALC− TBox T , we construct a UML Class Diagram DT such that: an atomic concept A in T is satisfiable iff the corresponding class A in DT is satisfiable. Note: We preserve satisfiability, but do not have a direct correspondence between models of T and instantiations of DT .

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (104/113)

slide-106
SLIDE 106

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in DLs to reasoning in UML

Encoding DL TBoxes in UML Class Diagrams

Given a primitive ALC− TBox T , we construct DT as follows: For each atomic concept A in T , we introduce in DT a class A. We introduce in DT an additional class O that generalizes all the classes corresponding to atomic concepts. For each atomic role P, we introduce in DT :

a class CP (that reifies P); two functional associations P1, P2, representing the two components of P.

For each inclusion assertion in T , we introduce suitable parts of DT , as shown in the following. We need to encode the following kinds of inclusion assertions: A ⊑ B A ⊑ ¬B A ⊑ B1 ⊔ B2 A ⊑ ∃P.B A ⊑ ∀P.B

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (105/113)

slide-107
SLIDE 107

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in DLs to reasoning in UML

Encoding of inclusion and of disjointness

For each assertion A ⊑ B of T , add the following to DT :

A B

For each assertion A ⊑ ¬B of T , add the following to DT :

{disjoint}

O A B

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (106/113)

slide-108
SLIDE 108

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in DLs to reasoning in UML

Encoding of union

For each assertion A ⊑ B1 ⊔ B2 of T , introduce an auxiliary class B, and add the following to DT :

{complete}

A B B1 B2

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (107/113)

slide-109
SLIDE 109

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in DLs to reasoning in UML

Encoding of existential quantification

For each assertion A ⊑ ∃P.B of T , introduce the auxiliary class CPAB and the associations PAB1 and PAB2, and add the following to DT :

1..1

PAB1

1..1

1..* PAB2 P2 P1

1..1 1..1

O A B CP CPAB

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (108/113)

slide-110
SLIDE 110

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in DLs to reasoning in UML

Encoding of universal quantification

For each assertion A ⊑ ∀P.B of T , introduce the auxiliary classes ¯ A, CPAB, and CPAB, and the associations PAB1, P ¯

AB1, and PAB2, and add the following

to DT :

{disjoint} {complete} 1..1

P1

1..1

P2

1..1

PAB1 P ¯

AB1 1..1

PAB2

1..1

O B A ¯ A CPAB CPAB CP

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (109/113)

slide-111
SLIDE 111

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in DLs to reasoning in UML

Complexity of reasoning on UML Class Diagrams

Lemma An atomic concept A in a primitive ALC− TBox T is satisfiable if and only if the class A is satisfiable in the UML Class Diagram DT . Reasoning over primitive ALC− TBoxes is ExpTime-hard. From this, we obtain: Theorem Reasoning over UML Class Diagrams is ExpTime-hard.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (110/113)

slide-112
SLIDE 112

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in DLs to reasoning in UML

Reasoning on UML Class Diagrams using DLs

The two encodings show that DL TBoxes and UML Class Diagrams essentially have the same computational properties. Hence, reasoning over UML Class Diagrams has the same complexity as reasoning over ontologies in expressive DLs, i.e., ExpTime-complete. This is somewhat surprising, since UML Class Diagrams are so widely used and yet reasoning on them (and hence fully understanding the implication they may give rise to), in general is a computationally very hard task. The high complexity is caused by:

1

the possibility to use disjunction (covering constraints)

2

the interaction between role inclusions and functionality constraints (maximum 1 cardinality – see encoding of universal and existential quantification) Note: Without (1) and restricting (2), reasoning becomes simpler [Artale et al., 2007; Artale et al., 2009]: NLogSpace-complete in combined complexity in LogSpace in data complexity

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (111/113)

slide-113
SLIDE 113

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Reducing reasoning in DLs to reasoning in UML

UML Class Diagrams for efficient access to data

We are interested in using UML Class Diagrams to specify ontologies that are suitable for accessing data efficiently, i.e., we are interested in using UML Class Diagrams for ontology-based data access: Besides intensional reasoning, one is interested in query answering. The relevant complexity measure is data complexity, i.e., the complexity measured in the size of the data only. Questions Which is the right combination of constructs to allow in UML Class Diagrams to be used for OBDA? Are there techniques for query answering in this case that can be derived from Description Logics? Can query answering be done efficiently in the size of the data? If yes, can we leverage relational database technology for query answering?

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (112/113)

slide-114
SLIDE 114

unibz.it unibz.it

Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References

References I

[Artale et al., 2007] Alessandro Artale, Diego Calvanese, Roman Kontchakov, Vladislav Ryzhikov, and Michael Zakharyaschev. Reasoning over extended ER models. In Proc. of the 26th Int. Conf. on Conceptual Modeling (ER 2007), volume 4801 of Lecture Notes in Computer Science, pages 277–292. Springer, 2007. [Artale et al., 2009] Alessandro Artale, Diego Calvanese, Roman Kontchakov, and Michael Zakharyaschev. The DL-Lite family and relations.

  • J. of Artificial Intelligence Research, 36:1–69, 2009.

[Baader et al., 2003] Franz Baader, Diego Calvanese, Deborah McGuinness, Daniele Nardi, and Peter F. Patel-Schneider, editors. The Description Logic Handbook: Theory, Implementation and Applications. Cambridge University Press, 2003. [Berardi et al., 2005] Daniela Berardi, Diego Calvanese, and Giuseppe De Giacomo. Reasoning on UML class diagrams. Artificial Intelligence, 168(1–2):70–118, 2005.

Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (113/113)