From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003...

15
From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire

Transcript of From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003...

Page 1: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

From model to service: relational databases and SCONE

Presentation to CDLR staff on Wed 5 Feb 2003

By Gordon Dunsire

Page 2: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Overview

• From theory to practice

• A bit about collection level description

• A bit about relational database design

• A bit about entity-relationship models

• Not necessarily in that order!

• But using SCONE as a case-study

Page 3: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Implementation stages

• Entity-relationship model

• Attribute sets

• Entities & relationships map to relational database tables

• Attributes map to fields (columns) in table

• Tables related using standard rdbms structures

• Service data retrieved using SQL

Page 4: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Entity-Relationship model

• Defines entities (things) and relationships between them

• Entity-Relationship-Entity syntax

• Defines attributes (pieces of information) common to each entity and relationship

• SCONE is based on a model developed by Michael Heaney for UKOLN

Page 5: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Heaney’s Analytic Model

Page 6: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Attribute sets

• Entity: Location (physical repository)– Place; Identifier

• Entity: Agent:Collector (person)– Name; Date; Biography

• Relationship: Collects– Legal status; Accrual policy

• Relationship: Administers– Access conditions

Page 7: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Implementation in RDBMS

• Map entities and relationships to tables– Entity Location (physical repository) maps to

table LocationPhys– Relationship Collects maps to table Collects

• Map attribute sets to fields in each table– Decomposition to finer detail data elements

where appropriate• E.g. Location – place decomposes to building

name, address, town, region, postcode, etc.

Page 8: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Example: LocationPhys

• Table fields from attributes– Address1– Address2– Address3– Postcode

• Plus fields from “experience tells me” attributes– Notes

Page 9: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Example: LocationPhys

• Plus fields for administrative metadata– LastDate

• Plus fields for RDBMS structure– LocationPhysID (primary key)– TownID (secondary, foreign key)

• Maps attribute Town to a lookup table (Town treated as an entity) matched by keys

Page 10: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Relational databases

LocationPhys

Address1Address2Address3TownID

PostcodeLocationPhysID

LastDateEtc.

Town

NameTownID

LastDate

Page 11: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Relationships (model)

Agent[AgentPers]

ForenameSurname

Dates…

AgentID…

Administers

AccessOpenHours…

AdministersID…

AgentIDLocationID

Location[LocationPhys]

Address1Address2Address3TownID

…LocationID

Page 12: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Terminological inexactitudes

• Relationships (model) are NOT the same as relationships (RDBMS)– But can often appear so!

• Relationship (m) requires its own table (mostly); relationship (r) is the link between tables– Can sometimes simplify so relationship (m) is

implicitly defined by relationship (r), but NOT if relationship (m) has its own attributes

Page 13: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Assembling the record

• Use Structured Query Language (SQL) to request fields from related tables matching specified criteria

• E.g. to get location town and postcode:– SELECT Town.Name,

LocationPhys.Postcode FROM LocationPhys INNER JOIN Town on Town.TownID=LocationPhys.TownID WHERE LocationPhys.LocationPhysID=23

Page 14: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

SCONE Service

• Web page design and content by DreamWeaver

• RDBMS data added to page content dynamically by ColdFusion– Fully integrated environment with DW– SQL scripts– Data processing (program flow) scripts

• Data stored in SQL Server

Page 15: From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003 By Gordon Dunsire.

Views

• SCONE data retrieved in different ways for different purposes using SQL– Data is stored once, used many times– Data updates are immediately visible– Data updated once, visible in many places

• Single RDBMS supports multiple, overlapping services:– SCONE, SCAMP, SLIR (SWOP, ESH), RCO,

CAIRNS, Cultural portal