1. Trang chủ
  2. » Công Nghệ Thông Tin

Advanced Database Technology and Design phần 2 doc

56 340 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 56
Dung lượng 448,6 KB

Nội dung

description (e.g., in a DB) of the entities and relationships in a domain, but this description is at a very low level in order to be efficiently processable by the processors used. The information base is a description close to the con- ceptual schema and is not meant to be an internal description. Unfortunately, the term conceptual model is not always used with the same meaning in the literature. Besides the meaning we have given to it, other meanings we may find are these: • Conceptual model = conceptual schema • Conceptual model = conceptual schema + information base We have chosen to use three distinct terms (conceptual model, conceptual schema, information base) to distinguish three different concepts. The same distinction is well established in the DB field, where we distinguish clearly among data model (for instance, relational data model), DB schema (in some data models), and DB (instance of a schema). 1 2.2.3 Conceptual Schema of the Behavior Most IS domains change through time, at two levels: conceptual schema and state. Changes at the conceptual schema level are less frequent than those at the state level, and their origin is due to changes in users interests: For what- ever reason, users lose interest in the representation of some entities and rela- tionships or they want other entities and relationships to be represented in the IS. The most frequent changes (and the only ones we consider here) occur at the state level. It is easily observable that the state of most IS domains changes through time. In consequence, if the information base is a truthful representation of that state, then the facts of the information base will need to change through time. An Introduction to Conceptual Modeling of Information Systems 39 1. The term information base may be confused with the term knowledge base, used in the de- ductive DBs field, as well as in artificial intelligence. A knowledge base is a set of repre- sentations of knowledge about a domain [11]. Normally, the language used to represent this knowledge is the language of first-order logic. The knowledge may be simple facts, which are represented as atomic formulas, or general knowledge about a domain, which is represented as complex formulas. In conceptual modeling, the general knowledge about a domain is represented in the conceptual schema, while simple facts are repre- sented in the information base. Therefore, the correspondence is knowledge base = con- ceptual schema + information base. We say that there is a change in the state of the domain at time t if the entities or relationships that exist at t are different from those existing at the previous time. In other words, a state change is a change in the population or one or more entity or relationship types between two states: the new state (corresponding to t), and the old state (corresponding to t − 1). Any change in the population of an entity (relationship) type can always be decomposed into a set of one or more elementary changes of the following types: • Insertion of entity (relationship). This change happens when there is an entity (relationship) in the new state that did not exist in the old state. • Deletion of entity (relationship). This change happens when there was an entity (relationship) in the old state that does not exist in the new state. The causes of the changes are the events [3, 12]. A domain does not change its state if no event happens. An event is any circumstance that happens at a given instant and whose effect is a change in the domain state. Normally, these circumstances are actions (or decisions) performed by human beings that act on a domain (e.g., hiring an employee or making a move in a chess game), but they also may be the result of physical processes (e.g., dropping some amount of liquid into a tank or the rising of the sun). It is usually assumed that events are instantaneous, that is, they do not have duration. It is also assumed that an event causes a transition in the domain, from an old state to a new one, without any noticeable intermediate state. In many cases, those assumptions do not pose any particular problems. For example, the process of hiring a new employee takes some time, but it is likely that we are interested only in the outcome of that process: From that moment on, the person will be an employee, which he or she was not at the previous time. In some cases, however, events have duration. To handle those cases in conceptual models that require instantaneous events, it may be necessary to refine the conceptual schema of the domain or the event itself. For example, assume the domain includes the relationship type Is at between persons and places. In principle, it seems natural to consider that persons are at some place at any moment. Let us consider now the event corresponding to the move of a person from an origin to a target. If we assume that the event is instantaneous, then the person will continue to be at some place at any 40 Advanced Database Technology and Design moment. But if we assume that a move is not instantaneous, then there will be a temporal interval during which we will not know where a person is. If we want to take into account that fact, we will need to do the following: • Refine the conceptual schema of the domain: now there will be some times when we do not know where a person is. • Transform the move event into two events: the beginning and the end of a move. • Consider that the effect of the beginning of a move is that we enter a state in which we do not know where the moving person is. • Consider that the effect of the end of a move is that there is a rela- tionship between the moving person and the target place. For the designer, it is important to distinguish between external and gener- ated events. An event is external if it occurs independently of the IS. If the IS is computer-based, external events happen even if the system is out of service. Such events are called external because they happen outside the control of the system. The system will need to be notified of the events (to update its infor- mation base), but the system itself has not produced the events. Many events are external, for example, the hiring of an employee or the sunrise. A system may know external events either by direct observation or by users communication: • In direct observation, the system has some mechanism that allows it to detect the occurrence of events. For example, a system may have a sensor that detects the arrival of a car in a toll station. • In users communication, the users tell the system of the events when they occur. For example, when a company changes the price of a product, the system is also notified of the change. As mentioned in Section 2.1, an IS may also have an active function. In the active function, the users may delegate to the system the generation of some events that change the state of the domain when some conditions hold. A generated event is an event induced directly by the IS. Without the partici- pation of the system, the event would not be generated, and, therefore, the domain would not change. The system may generate an event as a response to an explicit request from users, when it detects that the state of the domain An Introduction to Conceptual Modeling of Information Systems 41 satisfies some condition, or because it considers the event necessary to achieve an objective defined by the users. Example 2.4 Assume an IS that controls an elevator. At each floor there is a button that users can press to request the elevator. Pressing one of the buttons is an exter- nal event. The system responds immediately by turning on the light associ- ated with the button (to inform users that the system is aware of their request). Turning on and off light buttons are generated events. Taking into account the current position of the elevator, as well as the pending requests, the system issues several commands to start or stop the motor. Those com- mands are also generated events. Events, either external or generated, are also instances of concepts. An event type is a concept whose instances are events. Events may have relation- ships with other entities. In particular, all events have a relationship with an entity that is a time instant, which corresponds to the time when the event happens. Figure 2.5 shows an example of the event type change of residence. Events of this type are related with a person (who changes), a town (new resi- dence), and a date (occurrence time). The set of event types that exist in a domain is part of the conceptual schema of events. The description, in some language, of that schema, as well as other elements described next, is called the conceptual schema of the behavior. To be able to update the information base, the IS must know not only the events that have happened but also their effect on the information base. 42 Advanced Database Technology and Design Change of residence Person Who Date When Town Event Where Figure 2.5 Event type and instance. The definition of that effect, in some language, is also part of the conceptual schema of the behavior. In conceptual modeling, there are several distinct ways to define the effect of events. The most usual way consists of defining, for each event type, an effect function that gives the new state for any old state and any instance of the event type. For example, the effect function corresponding to the event type change of residence, shown in Figure 2.5, might be (informally) If an event of type change of residence, of person p and town c, occurs on date d, then in the new state, corresponding to date d, person p will not live any longer where she lived before, and she will be living in town c. In the example, the effect of the event is quite limited, and the effect function is simple. In practice, however, it is not so easy to define the effect, because there are many event types, and some of them have a complex effect function. For generated events, the conceptual schema of the behavior includes the definition of the generating conditions, that is, when the events must be generated. Example 2.5 Assume an IS that monitors the level of water in a tank. The system has a sensor that detects the level of water at any time. It is expected that the sys- tem will keep the input valve open when the water level is below a desired minimum and closed when the level is above a desired maximum. Generated event types are the opening and the closing of the valve. The generation con- dition of the former could be when the current level is below the minimum and the valve is not open already and that of the latter, when the current level is above the maximum and the valve is not closed. 2.2.4 Integrity Constraints The information base is a representation of the state of the domain. An IS obtains and updates the information base from messages received through the input interface or by direct observation of the domain. In a perfect world, the information base would be an exact representa- tion of the domain. Input messages would always be correct, and the system would receive all relevant messages. Furthermore, the direct observation of the domain would always be faithful. In a perfect world, the representation would always be correct (or valid) and complete. An Introduction to Conceptual Modeling of Information Systems 43 TEAMFLY Team-Fly ® Unfortunately, in the real world it is likely that some received messages are incorrect, in the sense that they communicate something that is not true. Also, the direct observation of the domain may be distorted. In such cases, some of the facts in the information base may not be valid. It is also likely that the system does not receive all relevant messages; then the information base may not be complete. Validity and completeness are the two components of the integrity of an information base [13]. We say that an information base has integrity when all its facts are valid and it contains all relevant facts. Integrity is an important property of an information base. Lack of integrity normally has negative consequences, which in some cases may be serious. In most systems, total integrity can be achieved only by human inter- vention. In many cases, it is necessary to check the facts in the information base against the domain. For example, many retail stores need to check peri- odically that the products they have on shelves correspond to their records in the IS. It is not difficult to see that in some cases the cost of integrity is high and hardly avoidable. However, it is possible to build mechanisms in the IS that auto- matically guarantee some level of integrity. We can define conditions on the information base such that, if satisfied, we can have some level of confidence on its integrity. These conditions, called integrity constraints, are defined in the conceptual schema. An integrity constraint is a condition that might not be satisfied under some circumstances, but it is understood that the IS will include mechanisms to guarantee its satisfaction at any time. Example 2.6 Assume that a conceptual schema has a relationship type Assigned to, involv- ing entity types Employee and Project. Suppose that in the domain all employ- ees are always assigned to one or more projects. An integrity constraint might be all employees are assigned to some project. Once defined in the concep- tual schema, we can assume that all states of the information base will con- tain for each known employee at least one relationship with a project. The constraint, however, does not guarantee total integrity (e.g., the information base could have wrong assignments), but its satisfaction is a necessary condition. We say that an information base is consistent if it satisfies all defined integrity constraints. We also say that a constraint is violated when the infor- mation base does not satisfy it. When a constraint is violated, the system must produce some response to maintain consistency. The most frequent case is when a violation is caused by the arrival of some erroneous message, 44 Advanced Database Technology and Design and the response is usually the rejection of the message, asking for its correction. Most integrity constraints refer to facts of the information base, and then they are part of the conceptual schema of the state. Some constraints, however, refer to events; then they are part of the conceptual schema of the behavior. An example of the latter, which refers to events of type Birth, could be a person cannot be parent of himself. 2.2.5 Derivation Rules By means of the informative function, an IS provides information about the state of the domain to users, either when they request it or under predefined circumstances. If an IS does not have any inference capability, it can provide only information collected from the environment. In some cases, that may be all that is required, but in most cases users expect that systems have some capa- bility to infer new facts from the ones they know. A simple example is total- ing. If we give to the system a sequence of numbers, we normally assume the system will at least be able to compute their total. Most ISs have some inference capability, which requires two main components: derivation rules and an inference mechanism. Derivation rules are defined in the conceptual schema. The inference mechanism uses deriva- tion rules to infer new information. How the inference mechanism works may vary from one IS to another, and it is considered to be part of the inter- nal structure of the system; therefore, it is not specified in the conceptual schema. A derivation rule is an expression that defines how new facts may be inferred from others. The concrete form of this expression depends on the conceptual modeling language used. Often, the expressions are formulas in a logic style, but nothing prevents the use of conventional algorithms. For example, assume we want to define the derivation rule corresponding to the concept grandparent from the concept parent. An expression in logic style would be a person gp is grandparent of person gc if gp is a parent of a person p and p is a parent of gc. An equivalent algorithmic expression that gets the four grandparents of person gc could be: 1. Get the two parents p1 and p2 of gc. 2. Get the two parents gp1 and gp2 of p1. An Introduction to Conceptual Modeling of Information Systems 45 3. Get the two parents gp3 and gp4 of p2. 4. The grandparents of gc are gp1, gp2, gp3, and gp4. Derivation rules may be specific of a given domain (e.g., a bank), applicable to all domains of a certain class (e.g., banking), or domain independent (e.g., statistical concepts). The conceptual schema must include all derivation rules that can be used in a particular system, but we should explicitly define only those rules that are specific to our domain. The other derivation rules could be shared by all conceptual schemas for domains of the same class or by all conceptual schemas. In practice, most derivation rules infer new facts of the information base, and then the rules are included as part of the conceptual schema of the state. However, nothing prevents the inference of events from other events, and then the corresponding derivation rules are part of the conceptual schema of the behavior. For example, a derivation rule referring to events of type Travel could define Long travels as those travels such that the distance traveled is greater than 1000 km. 2.3 Abstract Architecture of an IS Section 2.2 presented conceptual schemas. This section shows the essential role these schemas play in the architecture of ISs. By architecture, we mean the main components and their relationships. In principle, there are many possible architectures, and choosing the most convenient for a particular IS depends on many factors, including the preferred architectural style and the hardware and software platform on top of which it must work. However, we do not need to take such diversity into account here. For our purposes, it will suffice to consider the ANSI/SPARC abstract architecture proposed in the ISO report [10] (Figure 2.6). To illustrate this architecture and the role played by conceptual sche- mas in it, we will use the example of a chess-playing system that can play with persons or with other systems. The conventional representation of the state of a chess game is a draw- ing like the one shown in Figure 2.7. However, not everybody uses exactly the same representation; different icons can be used to denote the same piece. Some users may prefer other graphical representations (e.g., the three- dimensional view), and in some cases text-based representations may be preferred (e.g., in machine-machine communication). 46 Advanced Database Technology and Design An external schema is a form of representation of the state of the domain used in the domain, and an external DB is the representation of the state of the domain in that external schema. Figure 2.7 can be considered an external DB. External DBs are virtual, in the sense that they do not have a physical and persistent existence within the system. Besides a form of representation, external schemas also include aspects of manipulation of this form, like the language used to ask queries or to An Introduction to Conceptual Modeling of Information Systems 47 External schema Internal schema Conceptual schema Message External processor Internal processor Information processor Information base External database Internal database Figure 2.6 ANSI/SPARC architecture. Figure 2.7 A representation of the state of a chess game. communicate external events. In the example, we again find some diversity. There are several textual (official) and graphical ways to represent a move (e.g., as a string, like the string D71, or by dragging a piece to the desired place). The result is that in general there are several external schemas for a given domain and it is not possible to single out one that satisfies all possible users and all possible uses. Therefore, the system must deal with several exter- nal schemas. To do that, the system needs to know the meaning of the repre- sentations used and the meaning of the allowed manipulations. Figure 2.8 shows a simplified conceptual schema of the example. In the figure, entity types are represented by rectangles and relationship types by lines connecting the involved entity types. The name of the relationship type is placed near the line, with a small filled triangle that shows the way to read the name. Each piece is of some type (king, queen, bishop, etc.), has a color (black or white), and is located at some square. Squares also have a color. For clarity, we will call board square (or just square) to a square that is part of the board, and representation square to a square drawn in the representation of the board (external schema). A board square is located at a row and a column, 48 Advanced Database Technology and Design IsLocatedAt IsLocatedAt IsOf Has Has Contains Column HasNumber HasNumber IsLocatedAt Row Integer Color Piece PieceType Square Board Figure 2.8 Conceptual schema of the chess-playing example. [...]... invocation Let’s consider the policies outlined in Section 3.3 .2 and shown in Table 3 .2 The circumstances to which a policy may respond can be diverse, namely, r1 e1 m Employee Figure 3.4 An (ER )2 schema Team-Fly® e2 m 74 Advanced Database Technology and Design 1 A condition on the DB state (e.g., the number of students is above 20 ); 2 The invocation of a structural operation (e.g., the assignment... work needs to be done to be fully practical 56 Advanced Database Technology and Design References [1] Langefors, B., “Information Systems,” Proc IFIP ‘74, North Holland, 1974, pp 937–945 [2] Checkland, P., Systems Thinking, Systems Practice, New York: Wiley, 1981 [3] Boman, M., et al., Conceptual Modelling, New York: Prentice-Hall, 1997 [4] Wand, Y., and R Weber, “An Ontological Analysis of Some Fundamental... Figure 3 .2 Tables for the example Team-Fly® 64 Advanced Database Technology and Design by many attendees, the relationship between attendees and courses is represented using a distinct table, namely, enrollment, which has grade and level as its attributes Moreover, the distribution table supports the relationship between courses and the rooms where they are taught Finally, an employee has a boss and teaches... Conceptual schemas are the common base for external and internal schemas, as well as for their processors Therefore, it is clear that it is not possible to design the architecture of an IS without the conceptual schema Conceptual modeling must precede system design 52 Advanced Database Technology and Design It is important to realize that it is impossible to design a system without knowing its conceptual... move is valid and, if so, to update the state of the game To perform those tasks, the information processor needs to access and manipulate the state of the domain It cannot use an external representation because, in general, they may be partial, and, on the other hand, they include aspects that do not have any relationship with the nature of the domain 50 Advanced Database Technology and Design For example,... Systems 57 Selected Bibliography Batini, C., S Ceri, and S B Navathe, Conceptual Database Design: An Entity-Relationship Approach, Redwood City, CA: Benjamin/Cummings, 19 92 This book is devoted to conceptual modeling but focuses on DBs Nijssen, G M., and T A Halpin, Conceptual Schema and Relational Database Design, New York: Prentice-Hall, 1989 Chapter 2 of this book (along with Chapter 4 of [14]) is an... Greenspan, and J Mylopoulos, “Knowledge Representation as the Basis for Requirements Specifications,” IEEE Computer, Apr 1985, pp 82 91 This article emphasizes principles with reference to languages Loucopoulos, P., “Conceptual Modeling,” in Conceptual Modeling, Databases, and CASE: An Integrated View of Information Systems Development, P Loucopoulos and R Zicari (eds.), New York: Wiley, 19 92, pp 1 26 , and. .. Information Systems, Vol 23 , No 3/4, 1998, pp 127 –155 This article gives a modern view of the field This Page Intentionally Left Blank Part II: Advanced Technologies This Page Intentionally Left Blank 3 Active Databases Oscar Díaz and Norman Paton 3.1 Introduction DBMSs are at the heart of current IS technology They provide reliable, efficient, and effective mechanisms for storing and managing large volumes... Objects, Functions, and States, Englewood Cliffs, NJ: Prentice-Hall, 1993 [17] Lindland, O I., G Sindre, and A Solvberg, “Understanding Quality in Conceptual Modeling,” IEEE Software, Mar 1994, pp 42 49 [18] Moody, D L., “Metrics for Evaluating the Quality of Entity Relationship Models,” Proc 17th Intl Conf on Conceptual Modeling, Singapore, Nov 1998, LNCS 1507, Springer, pp 21 1 22 5 An Introduction... Principles, Methods, and Applications,” Knowledge Engineering Review, Vol 11, No 2, 1996, pp 93–136 [9] Mylopoulos, J., “Information Modeling in the Time of the Revolution,” Information Systems, Vol 23 , No 3/4, 1998, pp 127 –155 [10] ISO/TC97/SC5/WG3, Concepts and Terminology for the Conceptual Schema and the Information Base, J J Van Griethuysen (ed.), Mar 19 82 [11] Russell, S., and P Norvig, Artificial . 1998, LNCS 1507, Springer, pp. 21 1 22 5. 56 Advanced Database Technology and Design Selected Bibliography Batini, C., S. Ceri, and S. B. Navathe, Conceptual Database Design: An Entity-Relationship. complete and correct conceptual schema, A = C. 54 Advanced Database Technology and Design A B C Required knowledge Conceptual schema Figure 2. 9 Completeness and correctness. Correctness and completeness. their effect on the information base. 42 Advanced Database Technology and Design Change of residence Person Who Date When Town Event Where Figure 2. 5 Event type and instance. The definition of that

Ngày đăng: 08/08/2014, 18:21

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN