Introduction to the Database functionality. Revision 1.3, 12 September by empolis knowledge management GmbH

Similar documents
Creating Pages with the CivicPlus System

Table of Contents. Tutorial The Basics Prerequisites Concepts... 1 Information... 1 Learning Objectives... 2

SharePoint AD Administration Tutorial for SharePoint 2007

Microsoft Access Database How to Import/Link Data

TIBCO iprocess Modeler Getting Started. Software Release 11.1 September 2009

MySQL for Windows. Tak Auyeung. September 7, 2003

PST for Outlook Admin Guide

Access Review. 4. Save the table by clicking the Save icon in the Quick Access Toolbar or by pulling

SQL Server Reporting Services (SSRS) is one of SQL Server 2008 s

Easy Windows Working with Disks, Folders, - and Files

Getting Started in CAMS Enterprise

Classroom Website Basics

GUARD1 PLUS Manual Version 2.8

1. Open Outlook by clicking on the Outlook icon. 2. Select Next in the following two boxes. 3. Type your name, , and password in the appropriate

Connecting SQL Data Sources to Excel Using Windward Studios Report Designer

Microsoft Windows SharePoint Services

Pan London Suspected Cancer Referral Forms for GPs A step-by-step guide to installing, using and ing the forms for GPs using EMIS Web

Copyright SolarWinds. All rights reserved worldwide. No part of this document may be reproduced by any means nor modified, decompiled,

SQL Server. Management Studio. Chapter 3. In This Chapter. Management Studio. c Introduction to SQL Server

You can also check the videos at the bottom of this page:

My Site. Introduction

OSR Administration 3.7 User Guide. Updated:

ICDL & OOo BASE. Module Five. Databases

Instructions for Using the Databases

GIS Virtual Workshop: Creating a Final Map

GUARD1 PLUS Documentation. Version TimeKeeping Systems, Inc. GUARD1 PLUS and THE PIPE are registered trademarks

[ Getting Started with Analyzer, Interactive Reports, and Dashboards ] ]

Basic Software Maintenance. Ham Station Ultra Software Package

Introduction to Windows

Essay & Assignment Preparation using MindGenius

WCCUSD Website. Centricity 2 Tutorial Guide. Site Manager Workspace.

How to Install, Configure and Use sftp (Windows Version)

Expense: Process Reports

MindGenius v6: A revision tool

Secure Web Appliance. Basic Usage Guide

A. Open Access and create a new database named Lab7_yourlastname.accdb.

Table Basics. The structure of an table

Fusion. CBR Fusion MLS Level 1 Core Functions. Class Handout

The following instructions cover how to edit an existing report in IBM Cognos Analytics.

BackupVault Desktop & Laptop Edition. USER MANUAL For Microsoft Windows

How to Make Graphs with Excel 2007

Overview. NETRON TECHNICAL NOTE February 2008 Summary

Many of your assessments will require submission as a word document (.doc).

These are the steps you will take to complete the tutorial. They are also the common processes through which you will create your own operations.

RenameMan User Guide. ExtraBit Software

PowerPoint 2002 Manual

SQream Dashboard Version SQream Technologies

Policy Commander Console Guide - Published February, 2012

Outlook - an Introduction to Version 2003 Table of Contents

Tutorial: Working with the Xilinx tools 14.4

DOING MORE WITH POWERPOINT: MICROSOFT OFFICE 2013

APPLICATION NOTE. Date Issued: Subject: Easy Database connection from POV. Revision: 1

4. Some computers may also be customised so that a program such as Word can be started using a keyboard command.

New Dropbox Users (don t have a Dropbox account set up with your Exeter account)

Introduction to IBM Data Studio, Part 1: Get started with IBM Data Studio, Version and Eclipse

Introduction to IBM Data Studio, Part 1: Get started with IBM Data Studio, Version and Eclipse

COMPUTER FOR BEGINNERS

Access Made Easy. Forms.

Some (semi-)advanced tips for LibreOffice

Getting Started Manual. SmartList To Go

For additional information, please consult the Read-Me and Help documentation or contact Electro-Voice or Dynacord technical support.

and 32 bit for 32 bit. If you don t pay attention to this, there will be unexpected behavior in the ISE software and thing may not work properly!

OneStop Reporting 4.5 OSR Administration User Guide

Allowing access to Outlook 2000 folders Version 1.00

MICROSOFT OneNote 2013

Using Microsoft Excel

1. In Outlook click on the blue (2013) or yellow (2010) File tab in the top left corner of the window. 2. Click on + Add Account

DecisionPoint For Excel

All textures produced with Texture Maker. Not Applicable. Beginner.

IBM DB Getting started with Data Studio Hands-On Lab. Information Management Cloud Computing Center of Competence.

SolidWorks Intro Part 1b

Function. Description

Chapter 11 Dealing With Data SPSS Tutorial

This Tutorial is for Word 2007 but 2003 instructions are included in [brackets] after of each step.

Setting up Outlook Express to access your boxes

2013 edition (version 1.1)

Content Author's Reference and Cookbook

Course Exercises for the Content Management System. Grazyna Whalley, Laurence Cornford June 2014 AP-CMS2.0. University of Sheffield

Creating a MOM 2005 Peformance Graph Report From a Template

TECHNICAL PAPER. HomeMeeting Messenger User Guide. January, A HomeMeeting Inc. Official Document

1 INTRODUCTION TO EASIK 2 TABLE OF CONTENTS

Lutheran High North Technology The Finder

A TUTORIAL ON WORD. Katie Gregory

How to set up an Amazon Work Profile for Windows 8

Electronic Portfolios in the Classroom

SmartBar for MS CRM 2013

Using Microsoft Excel

Digital Photography Moving Pictures From Camera To Computer and Organising Folders.

Enterprise Reporting -- APEX

TABLE OF CONTENTS. TECHNICAL SUPPORT APPENDIX Appendix A Formulas And Cell Links Appendix B Version 1.1 Formula Revisions...

Configuring Microsoft Outlook to Connect to Hosted Exchange Service

Essay & Assignment Preparation using MindGenius

EMC Documentum TaskSpace

Teacher Activity: page 1/9 Mathematical Expressions in Microsoft Word

Computers for Beginners

SITE DESIGN & ADVANCED WEB PART FEATURES...

Access Groups. Collect and Store. Text Currency Date/Time. Tables Fields Data Type. You Your Friend Your Parent. Unique information

Unit 8: Working with Actions

EXCEL BASICS: MICROSOFT OFFICE 2007

Office 2016 Excel Basics 25 Video/Class Project #37 Excel Basics 25: Power Query (Get & Transform Data) to Convert Bad Data into Proper Data Set

Transcription:

FEUZRUNV Introduction to the Database functionality Revision 1.3, 12 September 2001 2001 by empolis knowledge management GmbH

Copyright by empolis knowledge management GmbH. All rights reserved. This document is subject to change without notice Disclaimer: THIS DOCUMENT IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. The information contained in this document represents the current view of empolis knowledge management on the issues discussed as of the date of publication. INFORMATION PROVIDED IN THIS DOCUMENT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND FREEDOM FROM INFRINGEMENT. Thanks to Pól McNulty, Interactive Multimedia Systems, Clara House, Glenageary Park, Glenageary, Co. Dublin, Ireland, for the first version of this document! empolis knowledge management Sauerwiesen 2 D-67661 Kaiserslautern Tel: + 49 6301 606 400 Fax: + 49 6301 606 409 cbrworks@empolis.com support@empolis.com www.empolis.com

To make it easier to create CBR-systems, CBR-Works supports to import information from a database. This information can be used to quickly define concepts, types, their range and also cases. Setting up the connection to a database and importing elements of it will be the focus of this tutorial. 3

1 Introduction for database access with CBR-Works 1.1 Setting up the ODBC Data Source Communication between CBR-Works and the database takes place using a 32 bit ODBC driver. This is our first step. To create a ODBC (Open DataBase Connectivity), complete the following: 1. Open your 32 bit ODBC in the control panel. This opens the ODBC data source administrator. Introduction for database access with CBR-Works 4

2. Select the User DSN tab. 3. To add a new data source select the Add button. This prompts the Create New Data Source dialog box. Here you select the necessary application driver. For our tutorial purpose select the Microsoft Access driver. 4. Push the Finish button 5. In the ODBC Microsoft Access set-up box, you now have to enter a name for this data source (so you can refer to it in CBR-Works), also you have to inform the driver of the location of the database file. To name the data source insert Tutorial in the Data Source_Name field. To inform the driver of the location of the database (Tutorial.mdb), press the Select button. In the pop-up box, navigate through the folders until you locate the file. Select it and click the OK button. When you return Introduction for database access with CBR-Works 5

to the set-up box click OK and then exit the Administrator application. 6. You now have created the data source. 1.2 Establishing a connection As the data source has been created we now connect CBR-Works to the database. Follow these steps: 1. Create a new blank CBR application in CBR- Works. 2. Click on the File->Preferences menu and select Database options (File->Preferences- >Database). This prompts the Database Options dialog box. 3. If your database is password protected it is necessary to include your user name (if any) and the password in their respective fields. 4. In the Data Source field enter the name of the data source created before, i.e., Tutorial. 5. Press OK 6. If you return to the default screen in CBR- Works, then you have been connected to the database, otherwise repeat these steps as an error Introduction for database access with CBR-Works 6

occurred and the connection could not be established. 1.3 Importing types into the Model Since your connection has been established you have to choose the way importing the types for your CBR-Application. First you can follow the this section if you prefer to import all types before importing any concept or second you can import a type with each concept you have defined (see Importing Concepts on page 11). Now, you want to import the types, select the Type button in the top right hand corner of the screen. To start: 1. Select Create Types from Database in the Edit menu. 2. This prompts the Table Wizard. At first the wizard appears to be empty, but don t fret. First click on the drop-down Table field and select the table named Table1. 3. The Column field now shows the attribute Reference, the typename listing Reference (which you can change), and the Super Type which shows the assumed parent type: Symbol is not correct. Change it to String by clicking on the Super Type pull-down box. Then press OK. This will close the Type Wizard and create the type as specified. 4. You have to repeat steps 1 through 3 for each Type you need to import from the Database and Introduction for database access with CBR-Works 7

in this case we want to import all of them. There are a few things to pay attention to: Each time you enter the Type Wizard you will be presented with this blank page. Therefore each time you wish to import another type you must select Table, from the Table pulldown menu. By Default the Type wizard will automatically load the first column, in this case: reference. You must navigate down the Column pulldown menu to select the next type to import. On the second turn it will be Accommodation, on the third Bedrooms and so on. Introduction for database access with CBR-Works 8

Each time you select a type from the Column field, the typename & Supertype also changes Also ensure that the correct SuperType is specified. Consult Table One of the tutorial document to check. One problem with the Type wizard is that it does not allow you to specify types as symbol sets, because most databases do not support sets. We shall change these settings later. In the picture above you can see the range of places listed. Error my occur here if there are mistakes in your Database. Remember to consult Table One from the tutorial document, ensure that the correct ranges are entered. For example view figure 5. If you look at Table One you will see that the range specified for the being attribute Bedrooms was from 0 to 9. However, below you can see that the Type wizard misinterpreted these values as an enumeration rather than a interval. To correct this error click on the interval radio button. The range section then alters to allow you to specify the minimum (0) and maximum (9) range. The same kind of problem will occur when importing the rental_price Type. Use these principle to fix that problem too. Importing the location type will also bring problems. The SuperType is wrong for a start, as w wish it to be a TaxonomySymbol. Change it. Introduction for database access with CBR-Works 9

When you have selected the TaxonomySymbol the range interface changes. Here you should see the difference between the layout of the taxonomy in the tutorial section and the one Introduction for database access with CBR-Works 10

here. Here all the districts are Sons of the Root directory instead of being the Sons of the North_Side and the South_Side. This is because the database contains no information on the layout of the structure of the Taxonomy. Therefore you must define it. In order to do this you will have to consult Table 1 in the tutorial document. First, you must add the two categories these districts come under. I.E. North_Side or South_Side. To begin... Click on the Root directory Type in North_Side in the new value field Introduction for database access with CBR-Works 11

Click Add as Son Then ensure that North_Side (NS) is selected and type South_Side (SS) and press Add as Brother Now that you have defined the two categories of the root you must make all the districts son s of their respective categories (Either NS or SS). Consult the tutorial for this. To add, click on a district and drag it over it s parent (e.g. Click on Donnybrook and drag it over the South_Side ) and release your mouse button. This adds Donnybrook as a sub-range of South_Side. Repeat this for all districts. Click OK when you have finished. Now that you have imported this taxonomy you will have to recreate the similarity matrix. To do this, return to point 7 onwards in Creating a taxonomy symbol in your tutorial document. Problems will also occur when you are importing types that are to be symbol sets. The Type Wizard will not allow you to define these kind of types. Therefore in order to fix this we must follow these steps: Instead of defining these types as symbol sets we shall instead define them as symbols. (We ll convert them later). Now, the problem with this is that the type Wizard will not realise that two words in the same field are two separate ranges, rather it will believe that any combination is a range in Introduction for database access with CBR-Works 12

itself. Therefore anytime there is a repeat of a range or a list of them please delete them by clicking on them and clicking Remove. If you consult Table 1 you will be able to see the ranges that should be there. When you have imported everything from the Type Wizard, go to the Type window. Click on the field that you wish to convert from symbols to symbol set. Using the right-mouse button, click on the Type, and select convert type from the menu. The Type Wizard will re-appear and if you click on the SuperType pull-down menu, you will see the option to convert to Symbol set. Once Symbol set is chosen, click OK to convert. Repeat this for all the symbols that need to be converted. I 1.4 Importing Concepts You may prefer to firstly import the concepts of your CBR-application. Start by selecting the concepts button on the top right-hand corner. Then select 'Create concepts from Database' from the edit menu. This prompt the Concept wizard. The Concept Wizard consists of two parts. The left-hand screen shows the name of the database, i.e. Table1. If you click on it, the Concept Wizard loads all of the table attributes. To import : Introduction for database access with CBR-Works 13

Select the Primary Key of your table (a primary key is a column which values identify a row unique). The column Reference is such a key, the values enumerate the rows in form of Place<x>. Your concept wizard should look like that Click on 'Create Concept' and then click 'Done' to import the concept and it's attributes. Introduction for database access with CBR-Works 14

1.5 Defining your new concept as the Case After completing these steps you will be returned to the concept window. If you look to the left-side of the screen you will see that there is now two concepts. However, only one of these may be the Case concept. Currently it is the wrong one, the concept named "Case" (the Case Concept is denoted by a a blue tab sticking out of the folder); See this picture: Click on the concept 'Table1' Select 'Define as Case', note that the blue tag has moved from 'Case' to 'Table1'. This illustrates that 'Table1' is now the Case Concept. As the other concept is of no use, it should be deleted. Click on the concept 'Case' and select Introduction for database access with CBR-Works 15

Delete Concept from the Edit menu. This leaves you with only one concept, the Case Concept Table1. The next step is to link all the types you imported to the attributes you imported, if you just have defined them. You have already seen how to link attributes to their respective types in the 'LINKING TYPES TO THEIR RESPECTIVE ATTRIBUTES' in the Tutorial document. Follow those procedures to accomplish this task. Perhaps you have not imported the types, then there is another possibility to do this now. Select the DataBase-card and select an attribute e.g. Reference. Introduction for database access with CBR-Works 16

Note that the type of Reference is Symbol. You could change this by selecting the button Create from DB. It is the short way, to get the Type Wizard for a concept. First you have to rename the Typename e.g. ReferenceStringType that the OK-button will be enabled. Selecting OK, your ReferenceStringType will be defined. The other types you could define in the same way, you need not to change the view to the Type Hierarchy. In the tutorial essay you will recall, altering the weights of attributes and disabling some attributes during the search phase ( i.e. the Introduction for database access with CBR-Works 17

Goto attribute). If you look at the table listing the attributes, you will see that the weights are all one and all the discriminant check-boxes are ticked. This must be updated. Consulting the WEIGHTS, HIDDEN ATTRIBUTES, & INTERNET LINKS section in the tutorial essay update these changes. One final thing is to note that the 'Reference' Attribute stores the name of the case and is therefore not necessary in the search procedure. Therefore, you must deselect the discriminant check box. Now that you have imported all your types & attributes, it is time to save the application and the carry on to importing our cases. 1.6 Importing our cases You are now ready to begin the final stage. Start by clicking on the Case Base Icon in the top right hand corner of the screen... To start importing the cases select Add Cases from database. When the Case Wizard appears to ask you to select a primary key, this will act as the name of the case. As the reference attribute serves as this, you will use this as your primary key. Click OK to close. Note: Transferring cases to case buffer is done automatically. The End. Introduction for database access with CBR-Works 18

This completes the tutorial of how to create a CBR- Works application from a database. To start a server and view over the web, consult the Tutorial.doc. I hope this is helpful. If there are any questions or comments, please contact support@empolis.com. Introduction for database access with CBR-Works 19

2 Advanced database access with CBR-Works 2.1 Audience This document assumes that you are already familiar with CBR-Works. You need to be familiar with the basic database access mechanisms of CBR- Works described in the Database.doc document. You also need a basic understanding of relational databases. 2.2 What you will learn This introduction shows you how to import data from a set of tables. 2.3 Relations in relational databases and CBR-Works In a relational database data is stored in tables. Tables have a set of columns. Every column has a name as well as a data type. CBR-Works stores data in concepts. Concepts have a set of attributes. Every attribute has a name and a type. So CBR-Works maps concepts to tables and columns to attributes. So far there is no fundamental difference between the organisation of data in databases and CBR- Works. However, when it comes to structured data things get more complicated. Advanced database access with CBR-Works 20

CBR-Works allows attributes to have complex types. If you want to model for example that cars have engines, where an "Engine" is a concept you can do this with CBR-Works by creating an attribute with type "Engine" within the Concept "Car". In the relational model however the type of a column is always atomic (Integer, String, Boolean etc.). So you can not model the relation between a whole, and its complex parts directly. This relations must be established by a SQL-statement that "joins" data from several tables. The result of the "JOIN" operation is a virtual table sometimes called a "view". This view contains columns from the tables that are joined together. Let s have a closer look at the "Join" operation. To understand this operation we need to understand the idea of "primary-keys". The problem is how to refer from one row in table X to another in table Y. This can be done by row identifiers. Typically, there is a single column called the "primary-key" in every table which allows to identify the rows of the table. No two rows of a table have the same value in the primary-key column. In some exotic cases the primarykey consists of more than one column. In which case no two rows of a table have the same values in these columns. Let s look at our example. Advanced database access with CBR-Works 21

We have two tables: The Car table: (The column EngineID refers to the Engine table) ID Price Colour EngineID 1 15000 Red 3 2 15000 Blue 2 3 17000 Green 3 And the Engine table: (The column ID is the primary key) ID Cylinders Horsepower 1 4 55 2 4 75 3 6 110 The following SQL-Statement builds our desired view: 6(/(&7&DU3ULFH&DU&RORXU (QJLQH&\OLQGHUV(QJLQH+RUVHSRZHU )520&DU,11(5-2,1(QJLQH 21&DU(QJLQH,' (QJLQH,' The FROM-Clause defines that rows are joined if the EngineID from the Car Table matches the ID from the Engine table. Price Colour Cylinders Horsepower 15000 Blue 4 75 15000 Red 6 110 17000 Green 6 110 Advanced database access with CBR-Works 22

Hence, the resulting view consists of a plain set of columns. There is no information about the wholepart structure. However the import mechanism of CBR-Works allows you to import Cars from the two tables without losing that structure. 2.4 How to establish the relations In order to make the data import as simply as possible CBR-Works creates the necessary SELECT Statement for you. However it needs some informations. The first thing it needs to know are the primary keys of your tables. That is, why you have to specify primary keys, when you create a Concept from the Database with the Concept-Wizard. Advanced database access with CBR-Works 23

Let s go back to our example. The Concept-Wizard creates an attribute for every column of the related table. So initially our Car Concept looks like this. When we have created our two concepts from the tables, CBR-Works can not know that an engine is a part of a car. You have to add an attribute to the Car Concept with type of Engine in order to do so. Also, when you are not interested in some of the columns, you can simply remove the related attributes. In our example we are neither interested in the CarID, nor in the EngineID of the car, so we simply remove Advanced database access with CBR-Works 24

these attributes. Our Car Concept now looks like this: Advanced database access with CBR-Works 25

When we switch to the database pane we see four attributes : For attributes with atomic types the DataBase pane shows the mapping from attribute name to column name. You may edit that mapping. For complex attributes CBR-Works knows that it has to perform a JOIN in order to import the data correctly. It also knows the primary-keys that are needed for that join. In our case it knows that the attribute "engine" has the type "Engine" and "Engine" has the primarykey "ID". However it doesn t know which column of the concept "Car" refers to that primary key of "En- Advanced database access with CBR-Works 26

gine". When you click on the "engine" attribute the editor shows a field where you can enter the foreignkey of "Car" which refers to "Engine". In our case the foreign-key is EngineID. When the primary-key consists of more than one column you have to enter here which (foreign) columns of the "whole-concept" refer to the primary-columns of the "part-concept". The whole-part import feature is not limited in depth. A part can have many parts, which in turn have many parts and so on. Advanced database access with CBR-Works 27

2.5 Remarks People that are familiar with databases may note, that there are a lot more possibilities to join tables than described above. This is true. We leave more complex JOIN operations to the database system itself. Now you may ask: "Why did you implement this kind of JOIN operations then?". A similar question would be: "Why don t we join the data in the database and than import data from a single view?. This would be much simpler!". If you have read the above text carefully you already know the answer. If CBR-Works would leave all JOIN operations to the database system, it could import data only from a single table. That means the whole-part structure is lost. Since this structure is helpful for the understanding of the domain, CBR-Works provides that information for you. Advanced database access with CBR-Works 28