Verbalizing Business Rules: Part 10

Similar documents
Verbalizing Business Rules: Part 9

Microsoft s new database modeling tool: Part 5

Entity Relationship modeling from an ORM perspective: Part 2

Microsoft s new database modeling tool: Part 3

Ontological Modeling: Part 14

UML data models from an ORM perspective: Part 4

UML Data Models From An ORM Perspective: Part 3

Introduction to modeling. ER modelling

Logical Data Modeling: Part 12

Ontological Modeling: Part 7

Ontological Modeling: Part 11

Ontological Modeling: Part 2

Information Modeling and Relational Databases

Ontological Modeling: Part 8

Object-role modelling (ORM)

Ontological Modeling: Part 13

UML Data Models From An ORM (Object-Role Modeling) Perspective. Data Modeling at Conceptual Level

Uniqueness and Identity Rules in ORM

Schema Equivalence and Optimization

Schema Equivalence and Optimization

Introduction to modeling

Uniqueness and Identity Rules in ORM

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

ORM Modeling Tips and Common Mistakes

A Formal ORM-to -UML Mapping Algorithm

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

CSC Discrete Math I, Spring Sets

Logical Data Modeling: Part 7

IEEE LANGUAGE REFERENCE MANUAL Std P1076a /D3

Ontological Modeling: Part 15

JOURNAL OF OBJECT TECHNOLOGY

course: Database Systems (NDBI025) SS2017/18

Conceptual Design with ER Model

Logical Data Modeling: Part 1

Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts

Overview of Database Design Process. Data Modeling Using the Entity- Relationship (ER) Model. Two main activities:

Dr. Mustafa Jarrar. Knowledge Engineering (SCOM7348) (Chapter 4) University of Birzeit

Z Notation. June 21, 2018

Software Testing. 1. Testing is the process of demonstrating that errors are not present.

Copyright 2016 Ramez Elmasr and Shamkant B. Navathei

Entity Relationship Modeling

Data Modeling Using the Entity-Relationship (ER) Model

Chapter 2: Entity-Relationship Model

Chapter Outline. Note 1. Overview of Database Design Process Example Database Application (COMPANY) ER Model Concepts

Advance Database Management System

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

CSE 20 DISCRETE MATH. Fall

Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

DATA MODELS FOR SEMISTRUCTURED DATA

Chapter 6: Entity-Relationship Model

Chapter 6: Entity-Relationship Model

COMP combinational logic 1 Jan. 18, 2016

Mandatory Roles. Dr. Mustafa Jarrar. Knowledge Engineering (SCOM7348) (Chapter 5) University of Birzeit

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

Subset, Equality, and Exclusion Rules In ORM

Integrating SysML and OWL

Subset, Equality, and Exclusion Rules In ORM

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

Uncertain Data Models

Intro to Haskell Notes: Part 5

Evaluation of Predicate Calculus By Arve Meisingset, retired research scientist from Telenor Research Oslo Norway

14 October 2015 EECS-3421A Test #1 p. 1 of 14. EECS-3421A Test #1. Design

THE RELATIONAL DATA MODEL CHAPTER 3 (6/E) CHAPTER 5 (5/E)

Software Testing Fundamentals. Software Testing Techniques. Information Flow in Testing. Testing Objectives

This book is licensed under a Creative Commons Attribution 3.0 License

Joint Entity Resolution

II. Review/Expansion of Definitions - Ask class for definitions

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

Modeling Systems Using Design Patterns

Objectives of logical design... Transforming the ERD diagram into relations. Relational database components. Mapping a composite attribute

Chapter 2: Entity-Relationship Model. Entity Sets. Entity Sets customer and loan. Attributes. Relationship Sets. A database can be modeled as:

The Inverse of a Schema Mapping

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 4 Entity Relationship (ER) Modeling

Chapter 12. Entity-Relationship Modeling

Lecture 09. Spring 2018 Borough of Manhattan Community College

Modeling Databases Using UML

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

XV. The Entity-Relationship Model

2004 John Mylopoulos. The Entity-Relationship Model John Mylopoulos. The Entity-Relationship Model John Mylopoulos

A First Look at ML. Chapter Five Modern Programming Languages, 2nd ed. 1

High-Level Database Models. Spring 2011 Instructor: Hassan Khosravi

Chapter 7: Entity-Relationship Model

Data and Process Modelling

JOURNAL OF OBJECT TECHNOLOGY

Programming Logic and Design Sixth Edition

Contents Contents 1 Introduction Entity Types... 37

SMURF Language Reference Manual Serial MUsic Represented as Functions

Chapter 6: Entity-Relationship Model

Chapter 6. More Complex Conditionals. 6.1 Nested Conditionals

Entity Relationship Diagram (ERD): Basics

K Reference Card. Complete example

Introduction to Conceptual Data Modeling

Cardinality constraints,n:m notation

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Chapter 7: Entity-Relationship Model

The Entity-Relationship Model. The Entity-Relationship model. The ER model. The Entity-Relationship model. E-R Model Constructs. E-R Model Constructs

Entity-Relationship Models

Chapter 7: Entity-Relationship Model

Intro to DB CHAPTER 6

Transcription:

Verbalizing Business Rules: Part 10 Terry Halpin rthface University Business rules should be validated by business domain experts, and hence specified using concepts and languages easily understood by business people. This is the tenth in a series of articles on expressing business rules formally in a high-level, textual language. The first article [3] discussed criteria for a business rules language, and verbalization of simple uniqueness and mandatory constraints on binary associations. Article two [4] examined hyphen-binding, and verbalization of internal uniqueness constraints that span a whole association, or that apply to n-ary associations. Article three [5] covered verbalization of basic external uniqueness constraints. Article four [6] considered relational-style verbalization of external uniqueness constraints involving nesting or long join paths, as well as attribute-style verbalization of uniqueness constraints and simple mandatory constraints. Article five [7] discussed verbalization of mandatory constraints on roles of n-ary associations, and disjunctive mandatory constraints (also known as inclusive-or constraints) over sets of roles. Article six [8] considered verbalization of value constraints. Article seven [9] examined verbalization of subset constraints. Article eight [10] discussed verbalization of equality constraints. Article nine [11] covered verbalization of exclusion constraints. This tenth article deals with verbalization of internal frequency constraints on single roles. Verbalization of internal frequency constraints on single roles Consider the output report displayed in Table 1, which lists details about musical duets (i.e. pairs of musicians who perform together). The is an actual duet, but the other duet examples are invented for discussion purposes. In this business domain, musicians are identified simply by their name, so the Don Everly appearing in two duets is the same person. The third column indicates whether or not the duet is currently popular. Assume closed world semantics for popularity (i.e. for each duet we do know its popularity). The mark indicates missing information we know the name and popularity of the, but its members are not yet decided. For each duet in this business domain, our knowledge about its membership is either complete (we know both the members) or totally incomplete (we know neither member). In other words, we cannot know that one person is a member of a duet without knowing who the other duet member is. Table 1 Details about some musical duets. s Popular Don Everly, Phil Everly Don Everly, Donovan Leitch Figure 1 shows one way to schematize this report in Object-Role Modeling (ORM). A duet s popularity is modeled using the unary fact type. A duet s membership is modeled using the binary fact type includes (inverse reading: is a member of ). The arrow-tipped bar on the binary fact type denotes a spanning uniqueness constraint, indicating that the relationship is many-to-many (the same duet may include more than one musician, and the same musician may be a member of more than one duet), and that each membership fact is recorded just once (for each state of the business). The besides s role in the membership fact type indicates the frequency (number of occurrences) for that role, for each duet that plays that role. In ORM this is called a frequency constraint. Verbalizing this kind of constraint is the focus of this article. Figure 1 An ORM schema for Table 1. 1

Adding a frequency constraint of to s role in the membership predicate means that, for each state of the business domain, each duet that plays that role does so times. This constraint is perhaps best understood by populating the schema with the fact instances from the original report, as shown in Figure. In ORM, an object type s instances may be displayed in a table, and an elementary fact type s instances may be displayed in a table, with a column for each role. The table beneath the entity type lists three duets, which is equivalent to stating three existential facts: there is a that has Name ; there is a that has Name ; there its a that has Name. The table below the unary fact type lists two elementary facts: ;. Given the closed world assumption, the absence of in this table indicates the negated fact that is not popular. The table below the binary fact type lists four elementary facts: includes Don Everly ; includes Phil Everly ; includes Don Everly ; includes Donovan Leitch. Don Everly Phil Everly Don Everly Donovan Leitch Figure Populating the previous ORM schema with fact instances. tice that each entry in the fact column for s role in the membership fact type occurs there exactly twice, in accordance with the frequency constraint of on that role. This frequency constraint may be formally verbalized in relational style in either of the following ways: Each includes zero or two instances of. Each that includes a includes two instances of. If automated support for pluralization is available, more natural readings are obtained by replacing instances of by s in the above verbalizations. In this series of articles, we do not assume that such support is available. The first verbalization above is especially appropriate if the schema is presented in UML notation, as shown in Figure 3(b). In UML, the frequency constraint appears as a compound multiplicity constraint 0, (zero or two) next to the role played by. The {P} annotation is a non-standard extension to UML to express the preferred identifier (and hence its uniqueness constraint). UML does not directly support unary fact types, so popularity is modeled as the Boolean attribute ispopular. For binary associations, the relevant UML multiplicity constraint applies to the role opposite the role with the ORM frequency constraint. (a) (b) ispopular * 0, Figure 3 (a) The previous ORM schema, and (b) an equivalent UML class diagram. As an extension to UML, the class diagram could be populated by a fact table for the binary association, but UML s use of attributes makes it less convenient to populate the rest of the diagram (instead of single fact tables, UML uses multiple object diagrams for such purposes). So we do not bother displaying the fact population in UML.

A frequency constraint depicted in ORM by a positive integer corresponds to an all-or-nothing case of knowledge completeness. More commonly, frequency constraints simply set just an upper or lower bound on knowledge completeness. For example, suppose we modify our example so that for each duet we may know zero, one, or both of the musicians in the duet. An illustrative population is shown in Table. Table A duet s membership may be totally unknown, partially known, or fully known. s Popular Minnesota Twins Don Everly, Phil Everly Don Everly, Donovan Leitch Pat Barden ORM and UML schemas for this situation are shown in Figure 4. The ORM frequency constraint is now depicted by placing (less than or equal to ) next to the relevant role. If you populate this role with the sample membership data, you ll notice that each duet in the role s fact column appears there at most twice. In UML, the corresponding multiplicity constraint becomes 0... This frequency constraint may be verbalized thus: Each includes at most two instances of. (a) (b) ispopular * 0.. Figure 4 Modeling the structure of Table in (a) ORM and (b) UML. w let s modify our example, requiring that we know who all the members are of each duet. Table illustrates this situation, listing two musicians. Table 3 The membership of each duet must be fully known. s Popular Don Everly, Phil Everly Don Everly, Donovan Leitch Shania Triad, Suzi Quinquo Figure 5 models the structure of Table 3 in ORM and UML. From an ORM perspective, the frequency constraint of on s role in the membership fact type is unchanged from the original case for Table 1. However, a mandatory constraint has been added to that role (depicted by a solid dot on its role connector) to indicate that each instance of s population must play that role. For each state of the business, the term population denotes the set of known instances for that state (typically a subset of the type, which includes the instances from all possible states). In UML, the multiplicity constraint becomes (or..). (a) (b) ispopular * Figure 5 Modeling the structure of Table 3 in (a) ORM and (b) UML. 3

The frequency and mandatory constraints may be verbalized separately, for example: Each includes zero or two instances of. Each includes at least one. -- frequency constraint -- mandatory constraint Alternatively, the combination of both constraints may be verbalized more compactly thus: Each includes exactly two instances of. -- frequency and mandatory constraints combined An ORM frequency constraint may be considered to be a generalization of an ORM uniqueness constraint. Basically, a uniqueness constraint is a frequency constraint where the frequency equals one, but uniqueness is such an important case that it deserves a special treatment and notation of its own, as discussed in earlier articles. Like uniqueness constraints, frequency constraints in ORM are local to their predicate, in contrast to mandatory role constraints, which have global impact by implying subset constraints involving other roles played by the same object type. This separation of local and global aspects enhances ORM s orthogonality, minimizing the impact of changes to existing constraints. In contrast, UML collapses the two constraints into a single multiplicity constraint, thereby reducing orthogonality. As discussed in the next article, UML s multiplicity constraint is also incapable of specifying certain kinds of ORM frequency constraint when the fact type or association is n-ary (3 roles or more). Frequency constraints may also specify lower bounds on frequencies, using the notation n for at least n, or frequency ranges using the notation n..m for at least n and at most m. Figure 6 shows some examples in ORM, based on an example from [1, p. 81]. The exclamation mark in Panel! indicates the independence of this object type (we may know a given instance independently of knowing any other facts about it). The 4..7, 5, and respectively denote a frequency range constraint, a maximum frequency constraint, and a minimum frequency constraint. Expert is on / includes 4..7 Panel! reviews / is reviewed by Paper (Nr) 5 has Paper Title Figure 6 Examples of constraints on frequency minima, maxima, and ranges. A UML class diagram for the same example is shown in Figure 7. Role names have been added to clarify the semantics. As usual, UML uses multiplicity constraints to capture both mandatory and frequency constraints. This works fine for binary associations, but leads to some problems with n-ary associations, as discussed in the next article. Expert member 0, 4..7 1..* reviewer paperreviewed 0,..* 0..5 Panel Paper nr {P} title Figure 7 A UML class diagram corresponding to the ORM schema in Figure 6. 4

The three frequency constraints may be verbalized as follows: Each Panel that includes an Expert includes at least 4 and at most 7 instances of Expert. Each Expert reviews at most 5 instances of Paper. Each Paper that is reviewed by an Expert is reviewed by at least two instances of Expert. Alternative verbalizations exist (e.g. the third constraint may be recast as: Each Paper is reviewed by either zero instances, or at least two instances, of Expert.). Again, a pluralization engine would enable more natural verbalizations. Though very rare in practice, disjunctions of frequency specifications may be specified using a comma-delimited list (e.g. 3, 5..7, 10 for 3, or between 5 and 7 inclusive, or at least 10. Single role frequency constraints may also apply to n-ary predicates. As a ternary example, consider the report in Table 4. The first column lists the standard colors (unlike custom colors, standard colors are always given unique names). The standard colors, Green and Blue are primary in the sense that the other colors may be formed by combining the primary colors in different ratios. For example, Plum is composed of 153 parts of (out of maximum possible 55), 51 parts of Green, and 10 parts of Blue. In this table, the nulls indicate that the composition of the Autumn color is unknown. Table 4 Primary color composition for various standard colors. Standard Color Primary Color Color Intensity Plum Plum Plum Autumn Green Blue Green Blue 153 51 10 55 0 0 Figure 8 shows one way to model this structure in ORM. The frequency constraint of 3 on the first role of the ternary may be verbalized as shown below. Each StandardColor that includes a PrimaryColor in a ColorIntensity plays that role 3 times. As usual, the existential quantifier verbalized here as a may be reworded as some or at least one. Here plays that role is read in the normal way (i.e. in the least restrictive sense). In other words, for each of the three occurrences of any given StandardColor that plays the role, it is possible that the associated instances of PrimaryColor in the fact table may differ, and likewise for the associated instances of ColorIntensity. includes in... StandardColor! 3 PrimaryColor {, Green, Blue } ColorIntensity (Nr) {0..55} Figure 8 An ORM schema for Table 4. Although the above situation may be modeled with a ternary association in UML using classes for StandardColor, PrimaryColor, and ColorIntensity, it would be more usual in UML to treat ColorIntensity as an attribute of an association class representing an inclusion association between StandardColor and PrimaryColor. The next article will include examples of frequency constraints over associations that would typically be modeled as n-aries in UML. 5

That completes our coverage of internal frequency constraints on single roles, and their verbalization. The next article considers verbalization of more complex frequency constraints: multi-role frequency constraints (applying to sequences of two or more roles); and external frequency constraints (involving more than one predicate). References 1. Halpin, T. A. 001, Information Modeling and Relational Databases, Morgan Kaufmann, San Francisco.. Halpin, T. A. 00, Metaschemas for ER, ORM and UML Data Models: A Comparison, Journal of Database Management, vol. 13,., pp. 0-9, Idea Publishing Group, Hershey PA, USA. 3. Halpin, T. A. 003, Verbalizing Business Rules: Part 1, Business Rules Journal, Vol. 4,. 4 (April 003), URL: http://www.brcommunity.com/a003/b138.html. 4. Halpin, T. A. 003, Verbalizing Business Rules: Part, Business Rules Journal, Vol. 4,. 6 (June 003), URL: http://www.brcommunity.com/a003/b15.html. 5. Halpin, T. A. 003, Verbalizing Business Rules: Part 3, Business Rules Journal, Vol. 4,. 8 (August 003), URL: http://www.brcommunity.com/a003/b163.html. 6. Halpin, T. A. 003, Verbalizing Business Rules: Part 4, Business Rules Journal, Vol. 4,. 10 (October 003), URL: http://www.brcommunity.com/a003/b17.html. 7. Halpin, T. A. 004, Verbalizing Business Rules: Part 5, Business Rules Journal, Vol. 5,. (February 004), URL: http://www.brcommunity.com/a004/b179.html. 8. Halpin, T. A. 004, Verbalizing Business Rules: Part 6, Business Rules Journal, Vol. 5,. 4 (April 004), URL: http://www.brcommunity.com/a004/b183.html. 9. Halpin, T. A. 004, Verbalizing Business Rules: Part 7, Business Rules Journal, Vol. 5,. 7 (July, 004), URL: http://www.brcommunity.com/a004/b198.html. 10. Halpin, T. A. 004, Verbalizing Business Rules: Part 8, Business Rules Journal, Vol. 5,. 9 (September, 004), URL: http://www.brcommunity.com/a004/b05.html. 11. Halpin, T. A. 004, Verbalizing Business Rules: Part 9, Business Rules Journal, Vol. 5,. 1 (December, 004), URL: http://www.brcommunity.com/a004/b15.html. 1. Halpin, T., Evans, K., Hallock, P. & MacLean, B. 003, Database Modeling with Microsoft Visio for Enterprise Architects, Morgan Kaufmann, San Francisco. 13. Object Management Group 003, UML.0 Infrastructure, URL: http://www.omg.org/uml. 14. Object Management Group 003, UML.0 Object Constraint Language, URL: http://www.omg.org/uml. 6