description logics for conceptual modeling
play

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


  1. 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (11/113)

  2. 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 of 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (12/113)

  3. 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (13/113)

  4. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Outline Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Classes Associations Attributes Generalizations Associations classes Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Reasoning on UML Class Diagrams using Description Logics 5 References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (14/113)

  5. 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/ unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (15/113)

  6. 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (16/113)

  7. 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: objects 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (17/113)

  8. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Example of a UML Class Diagram Take nbr: Integer filmedMeters: Real reel: String 1..* tkOfStp 1..1 Scene Setup stpForScn code: String code: String description: Text 1..1 1..* photographicPars: Text {disjoint, complete} Location Internal External located name: String address: String theater: String nightScene: Boolean 0..* 1 . . 1 description: Text unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (18/113)

  9. 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: During the so-called analysis, where an abstract precise view of the domain 1 of interest needs to be developed. ❀ the so-called “ conceptual perspective ”. During software development, to maintain an abstract view of the software 2 to be developed. ❀ the so-called “implementation perspective”. In this lecture we focus on 1! unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (19/113)

  10. 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: Employee paySlipNumber: Integer salary: Integer worksFor Manager Project projectCode: String 1..* {disjoint, complete} manages AreaManager TopManager 1..1 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (20/113)

  11. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Classes Outline Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Classes Associations Attributes Generalizations Associations classes Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Reasoning on UML Class Diagrams using Description Logics 5 References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (21/113)

  12. 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 Book – the name of the class is ‘Book’ title: String – the class has two properties (attributes) pages: Integer unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (22/113)

  13. 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: { book a , book b , book c , book d , book e } { book α , book β } { book 1 , book 2 , book 3 , . . . , book 500 , . . . } Which is the actual instantiation? We will know it only at run-time!!! – We are now at design time! unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (23/113)

  14. 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 ) . unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (24/113)

  15. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations Outline Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Classes Associations Attributes Generalizations Associations classes Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Reasoning on UML Class Diagrams using Description Logics 5 References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (25/113)

  16. 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 Book Author writtenBy title: String pages: Integer unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (26/113)

  17. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations Associations: formalization C2 ... C1 Cn A We can represent an n -ary association A among classes C 1 , . . . , C n 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: ∀ x 1 , . . . , x n . A ( x 1 , . . . , x n ) → C 1 ( x 1 ) ∧ · · · ∧ C n ( x n ) Example ∀ x 1 , x 2 . writtenBy ( x 1 , x 2 ) → Book ( x 1 ) ∧ Author ( x 2 ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (27/113)

  18. 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 Book Author writtenBy title: String pages: Integer 0..* 1..* 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (28/113)

  19. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations Associations: formalization of multiplicities C1 C2 min2..max2 min1..max1 A Multiplicities of binary associations are easily expressible in FOL: ∀ x 1 . C 1 ( x 1 ) → ( min 1 ≤ ♯ { x 2 | A ( x 1 , x 2 ) } ≤ max 1 ) ∀ x 2 . C 2 ( x 2 ) → ( min 2 ≤ ♯ { x 1 | A ( x 1 , x 2 ) } ≤ 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 of possible values for y . unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (29/113)

  20. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations In our example ... Take nbr: Integer filmedMeters: Real reel: String 1..* tkOfStp 1..1 Scene Setup stpForScn code: String code: String description: Text 1..1 1..* photographicPars: Text {disjoint, complete} Location Internal External located name: String address: String theater: String nightScene: Boolean 0..* 1 . . 1 description: Text unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (30/113)

  21. 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 . code Scene ( x, y ) → Scene ( x ) ∧ String ( y ) ∀ x, y . stpForScn ( x, y ) → ∀ x, y . description ( x, y ) → Scene ( x ) ∧ Text ( y ) Setup ( x ) ∧ Scene ( y ) ∀ x, y . tkOfStp ( x, y ) → ∀ x, y . code Setup ( x, y ) → Setup ( x ) ∧ String ( y ) Take ( x ) ∧ Setup ( y ) ∀ x, y . photographicPars ( x, y ) → Setup ( x ) ∧ Text ( y ) ∀ x, y . located ( x, y ) → ∀ x, y . nbr ( x, y ) → Take ( x ) ∧ Integer ( y ) External ( x ) ∧ Location ( y ) ∀ x, y . filmedMeters ( x, y ) → Take ( x ) ∧ Real ( y ) ∀ x . Setup ( x ) → ∀ x, y . reel ( x, y ) → Take ( x ) ∧ String ( y ) (1 ≤ ♯ { y | stpForScn ( x, y ) } ≤ 1) ∀ x, y . theater ( x, y ) → Internal ( x ) ∧ String ( y ) ∀ y . Scene ( y ) → ∀ x, y . nightScene ( x, y ) → External ( x ) ∧ Boolean ( y ) (1 ≤ ♯ { x | stpForScn ( x, y )) } ∀ x . Take ( x ) → ∀ x, y . name ( x, y ) → Location ( x ) ∧ String ( y ) (1 ≤ ♯ { y | tkOfStp ( x, y ) } ≤ 1) ∀ x, y . address ( x, y ) → Location ( x ) ∧ String ( y ) ∀ x . Setup ( y ) → ∀ x, y . description ( x, y ) → Location ( x ) ∧ Text ( y ) (1 ≤ ♯ { x | tkOfStp ( x, y ) } ) ∀ x . Scene ( x ) → (1 ≤ ♯ { y | code Scene ( x, y ) } ≤ 1) ∀ x . External ( x ) → ∀ x . Internal ( x ) → Scene ( x ) (1 ≤ ♯ { y | located ( x, y ) } ≤ 1) ∀ x . External ( x ) → Scene ( x ) · · · ∀ x . Internal ( x ) → ¬ External ( x ) ∀ x . Scene ( x ) → Internal ( x ) ∨ External ( x ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (31/113)

  22. 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 . C 1 ( x ) → ∃ y . A ( x, y ) ∀ x . C 1 ( x ) → ∀ y, y ′ . A ( x, y ) ∧ A ( x, y ′ ) → y = y ′ 0 .. 1 : (or simply ∀ x, y, y ′ . A ( x, y ) ∧ A ( x, y ′ ) → y = y ′ ) ( ∀ x . C 1 ( x ) → ∃ y . A ( x, y )) ∧ ( ∀ x, y, y ′ . A ( x, y ) ∧ A ( x, y ′ ) → y = y ′ ) 1 .. 1 : unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (32/113)

  23. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Attributes Outline Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Classes Associations Attributes Generalizations Associations classes Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Reasoning on UML Class Diagrams using Description Logics 5 References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (33/113)

  24. 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 Book – The name of one of the attributes is ‘title’. title: String – Its type is ‘String’. pages: Integer unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (34/113)

  25. 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 of the type they have. Example book 3 has as value for the attribute ‘title’ the String: "The little digital video book" . unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (35/113)

  26. 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 Book – The attribute ‘title’ has an implicit multiplicity of 1 .. 1 . title: String pages: Integer – The attribute ‘keywords’ has an explicit multiplicity keywords: String {1..5} of 1 .. 5 . Note: When the multiplicity is not specified, then it is assumed to be 1 .. 1 . unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (36/113)

  27. 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 att C ( x, y ) with the following assertions: An assertion for the attribute type : ∀ x, y . att C ( x, y ) → C ( x ) ∧ T ( y ) An assertion for the multiplicity : ∀ x . C ( x ) → ( i ≤ ♯ { y | att C ( x, y ) } ≤ j ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (37/113)

  28. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Attributes Attributes: example of formalization Book title: String pages: Integer keywords: String {1..5} ∀ x, y . title B ( x, y ) → Book ( x ) ∧ String ( y ) ∀ x . Book ( x ) → (1 ≤ ♯ { y | title B ( x, y ) } ≤ 1) ∀ x, y . pages B ( x, y ) → Book ( x ) ∧ Integer ( y ) ∀ x . Book ( x ) → (1 ≤ ♯ { y | pages B ( x, y ) } ≤ 1) ∀ x, y . keywords B ( x, y ) → Book ( x ) ∧ String ( y ) ∀ x . Book ( x ) → (1 ≤ ♯ { y | keywords B ( x, y ) } ≤ 5) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (38/113)

  29. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Attributes In our example ... Take nbr: Integer filmedMeters: Real reel: String 1..* tkOfStp 1..1 Scene Setup stpForScn code: String code: String description: Text 1..1 1..* photographicPars: Text {disjoint, complete} Location Internal External located name: String address: String theater: String nightScene: Boolean 0..* 1 . . 1 description: Text unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (39/113)

  30. 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 . code Scene ( x, y ) → Scene ( x ) ∧ String ( y ) ∀ x, y . stpForScn ( x, y ) → ∀ x, y . description ( x, y ) → Scene ( x ) ∧ Text ( y ) Setup ( x ) ∧ Scene ( y ) ∀ x, y . tkOfStp ( x, y ) → ∀ x, y . code Setup ( x, y ) → Setup ( x ) ∧ String ( y ) Take ( x ) ∧ Setup ( y ) ∀ x, y . photographicPars ( x, y ) → Setup ( x ) ∧ Text ( y ) ∀ x, y . located ( x, y ) → ∀ x, y . nbr ( x, y ) → Take ( x ) ∧ Integer ( y ) External ( x ) ∧ Location ( y ) ∀ x, y . filmedMeters ( x, y ) → Take ( x ) ∧ Real ( y ) ∀ x . Setup ( x ) → ∀ x, y . reel ( x, y ) → Take ( x ) ∧ String ( y ) (1 ≤ ♯ { y | stpForScn ( x, y ) } ≤ 1) ∀ x, y . theater ( x, y ) → Internal ( x ) ∧ String ( y ) ∀ y . Scene ( y ) → ∀ x, y . nightScene ( x, y ) → External ( x ) ∧ Boolean ( y ) (1 ≤ ♯ { x | stpForScn ( x, y )) } ∀ x . Take ( x ) → ∀ x, y . name ( x, y ) → Location ( x ) ∧ String ( y ) (1 ≤ ♯ { y | tkOfStp ( x, y ) } ≤ 1) ∀ x, y . address ( x, y ) → Location ( x ) ∧ String ( y ) ∀ x . Setup ( y ) → ∀ x, y . description ( x, y ) → Location ( x ) ∧ Text ( y ) (1 ≤ ♯ { x | tkOfStp ( x, y ) } ) ∀ x . Scene ( x ) → (1 ≤ ♯ { y | code Scene ( x, y ) } ≤ 1) ∀ x . External ( x ) → ∀ x . Internal ( x ) → Scene ( x ) (1 ≤ ♯ { y | located ( x, y ) } ≤ 1) ∀ x . External ( x ) → Scene ( x ) · · · ∀ x . Internal ( x ) → ¬ External ( x ) ∀ x . Scene ( x ) → Internal ( x ) ∨ External ( x ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (40/113)

  31. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations Outline Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Classes Associations Attributes Generalizations Associations classes Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Reasoning on UML Class Diagrams using Description Logics 5 References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (41/113)

  32. 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 Person name: String Author The attibute ‘name’ is inherited by ‘Author’. kindOfWriter: String unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (42/113)

  33. 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 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (43/113)

  34. 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 Person {disjoint} Child Adult unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (44/113)

  35. 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 Person {disjoint, complete} Child Teenager Adult unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (45/113)

  36. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations Generalizations: formalization C {disjoint,complete} C1 C2 Ck ... ∀ x . C i ( x ) → C ( x ) , for 1 ≤ i ≤ k ISA: ∀ x . C i ( x ) → ¬ C j ( x ) , for 1 ≤ i < j ≤ k Disjointness: ∀ x . C ( x ) → � k Completeness: i =1 C i ( x ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (46/113)

  37. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations Generalizations: example of formalization Person {disjoint, complete} Child Teenager Adult ∀ 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 )) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (47/113)

  38. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Generalizations In our example ... Take nbr: Integer filmedMeters: Real reel: String 1..* tkOfStp 1..1 Scene Setup stpForScn code: String code: String description: Text 1..1 1..* photographicPars: Text {disjoint, complete} Location Internal External located name: String address: String theater: String nightScene: Boolean 0..* 1 . . 1 description: Text unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (48/113)

  39. 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 . code Scene ( x, y ) → Scene ( x ) ∧ String ( y ) ∀ x, y . stpForScn ( x, y ) → ∀ x, y . description ( x, y ) → Scene ( x ) ∧ Text ( y ) Setup ( x ) ∧ Scene ( y ) ∀ x, y . tkOfStp ( x, y ) → ∀ x, y . code Setup ( x, y ) → Setup ( x ) ∧ String ( y ) Take ( x ) ∧ Setup ( y ) ∀ x, y . photographicPars ( x, y ) → Setup ( x ) ∧ Text ( y ) ∀ x, y . located ( x, y ) → ∀ x, y . nbr ( x, y ) → Take ( x ) ∧ Integer ( y ) External ( x ) ∧ Location ( y ) ∀ x, y . filmedMeters ( x, y ) → Take ( x ) ∧ Real ( y ) ∀ x . Setup ( x ) → ∀ x, y . reel ( x, y ) → Take ( x ) ∧ String ( y ) (1 ≤ ♯ { y | stpForScn ( x, y ) } ≤ 1) ∀ x, y . theater ( x, y ) → Internal ( x ) ∧ String ( y ) ∀ y . Scene ( y ) → ∀ x, y . nightScene ( x, y ) → External ( x ) ∧ Boolean ( y ) (1 ≤ ♯ { x | stpForScn ( x, y )) } ∀ x . Take ( x ) → ∀ x, y . name ( x, y ) → Location ( x ) ∧ String ( y ) (1 ≤ ♯ { y | tkOfStp ( x, y ) } ≤ 1) ∀ x, y . address ( x, y ) → Location ( x ) ∧ String ( y ) ∀ x . Setup ( y ) → ∀ x, y . description ( x, y ) → Location ( x ) ∧ Text ( y ) (1 ≤ ♯ { x | tkOfStp ( x, y ) } ) ∀ x . Scene ( x ) → (1 ≤ ♯ { y | code Scene ( x, y ) } ≤ 1) ∀ x . External ( x ) → ∀ x . Internal ( x ) → Scene ( x ) (1 ≤ ♯ { y | located ( x, y ) } ≤ 1) ∀ x . External ( x ) → Scene ( x ) · · · ∀ x . Internal ( x ) → ¬ External ( x ) ∀ x . Scene ( x ) → Internal ( x ) ∨ External ( x ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (49/113)

  40. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes Outline Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Classes Associations Attributes Generalizations Associations classes Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Reasoning on UML Class Diagrams using Description Logics 5 References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (50/113)

  41. 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). unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (51/113)

  42. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes Association class – Example Book Author 0..* 1..* title: String pages: Integer writtenBy contribution: String unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (52/113)

  43. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes Association class – Example (cont’d) Book Author 0..* 1..* title: String pages: Integer writtenBy Contract 1..1 0..1 contribution: String with unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (53/113)

  44. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes Association classes: formalization C2 ... C1 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 A 1 , . . . , A n , 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 . unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (54/113)

  45. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes Association classes: formalization (cont’d) C2 1..1 A2 ... C1 1..1 A 1..1 Cn A1 An FOL Assertions are needed for stating a bijection between instances of the association class and instances of the association: ∀ x, y . A i ( x, y ) → A ( x ) ∧ C i ( y ) , for i ∈ { 1 , . . . , n } ∀ x . A ( x ) → ∃ y . A i ( x, y ) , for i ∈ { 1 , . . . , n } ∀ x, y, y ′ . A i ( x, y ) ∧ A i ( x, y ′ ) → y = y ′ , for i ∈ { 1 , . . . , n } ∀ x, x ′ , y 1 , . . . , y n . � n i =1 ( A i ( x, y i ) ∧ A i ( x ′ , y i )) → x = x ′ unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (55/113)

  46. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Associations classes Association classes: example of formalization Book Author 0..* 1..* title: String pages: Integer writtenBy contribution: String ∀ x, y . wb 1 ( x, y ) → writtenBy ( x ) ∧ Book ( y ) ∀ x, y . wb 2 ( x, y ) → writtenBy ( x ) ∧ Author ( y ) ∀ x . writtenBy ( x ) → ∃ y . wb 1 ( x, y ) ∀ x . writtenBy ( x ) → ∃ y . wb 2 ( x, y ) ∀ x, y, y ′ . wb 1 ( x, y ) ∧ wb 1 ( x, y ′ ) → y = y ′ ∀ x, y, y ′ . wb 2 ( x, y ) ∧ wb 2 ( x, y ′ ) → y = y ′ ∀ x, x ′ , y 1 , y 2 . wb 1 ( x, y 1 ) ∧ wb 1 ( x ′ , y 1 ) ∧ wb 2 ( x, y 2 ) ∧ wb 2 ( x ′ , y 2 ) → x = x ′ unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (56/113)

  47. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Outline Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Reasoning on UML Class Diagrams using Description Logics 5 References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (57/113)

  48. 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (58/113)

  49. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Class consistency: example (by E. Franconi) Person {disjoint} Italian English {disjoint, complete} {disjoint} Lazy LatinLover Gentleman Hooligan Γ | = ∀ x . LatinLover ( x ) → false unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (59/113)

  50. 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (60/113)

  51. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Class subsumption A class C 1 is subsumed by a class C 2 (or C 2 subsumes C 1 ), if the class diagram implies that C 2 is a generalization of C 1 . Let Γ be the set of FOL assertions corresponding to the UML Class Diagram, and C 1 ( x ) , C 2 ( x ) the predicates corresponding to the classes C 1 , and C 2 of the diagram. Then C 1 is subsumed by C 2 iff Γ | = ∀ x . C 1 ( x ) → C 2 ( x ) Note: Corresponding FOL reasoning task: logical implication. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (61/113)

  52. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Class subsumption: example Person {disjoint} Italian English {disjoint, complete} {disjoint} Lazy LatinLover Gentleman Hooligan Γ | = ∀ x . LatinLover ( x ) → false Γ | = ∀ x . Italian ( x ) → Lazy ( x ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (62/113)

  53. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Class subsumption: another example (by E. Franconi) Italian {disjoint, complete} Lazy Mafioso LatinLover ItalianProf {disjoint} Γ | = ∀ x . ItalianProf ( x ) → LatinLover ( x ) Note: this is an example of reasoning by cases. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (63/113)

  54. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Class equivalence Two classes C 1 and C 2 are equivalent , if C 1 and C 2 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 C 1 ( x ) , C 2 ( x ) the predicates corresponding to the classes C 1 , and C 2 of the diagram. Then C 1 and C 2 are equivalent iff Γ | = ∀ x . C 1 ( x ) ↔ C 2 ( 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (64/113)

  55. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Class equivalence: example Person {disjoint} Italian English {disjoint, complete} {disjoint} Lazy LatinLover Gentleman Hooligan Γ | = ∀ x . LatinLover ( x ) → false Γ | = ∀ x . Italian ( x ) → Lazy ( x ) Γ | = ∀ x . Lazy ( x ) ≡ Italian ( x ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (65/113)

  56. 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (66/113)

  57. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Implicit consequences: example Student Course 3..15 1..10 attends 15 GradStudent AdvCourse 0..20 2..5 gradAttends Γ | = ∀ x . AdvCourse ( x 2 ) → ♯ { x 1 | gradAttends ( x 1 , x 2 ) } ≤ 15 Γ | = ∀ x . GradStudent ( x ) → Student ( x ) Γ �| = ∀ x . AdvCourse ( x ) → Course ( x ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (67/113)

  58. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Unrestricted vs. finite model reasoning NaturalNumber 1..1 double EvenNumber 1..1 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 ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (68/113)

  59. 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (69/113)

  60. 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 on 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? unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (70/113)

  61. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Outline Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Description language Description Logics ontologies Reasoning on UML Class Diagrams using Description Logics 5 References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (71/113)

  62. 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (72/113)

  63. 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: A description language : how to form concepts and roles 1 Human ⊓ Male ⊓ ∃ hasChild ⊓ ∀ hasChild . ( Doctor ⊔ Lawyer ) A mechanism to specify knowledge about concepts and roles (i.e., a 2 TBox) T = { Father ≡ Human ⊓ Male ⊓ ∃ hasChild , HappyFather ⊑ Father ⊓ ∀ hasChild . ( Doctor ⊔ Lawyer ) } A mechanism to specify properties of objects (i.e., an ABox) 3 A = { HappyFather ( john ) , hasChild ( john , mary ) } A set of inference services : how to reason on a given KB 4 T | = HappyFather ⊑ ∃ hasChild . ( Doctor ⊔ Lawyer ) T ∪ A | = ( Doctor ⊔ Lawyer )( mary ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (73/113)

  64. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description language Outline Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Description language Description Logics ontologies Reasoning on UML Class Diagrams using Description Logics 5 References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (74/113)

  65. 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 A I 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (75/113)

  66. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description language Concept constructors Construct Syntax Example Semantics A I ⊆ ∆ I atomic concept A Doctor P I ⊆ ∆ I × ∆ I atomic role P hasChild ∆ I \ A I atomic negation ¬ A ¬ Doctor C I ∩ D I C ⊓ D Hum ⊓ Male conjunction { o | ∃ o ′ . ( o, o ′ ) ∈ R I } (unqual.) exist. res. ∃ R ∃ hasChild ∀ hasChild . Male { o | ∀ o ′ . ( o, o ′ ) ∈ R I → o ′ ∈ C I } value restriction ∀ R . C 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (76/113)

  67. 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 C I ∪ D I disjunction U C ⊔ D ∆ I top ⊤ { o | ∃ o ′ . ( o, o ′ ) ∈ R I ∧ o ′ ∈ C I } qual. exist. res. E ∃ R . C ∆ I \ C I (full) negation C ¬ C { o | # { o ′ | ( o, o ′ ) ∈ R I } ≥ k } number N ( ≥ k R ) { o | # { o ′ | ( o, o ′ ) ∈ R I } ≤ k } restrictions ( ≤ k R ) { o | # { o ′ | ( o, o ′ ) ∈ R I ∧ o ′ ∈ C I } ≥ k } Q ( ≥ k R . C ) qual. number { o | # { o ′ | ( o, o ′ ) ∈ R I ∧ o ′ ∈ C I } ≤ k } restrictions ( ≤ k R . C ) { ( o, o ′ ) | ( o ′ , o ) ∈ R I } R − inverse role I R ∗ ( R I ) ∗ role closure reg Many different DL constructs and their combinations have been investigated. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (77/113)

  68. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Description Logics ontologies Outline Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Description language Description Logics ontologies Reasoning on UML Class Diagrams using Description Logics 5 References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (78/113)

  69. 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). unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (79/113)

  70. 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: C 1 ⊑ C 2 Inclusion assertions on roles: R 1 ⊑ R 2 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 c i to denote individuals) Membership assertions for concepts: A ( c ) Membership assertions for roles: P ( c 1 , c 2 ) Equality and distinctness assertions: c 1 ≈ c 2 , c 1 �≈ c 2 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (80/113)

  71. 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 C 1 ≡ C 2 as an abbreviation for C 1 ⊑ C 2 , C 2 ⊑ C 1 . TBox assertions: Inclusion assertions on concepts: Father ≡ Human ⊓ Male ⊓ ∃ hasChild HappyFather ⊑ Father ⊓ ∀ hasChild . ( Doctor ⊔ Lawyer ⊔ HappyPerson ) ⊑ ∀ descendant . HappyFather HappyAnc ⊑ ¬ Doctor ⊓ ¬ Lawyer Teacher Inclusion assertions on roles: hasChild − hasChild ⊑ descendant hasFather ⊑ Property assertions on roles: ( transitive descendant ) , ( reflexive descendant ) , ( functional hasFather ) ABox membership assertions: Teacher ( mary ) , hasFather ( mary , john ) , HappyAnc ( john ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (81/113)

  72. 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: if C I 1 ⊆ C I I | = C 1 ⊑ C 2 2 . if R I 1 ⊆ R I I | = R 1 ⊑ R 2 2 . if P I is a relation that has the property prop . I | = ( prop P ) (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 c I of ∆ I . if c I ∈ A I . = c 1 ≈ c 2 if c I 1 = c I I | = A ( c ) I | 2 . I | = P ( c 1 , c 2 ) if ( c I 1 , c I 2 ) ∈ P I . I | = c 1 �≈ c 2 if c I 1 � = c I 2 . unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (82/113)

  73. 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). unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (83/113)

  74. Introduction UML in FOL Forms of reasoning Intro to DLs Reasoning in UML via DLs References Outline Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Reasoning on UML Class Diagrams using Description Logics 5 Reducing reasoning in UML to reasoning in DLs Reducing reasoning in DLs to reasoning in UML References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (84/113)

  75. 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: one that associates to each UML Class Diagram D a DL TBox T D . one that associates to each DL TBox T a UML Class Diagram D T . 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 . unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (85/113)

  76. 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 Introduction to conceptual modeling 1 Formalizing UML Class Diagrams in FOL 2 Forms of reasoning on UML Class Diagrams 3 Brief overview of Description Logics 4 Reasoning on UML Class Diagrams using Description Logics 5 Reducing reasoning in UML to reasoning in DLs Reducing reasoning in DLs to reasoning in UML References 6 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (86/113)

  77. 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 T D 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (87/113)

  78. 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 − ⊑ T ∃ a ⊑ C 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (88/113)

  79. 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 Phone class name number[1..*]: String attributes brand: String operations lastDialed(): String callLength(String): Integer To encode the class Phone, we introduce a concept Phone. Encoding of the attributes number and brand: ∃ number − ⊑ String ∃ number ⊑ Phone ∃ brand − ⊑ String ∃ brand ⊑ Phone 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). unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (89/113)

  80. 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. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (90/113)

  81. 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 min 2 .. max 2 min 1 .. max 1 C 1 C 2 A An association A between C 1 and C 2 is represented by a DL role A , with: ∃ A − ⊑ C 2 ∃ A ⊑ C 1 To encode the multiplicities of A : each instance of class C 1 is connected through association A to at least min 1 and at most max 1 instances of C 2 : C 1 ⊑ ( ≥ min 1 A ) ⊓ ( ≤ max 1 A ) each instance of class C 2 is connected through association A − to at least min 2 and at most max 2 instances of C 1 : ( ≥ min 2 A − ) ⊓ ( ≤ max 2 A − ) C 2 ⊑ unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (91/113)

  82. 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 1 .. 1 1 .. ∗ PhoneBill PhoneCall reference ∃ reference ⊑ PhoneBill ∃ reference − ⊑ PhoneCall ⊑ ( ≥ 1 reference ) PhoneBill ( ≥ 1 reference − ) ⊓ ( ≤ 1 reference − ) PhoneCall ⊑ Note: an aggregation is just a particular kind of binary association without association class. unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (92/113)

  83. 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 C 2 A . . . A 2 A 1 A n A 1 A n C 1 C n A 2 . . . C n C 1 C 2 A o 1 o 2 o n An association A is represented by a concept A . Each instance a of A represents an instance ( o 1 , . . . , o n ) of the association. n (binary) roles A 1 , . . . , A n are used to connect an object a representing a tuple to objects o 1 , . . . , o n representing the components of the tuple. To ensure that the instances of A correctly represent tuples: ∃ A i ⊑ for i ∈ { 1 , . . . , n } A, ∃ A − ⊑ for i ∈ { 1 , . . . , n } C i , i ⊑ ∃ A 1 ⊓ · · · ⊓ ∃ A n ⊓ ( ≤ 1 A 1 ) ⊓ · · · ⊓ ( ≤ 1 A n ) A Note: when the roles of A are explicitly named in the class diagram, we can use such role names instead of A 1 , . . . , A n . unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (93/113)

  84. 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 a 1 , a 2 of concept A representing the same instance ( o 1 , . . . , o n ) of association A : a 1 A A 1 A n A 2 To rule out such a situation we could add . . . an identification assertion (see later): C 1 o 1 C 2 o 2 C n o n ( id A A 1 , . . . , A n ) A 2 A 1 A n A a 2 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 . unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (94/113)

  85. 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 min 2 .. max 2 min 1 .. max 1 C 1 C 2 A 1 A 2 A We can encode the multiplicities of association A by means of number restrictions on the inverses of roles A 1 and A 2 : each instance of class C 1 is connected through association A to at least min 1 and at most max 1 instances of C 2 : ( ≥ min 1 A − 1 ) ⊓ ( ≤ max 1 A − C 1 ⊑ 1 ) each instance of class C 2 is connected through association A − to at least min 2 and at most max 2 instances of C 1 : ( ≥ min 2 A − 2 ) ⊓ ( ≤ max 2 A − C 2 ⊑ 2 ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (95/113)

  86. 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 0 .. ∗ 1 .. 1 PhoneCall Phone call from Origin place: String ∃ place − ⊑ String ∃ place ⊑ Origin Origin ⊑ ∃ place ⊓ ( ≤ 1 place ) ∃ call − ⊑ PhoneCall ∃ call ⊑ Origin ∃ from − ⊑ Phone ∃ from ⊑ Origin Origin ⊑ ∃ call ⊓ ( ≤ 1 call ) ⊓ ∃ from ⊓ ( ≤ 1 from ) PhoneCall ⊑ ( ≥ 1 call − ) ⊓ ( ≤ 1 call − ) unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (96/113)

  87. 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 C C ⊑ C 1 C . . . ⊑ C 1 C C k ⊑ C C 1 C 1 C 2 C k . . . When the generalization is disjoint : C i ⊑ ¬ C j for 1 ≤ i < j ≤ k When the generalization is complete : ⊑ C 1 ⊔ · · · ⊔ C k C unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (97/113)

  88. 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: A C 1 C 2 A ′ Role inclusion assertion: ⊑ A A ′ C ′ C ′ 1 2 With reification: A 1 A 2 C 1 C 2 Concept inclusion assert.: A ′ ⊑ A A Role inclusion assertions: A ′ ⊑ A 1 1 A ′ ⊑ A 2 A ′ 2 A ′ A ′ C ′ C ′ 1 2 1 2 unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (98/113)

  89. 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 CellPhone { disjoint, complete } ETACSphone GSMphone UMTSphone ETACSphone ⊑ CellPhone ETACSphone ⊑ ¬ GSMPhone GSMSphone ⊑ CellPhone ETACSphone ⊑ ¬ UMTSPhone ⊑ ⊑ ¬ UMTSPhone UMTSSphone CellPhone GSMphone CellPhone ⊑ ETACSphone ⊔ GSMphone ⊔ UMTSPhone unibz.it unibz.it Diego Calvanese (FUB) DLs for Conceptual Modeling EPCL BTC – 10–21/12/2012 (99/113)

Recommend


More recommend