1 NORMA Lab. 6 Adding Sample Populations Controlling Error Message Display File: NORMA_Lab6.ppt. Author: T. Halpin. Last updated: 2009 June 12.

Slides:



Advertisements
Similar presentations
1 After completing this lesson, you will be able to: Create a database. Create a table using the Table Wizard. Create and modify a table in Design view.
Advertisements

Microsoft Excel. Click on “Start,” then “Microsoft Office Excel.”
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
Overview Lesson 1. Objectives Step-by-Step: Start Excel 1.Click the Start menu, and then click All Programs. 2.On the list of programs, click Microsoft.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Introduction to Excel 2007 Part 2: Bar Graphs and Histograms February 5, 2008.
Access - Project 1 l What Is a Database? –A Collection of Data –Organized in a manner to allow: »Access »Retrieval »Use of That Data.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 2 1 Microsoft Office Access 2003 Tutorial 2 – Creating And Maintaining A.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 11 1 Microsoft Office Excel 2003 Tutorial 11 – Importing Data Into Excel.
Creating And Maintaining A Database. 2 Learn the guidelines for designing databases When designing a database, first try to think of all the fields of.
ExitTOC Run & Route Directions 2003 Editing Run and Route Directions Edulog.nt v9.2 Use the buttons to navigate the training package First PagePreviousNextLast.
Creating FrontPage Tasks The task view allows you to add information about what you want to accomplish when creating your Web site.
Introduction to Excel 2007 Part 3: Bar Graphs and Histograms Psych 209.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
NORMA Lab. 1 Installing NORMA Entering a simple ORM schema Generating a Relational View Generating DDL code Generating other code 1 Note: Some of these.
© 2002 ComputerPREP, Inc. All rights reserved. Word 2000: Forms, Merges, and Macros.
Advanced Tables Lesson 9. Objectives Creating a Custom Table When a table template doesn’t suit your needs, you can create a custom table in Design view.
Chapter 3 Maintaining a Database
1 NORMA Lab. 4 File: NORMA_Lab4.ppt. Author: T. Halpin. Last updated: 2011 September 6 Revision: Adding Value Constraints, Set-comparison Constraints Adding.
1 NORMA Lab. 8 Further Aspects of Relational Mapping Revision (relational view, data type refinement) Controlling Table Names Controlling Column names.
Advanced Forms Lesson 10.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Working with a Database
PowerPoint. Basic Vocabulary Slide - Presentation - Slide layout – ► ► ► ► a single page in PowerPoint all the slides for a speech all the slides for.
European Computer Driving Licence Syllabus version 5.0 Module 4 – Spreadsheets Chapter 22 – Functions Pass ECDL5 for Office 2007 Module 4 Spreadsheets.
Microsoft PowerPoint Getting Started Guide Prepared for Towson University Dr. Jeff M. Kenton Amy Chase Martin 2007.
Creating a Web Site to Gather Data and Conduct Research.
Adding Content to the Agency Web Site - Part 2. Adding individual web pages for success stories Agency Web Site Adding Content 2, Slide 2Copyright © 2004,
Mail merge I: Use mail merge for mass mailings Perform a complete mail merge Now you’ll walk through the process of performing a mail merge by using the.
Microsoft Access 2000 Presentation 2 Creating Databases Part I (Creating Tables)
This tutorial teaches Microsoft Word basics. Although knowledge of how to navigate in a Windows environment is helpful, this tutorial was created for.
1 NORMA Lab. 2 Revision: Unary and Binary Fact Types Ternary Fact Types Inclusive-Or Constraints External Uniqueness Constraints Value Constraints Derived.
Office Management Tools II Ms Saima Gul.  When you create your tables, you should assign each table a primary key—one or more fields whose contents are.
XP New Perspectives on Microsoft Access 2002 Tutorial 21 Microsoft Access Tutorial 2 – Creating And Maintaining A Database.
Microsoft Office 2007 Access Chapter 6 Using Macros, Switchboards, PivotTables, and PivotCharts.
XP 1 Microsoft Access 2003 Introduction To Microsoft Access 2003.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 2 1 Microsoft Office Access 2003 Tutorial 2 – Creating And Maintaining A.
Dreamweaver MX. 2 Overview of Templates n Templates represent a web page design or _______ that will be common to multiple pages. n There are two situations.
1 NORMA Lab. 7 Generating Reports More Display Options File: NORMA_Lab6.ppt. Author: T. Halpin. Last updated: 2009 June 9.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Copyright 2002, Paradigm Publishing Inc. CHAPTER 1 BACKNEXTEND 1-1 LINKS TO OBJECTIVES Worksheet Elements Worksheet Elements Worksheet Area Elements Worksheet.
1 NORMA Lab. 5 Duplicating Object Type and Predicate Shapes Finding Displayed Shapes Using the Diagram Spy Using Multiple Windows Using the Context Window.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
Microsoft Access 2010 Chapter 10 Administering a Database System.
Using Advanced Options Lesson 14 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft Word 2013.
Fall 2003Sylnovie Merchant, Ph.D. ACCESS Tutorial Note: The purpose of this tutorial is to provide an introduction to some of the functions of ACCESS in.
1 NORMA Lab. 3 File NORMA_Lab3.ppt. Author: T. Halpin. Last updated 2009 May 25 Revision: Unary and Binary fact types Adding Pages Objectification Independent.
Page Designer Storyboard J. A. Fitzpatrick December 2004.
Overview Lesson 1 Miami Beach Senior High School Academy of Information Technology 1.
Work with Tables and Database Records Lesson 3. NAVIGATING AMONG RECORDS Access users who prefer using the keyboard to navigate records can press keys.
Modify Tables and FieldsModify Tables and Fields Lesson 4 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft.
Work with Tables and Database Records Lesson 3 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft Access.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
Open Office Writer Introduction AOSS _ Course material AOSS Master training workshop Singapore 2007.
Word and the Writing Process. To create a document 1.On the Start menu, point to Programs, and then click Microsoft Word. A new document opens in Normal.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Chapter 11 Collaboration Features for Workbooks Microsoft Excel 2013.
You’ll Make a spreadsheet which will be like a Mad Libs Game. These Are The Directions.
ACCESS PROJECT TWO. PROJECT ONE In project one you: -Created Tables -Created Forms -Created Reports In this project you will learn about queries. Databases.
Adobe ® Photoshop ® CS6 Chapter 1 Editing a Photo.
NORMA Lab. 3 Revision: Unary and Binary fact types Adding Pages
NORMA Lab. 4 Revision: Adding Value Constraints, Set-comparison Constraints Adding Frequency Constraints Adding Ring Constraints Adding Subtyping Adding.
NORMA Lab. 7 Generating Reports More Display Options
NORMA Lab. 2 Revision: Unary and Binary Fact Types Ternary Fact Types
NORMA Lab. 5 Duplicating Object Type and Predicate Shapes
NORMA Lab. 1 Installing Visual Studio Installing NORMA
Microsoft Office Access 2003
NORMA Lab. 6 Adding Sample Populations
Presentation transcript:

1 NORMA Lab. 6 Adding Sample Populations Controlling Error Message Display File: NORMA_Lab6.ppt. Author: T. Halpin. Last updated: 2009 June 12

2 In Visual Studio, open the ORM file you worked on in Lab 5. File > Recent Files > ORM_Lab5.orm Save this new version as ORM_Lab6.orm:

3 The ORM schema displays as the following 2 pages (select the relevant document window tab to see the relevant page): Cinema: Movie:

Adding Sample Populations The ORM Sample Population Editor allows you to enter sample data for both object types and fact types. Along with verbalizations, sample populations can help you validate models with domain experts. If the Sample Population Editor is not already available via a window tab, open it by right-clicking an empty space in the document window and choosing ORM Tool Windows > ORM Sample Population Editor. A window for this editor now appears. 4

5 On the Cinema page of the document window, select the State entity type. The Population Editor displays an entity type shape and its reference scheme “State(.code)”, with row 1 ready for you to enter a sample instance. Type “ME” (for the US state of Maine) on row 1, then press the Enter key to add it. NORMA accepts the entry and displays a new row (row 2) for you to add another state code. In a similar manner, enter “OR” (for Oregon) and “WA” (for Washington State). NORMA displays row 4 ready for another entry, but just leave it empty for now. You can display a type’s population at any time later by selecting the type and viewing the population editor.

6 State’s role in the fact type State has StateName now displays with red fill, indicating an error. Can you guess why? Right-click the role, and select Validation Errors to see the error message. Because this role is mandatory, each instance in the population of State must have a StateName. But we have violated this rule three times. To correct the error, we must supply a name for each state. You could enter the three relevant state names by populating the object type StateName (the population editor would then display a dashed shape indicating a value type). But this would not be enough, because we have to associate each state with a state name. So we need to populate the fact type itself, by populating each of its roles.

7 Select just the predicate shape (not the whole fact type). The Population Editor now displays a column for each of the two roles. You can adjust the width of the table and columns by dragging their boundary lines. Place the cursor in the State cell of row 1. Enter “ME” using any of these three ways: Type “ME” and press Enter. Select “ME” from the drop-down list and double-click it. Select “ME” from the drop-down list and press Enter. In the StateName cell on row 1, type “Maine” and press Enter to complete the first fact instance.

8 Similarly, enter the other two fact instances shown. Each of the three sample states now has a name. So the error state has been corrected, and the red error fill vanishes. As shown in the schema, each city is identified by combining its state with its city name. Select City. The Population Editor displays two columns, one for each part of a city’s identifier. Enter the state code and city name for the four cities shown.

9 The unary predicates played by City are now in an error state. Why? The inclusive-or constraint (circled dot) requires each city to be large or small. If you right-click one of the roles, and choose Validation Errors, you get a truncated error message: To see the full error message, open the Error List window at the bottom.

10 Select the inclusive-or constraint and open the Verbalization Browser. The constraint is verbalized, and the model errors are listed. In the verbalization, “or” means inclusive-or, which allows a city to be simultaneously small and large. This is not possible, so we should strengthen the inclusive-or to an exclusive-or. To do this, we could delete the inclusive-or and replace it with an exclusive-or constraint, but let’s instead just add an exclusion constraint and then collapse the two constraint shapes to one (see next slide).

11 Drag an exclusion constraint shape from the toolbox and apply it to the two roles (as explained in Lab 4). Then shift-select both roles, right-click, then from the context menu choose Combine as Exclusive Or Constraint. The exclusive-or constraint now displays as a single shape. Select the xor constraint and view its verbalization. This is what we want 1, so we will now populate the unary predicates, ensuring that each of our 4 cities is entered for exactly one (one and only one) of the “is large” and “is small” roles. 1 If you want more city sizes, add another unary (e.g. is medium size) under the xor constraint, or replace the unaries by a single binary City has CitySize(.name) { ‘small’, ‘large’, ‘medium’}

12 Select the “is large” predicate then select Portland, Maine (ME, Portland) from the drop-down list in the Sample Population Editor and press Enter (or double-click it) to add it to the role population. Similarly, add (OR, Portland) and (WA, Seattle) to the population of large cities. Open the Verbalization Browser to see the fact type verbalized together with its three fact instances.

13 Select the “is small” predicate then select Redmond, Washington State (WA, Redmond) from the drop-down list in the Sample Population Editor and press Enter (or double-click it) to add it to population of small cities. View its verbalization. Note that the error fill on the unary predicates has disappeared, since the exclusive-or constraint is now satisfied by the sample data.

14 Select the fact type “Cinema is in City”. In the Sample Population Editor, click the “+” symbol in the City field to expand its inline identifier to see shapes for both component object types. Hovering the cursor over a shape displays its meaning. Enter “GA” (for Georgia) in the State field. Enter Atlanta” in the Cityname field. Notice the red fill indicating that four predicates are now in an error state, because you just entered a city and a state without satisfying their mandatory role constraints, and you entered just part of a “Cinema is in City” fact (the entry for Cinema is missing).

15 Enter “Plaza Theatre” in the Cinema field to complete the sample fact instance. This removes the red error fill on Cinema’s role in that fact type (since its mandatory role constraint is now satisfied) but a new error is displayed on Cinema’s role in the NrTheaters fact type, because its mandatory role constraint is violated. We will now fix those four population errors.

16 Double-click State’s role in State has StateName. NORMA automatically inserts “GA” in the State column, and places the cursor in the StateName column ready for you to enter a state name. Type “Georgia” and press the Enter key. The error fill on the StateName fact type disappears, since its mandatory role constraint is no longer violated. Similarly, double-click Cinema’s role in the NrTheaters fact type, and enter “2” in the NrTheaters field to complete the fact instance, thus removing another error.

17 The “is large” and “is small” roles still have red fill, because the inclusive-or part of the exclusive-or constraint is violated (The city Atlanta, Georgia is not classified as large or small). Atlanta, Georgia is a large city, so we need to add it to the population of City is large. Double-click the “is large” role to automatically populate it with the city whose absence is causing the error (in this case, Atlanta, Georgia) 1. The error is now fixed. 1 In general, double-clicking an error display performs the same action as selecting an error that supports automatic activation from the dropdown list. You can also activate errors using hyperlinks in the Verbalization Browser, or by double-clicking in the Error List. Pretty cool, eh?

18 Now, select the Movie tab on the Document Window to display the Movie page. Then select MovieTour. All compositely identified entity types, whether co-referenced (e.g. City) or objectified (e.g. MovieTour) may be populated in a similar way. With MovieTour selected, the Sample Population Editor displays two columns, one for each component. If you wish, you could populate it in similar way to how we populated City.

19 To see how to populate subtypes, let’s add a subtype to the model. Open a new ORM diagram page by right-clicking the Movie tab then selecting New Page > ORM Diagram. Drag a copy of State from the Model Browser to this new page. Open the Fact Editor type “NorthWestState” and press Ctrl-Enter to add it as an entity type to the model, then move the new shape below the State shape as shown.

20 Select the Subtype Connector from the Toolbox, then click NorthWestState then click State to add the subtyping relationship shown. Select NorthWestState and open the Sample Population Editor. It now displays a subtyping shape to indicate a subtype is to be populated. Click the down-arrow to open the drop-down list, and you will see the supertype (State) instances listed. Double-click “OR” to enter Oregon as a northwestern state. Similarly, add Washington State (WA) to the population of northwestern states.

21 Do not add Maine (ME) or Georgia (GA) to this population since they are respectively northeastern and southeastern states. With NorthWestState selected, open the Verbalization Browser to see the verbalization of the subtyping connection as well as the instance data. In this case, NorthWestState is an asserted subtype (its instances are simply asserted rather than derived) which is obvious from the lack of an “*” on the Subtype. If desired, you could add a fact type such as State is in Region(.code) and provide a derivation rule (e.g. *Each NorthWestState is a State that is in Region ‘NW’.) to make the subtype derived instead of asserted.

22 Deleting entries in the Population Editor is straightforward. Let’s practice that now. Select State. Add “UT” (for Utah) to its population. Place the cursor in the row number column beside the “UT” entry. Press the Delete key, to delete the entry. Alternatively, select the cell with the entry and press Delete. As a final note on the Population Editor, function key F2 may be used to activate in-place editing (it works in the Model Browser as well). Using F2 (plus Alt-Down to open the dropdowns) allows full keyboard navigation without touching the mouse.

23 Controlling Error Message Display Although sample data are useful for validating models, it can be annoying to see the model in an error state simply because you haven’t supplied sufficient data to satisfy all the constraints. Similarly, you might know the model is in an incomplete state (e.g. you just introduced an entity type with no reference scheme, but you plan to add that later) and don’t want NORMA to display this as an error state. By default, NORMA displays all errors. However, it allows you to toggle on/off the display of various categories of errors.

24 Select the State shape on the new page, open the Fact Editor and complete the fact type entry “State(.code) is in Region” without giving Region a reference scheme. Press Ctrl-Enter to commit. The predicate displays with red lines around it and Region displays with red fill, indicating errors. You may view the two error messages in the Error List window.

25 Right-click the left role, and use its context menu to add uniqueness and mandatory role constraints to it, as shown. This removes the first error (missing uniqueness constraint) but added three more errors because the population includes three states that do not play the mandatory role.

26 To control error display on the diagram, click any empty space on the Document Window, then in the Properties Window click the ellipsis “…” button at the right of the ErrorDisplay field. The Error Filter dialog is now displayed. To turn off display of all reference scheme errors, uncheck the check box for Reference Scheme Errors and press OK. Region now displays without red error fill, and the missing reference scheme error message is removed from the Error List display.

27 The ErrorDisplay field in the Properties Window now indicates “(Filtered)” to indicate not all errors are displayed. Press the “…” button again, uncheck Sample Population Errors and press OK to suppress display of population errors. The predicate now displays with no red error marks, and the Error List displays as empty.

28 You can gain finer control of error display by expanding the top level error categories (click the “+” in front of the error category) and unchecking just some of the subcategories. e.g. the subcategories for reference scheme and sample population errors are as shown.

29 Turn all error display on again by checking the relevant options and pressing OK. The red fill reappears and the error messages reappear in the Error List. As this was just for practice, delete “is in Region” by selecting it, pressing Delete, and answering Yes to the two delete prompts. Now save your work and exit to complete Lab 6.