From model to service: relational databases and SCONE Presentation to CDLR staff on Wed 5 Feb 2003...
-
Upload
stanley-robbins -
Category
Documents
-
view
212 -
download
0
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/1.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/2.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/3.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/4.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/5.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/6.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/7.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/8.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/9.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/10.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/11.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/12.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/13.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/14.jpg)
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.](https://reader036.fdocuments.net/reader036/viewer/2022072006/56649f445503460f94c64bfe/html5/thumbnails/15.jpg)
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