NU AVDDH Data Databases and CMS

105
Intro to data, databases, and content management systems Amazingly, in 90 minutes!

description

Northwestern University AVDDH Workshop Presentation on Data, Databases, and Content Management Systems

Transcript of NU AVDDH Data Databases and CMS

Page 1: NU AVDDH Data Databases and CMS

Intro to data, databases, and

content management

systemsAmazingly, in 90 minutes!

Page 2: NU AVDDH Data Databases and CMS

Apollonian View•Data — what is it, importance of

structure

•Databases — the classical repository for data

•Algorithms — formalizing the request and processing of data

•Content Management Systems —common example assembling all the above.

Page 3: NU AVDDH Data Databases and CMS

http://www.flickr.com/photos/snorpey/3317497657/http://www.flickr.com/photos/snorpey/3317497657/

Page 4: NU AVDDH Data Databases and CMS
Page 5: NU AVDDH Data Databases and CMS

Elizabeth Taylor

commons.wikimedia.org

Conrad Hilton, 1950-51

Michael Widling 1952-57

Mike Todd, 1957-58

Eddie Fisher, 1959-64

Richard Burton, 1964-74

Richard Burton, 1975-76

John Warner, 1976-82

Larry Fortensky, 1991-96

Page 6: NU AVDDH Data Databases and CMS
Page 7: NU AVDDH Data Databases and CMS
Page 8: NU AVDDH Data Databases and CMS
Page 9: NU AVDDH Data Databases and CMS

XML-or-

Page 10: NU AVDDH Data Databases and CMS

<person> <firstname>Matt</firstname> <lastname>Taylor</lastname></person>

<person> <firstname>Amanda</firstname> <lastname>French</lastname></person>

<person> <firstname>Josh</firstname> <lastname>Honn</lastname></person>

firstname

lastname

Matt Taylor

Amanda French

Josh Honn

Page 11: NU AVDDH Data Databases and CMS
Page 12: NU AVDDH Data Databases and CMS

Photos: Boston Public Library — Frank Rineharthttp://www.flickr.com/photos/boston_public_library/sets/72157622672603941/

Page 13: NU AVDDH Data Databases and CMS

Photos: Boston Public Library — Frank Rineharthttp://www.flickr.com/photos/boston_public_library/sets/72157622672603941/

Height 150 mm

Width 114 mm

SubjectNative American

with rifle

LocationOmaha,

Nebraska

Date 1898

Photographer Reinhart, F. A.

Page 14: NU AVDDH Data Databases and CMS

Photos: Boston Public Library — Frank Rineharthttp://www.flickr.com/photos/boston_public_library/sets/72157622672603941/

Height Width TitleLocatio

nDate Creator

150mm 114mm

Native American with rifle

Omaha, NE

1898Reinhart

, F. A.

144mm 116mmFreckled

FaceOmaha,

NE1898

Reinhart, F. A.

150mm 118mmLittle Bird

Omaha, NE

1898Reinhart

, F. A.

Page 15: NU AVDDH Data Databases and CMS

contributor

creator

date description

formatidentifier

language

publisher

relation

rights

source

subject

http://www.flickr.com/photos/ccacnorthlib/4131838228/

title

type

Page 16: NU AVDDH Data Databases and CMS

contributor

creator

date description

formatidentifier

language

publisher

relation

rights

source

subject

http://www.flickr.com/photos/ccacnorthlib/4131838228/

title

typeDUBLINCORE

Page 17: NU AVDDH Data Databases and CMS
Page 18: NU AVDDH Data Databases and CMS

Photos: Boston Public Library — Frank Rineharthttp://www.flickr.com/photos/boston_public_library/sets/72157622672603941/

Height Width TitleLocatio

nDate Creator

150mm 114mm

Native American with rifle

Omaha, NE

1898Reinhart

, F. A.

144mm 116mmFreckled

FaceOmaha,

NE1898

Reinhart, F. A.

150mm 118mmLittle Bird

Omaha, NE

1898Reinhart

, F. A.

Page 19: NU AVDDH Data Databases and CMS

Photos: Boston Public Library — Frank Rineharthttp://www.flickr.com/photos/boston_public_library/sets/72157622672603941/

PhotoID

Tribe Role Fringe BonesFeather

s

1001Unknow

nUnknow

nCow Hide

0 2

1002 ArapahoMedicine Woman

Fabric 126 0

1003 Arapaho Chief None 32 6

Page 20: NU AVDDH Data Databases and CMS

Recap 1

•Data is everywhere — in many forms

•We seek to bring order to data

•Creating tables is one way to do this

•All metadata is data — but data is not necessarily metadata

Page 21: NU AVDDH Data Databases and CMS

Practical I•Open Excel

•Enter data related to 3 favorite books in these columns:

•Title

•Author Last Name

•Author First Name

•Save as Excel file

•Save as CSV file too!

•What’s a CSV?

•How is a CSV different from an XLS file?

Page 22: NU AVDDH Data Databases and CMS
Page 23: NU AVDDH Data Databases and CMS

Photos: IMDB.com

Page 24: NU AVDDH Data Databases and CMS

Data modeling

Photos: IMDB.com

Page 25: NU AVDDH Data Databases and CMS

Photos: IMDB.com

Movies Actors

Page 26: NU AVDDH Data Databases and CMS

Photos: IMDB.com

Actor

firstnamelastnamebirth datedeath date

firstname at birthlastname at birth

height....

Page 27: NU AVDDH Data Databases and CMS

Photos: IMDB.com

Actor

firstname Textlastname Textbirth date Datedeath date Date

firstname at birth

Text

lastname at birth

Text

height (in inches)

Number

... ...

Page 28: NU AVDDH Data Databases and CMS

12

111

84

202

List of Heights

Sortedas Number

Sortedas Text

111

202

84

12

12

111

84

202

data types are important!

Page 29: NU AVDDH Data Databases and CMS

integer

decimal number

singlecharacter/letter

boolean(true/false)date

time

datetime

text

gps coordinate

currency amount

zip codebinary data

Page 30: NU AVDDH Data Databases and CMS

Photos: IMDB.com

Actor

firstname Textlastname Textbirth date Datedeath date Date

firstname at birth

Text

lastname at birth

Text

height (in inches)

Number

... ...

Page 31: NU AVDDH Data Databases and CMS

Photos: IMDB.com

Actor

firstname Text

lastname Text

birth date Date

death date Date

firstname at birth

Text

lastname at birth

Text

height (in in)Numbe

r

... ...firstname lastname birth datedeat

h date

fn at birth

ln at birth height

Matt Damon1970-10-

08Matthew

PaigeDamon 70

Morgan Freeman1937-06-

01Morgan Freeman 74

Jodie Foster1962-11-

19Alicia

ChristianFoster 63

MatthewMcConaugh

ey1969-11-

04Matthew

DavidMcConaughey 72

Page 32: NU AVDDH Data Databases and CMS

Photos: IMDB.com

Movie

title Text

length (minutes)

Number

release date Date

Page 33: NU AVDDH Data Databases and CMS

Photos: IMDB.com

Movie

title Text

length (minutes)

Number

release date Date

title length (min) release date

Contact 150 1997-07-11

Invictus 134 2009-12-11

Elysium 109 2013-08-09

Page 34: NU AVDDH Data Databases and CMS
Page 35: NU AVDDH Data Databases and CMS
Page 36: NU AVDDH Data Databases and CMS

Movie Actor?

Page 37: NU AVDDH Data Databases and CMS

Actor

firstname Text

lastname Text

birth date Date

death date Date

firstname at birth Text

lastname at birth Text

height (in inches) Number

Movie

title Text

length (minutes) Number

release date Date

Page 38: NU AVDDH Data Databases and CMS

Actor

firstname Text

lastname Text

birth date Date

death date Date

firstname at birth Text

lastname at birth Text

height (in inches) Number

Movie

title Text

length (minutes) Number

release date Date

Role

movie ?

actor ?

? ?

Page 39: NU AVDDH Data Databases and CMS

Actor

firstname Text

lastname Text

birth date Date

death date Date

firstname at birth Text

lastname at birth Text

height (in inches) Number

Movie

title Text

length (minutes) Number

release date Date

Role

movie Text ?

actor Text ?

character name Text

Page 40: NU AVDDH Data Databases and CMS

Actor

firstname Text

lastname Text

birth date Date

death date Date

firstname at birth Text

lastname at birth Text

height (in inches) Number

Movie

title Text

length (minutes) Number

release date Date

Role

? ?

? ?

character name Text

Page 41: NU AVDDH Data Databases and CMS

Actor

id Number

firstname Text

lastname Text

birth date Date

death date Date

firstname at birth Text

lastname at birth Text

height (in inches) Number

Movie

id Number

title Text

length (minutes) Number

release date Date

Role

? ?

? ?

character name Text

Page 42: NU AVDDH Data Databases and CMS

firstname lastname birth datedeat

h date

fn at birth

ln at birth height

Matt Damon1970-10-

08Matthew

PaigeDamon 70

Morgan Freeman1937-06-

01Morgan Freeman 74

Jodie Foster1962-11-

19Alicia

ChristianFoster 63

MatthewMcConaugh

ey1969-11-

04Matthew

DavidMcConaughey 72

title length (min) release date

Contact 150 1997-07-11

Invictus 134 2009-12-11

Elysium 109 2013-08-09

Page 43: NU AVDDH Data Databases and CMS

idfirstna

melastname birth date

death

date

fn at birth

ln at birthheigh

t

101 Matt Damon1970-10-

08Matthew Paige

Damon 70

102 Morgan Freeman1937-06-

01Morgan Freeman 74

103 Jodie Foster1962-11-

19

Alicia Christia

nFoster 63

104Matthe

wMcConaug

hey1969-11-

04

Matthew

David

McConaughey

72

id titlelength (min)

release date

101 Contact 150 1997-07-11

102 Invictus 134 2009-12-11

103 Elysium 109 2013-08-09

Page 44: NU AVDDH Data Databases and CMS

SSN

AccountNumber

ISBN

UPC

VINPassportNumber

Student ID

AccessionNumber

id

Page 45: NU AVDDH Data Databases and CMS

idfirstna

melastname birth date

death

date

fn at birth

ln at birthheigh

t

101 Matt Damon1970-10-

08Matthew Paige

Damon 70

102 Morgan Freeman1937-06-

01Morgan Freeman 74

103 Jodie Foster1962-11-

19

Alicia Christia

nFoster 63

104Matthe

wMcConaug

hey1969-11-

04

Matthew

David

McConaughey

72

id titlelength (min)

release date

101 Contact 150 1997-07-11

102 Invictus 134 2009-12-11

103 Elysium 109 2013-08-09

Page 46: NU AVDDH Data Databases and CMS

Actor

id Number

firstname Text

lastname Text

birth date Date

death date Date

firstname at birth Text

lastname at birth Text

height (in inches) Number

Movie

id Number

title Text

length (minutes) Number

release date Date

Role

movie id Number

actor id Number

character name Text

Page 47: NU AVDDH Data Databases and CMS

idfirstna

melastname birth date

death

date

fn at birth

ln at birthheigh

t

101 Matt Damon1970-10-

08Matthew Paige

Damon 70

102 Morgan Freeman1937-06-

01Morgan Freeman 74

103 Jodie Foster1962-11-

19

Alicia Christia

nFoster 63

104Matthe

wMcConaug

hey1969-11-

04

Matthew

David

McConaughey

72

id titlelength (min)

release date

101 Contact 150 1997-07-11

102 Invictus 134 2009-12-11

103 Elysium 109 2013-08-09

Movie

Actor

movie id actor id character name

102 102 Nelson Mandela

102 101 Francois Pienaar

Role

Page 48: NU AVDDH Data Databases and CMS

Actor

id Number

firstname Text

lastname Text

birth date Date

death date Date

firstname at birth Text

lastname at birth Text

height (in inches) Number

Movie

id Number

title Text

length (minutes) Number

release date Date

Role

movie id Number

actor id Number

character name Text

Page 49: NU AVDDH Data Databases and CMS

Recap II•Data modeling allows for a formal

structuring of information

•Information should be organized by notion of discrete objects and distinctive attributes

•In tables, objects become rows of information, and attributes become the columns

•Unique identifiers are useful attributes that help identify and relate data objects to one another

Page 50: NU AVDDH Data Databases and CMS

Practical II (a)•Imagine a data model for art &

architecture:

•Country … e.g. France, Spain, USA, Germany, etc.

•Person … e.g. Picasso, van der Rohe, etc.

•Residency … Periods of time artist spent in a country

Page 51: NU AVDDH Data Databases and CMS

Person

id Number

firstname Text

lastname Text

birth date Date

death date Date

Country

id Number

name Text

geographic center Coordinate

Residency

country id Number

person id Number

start date Date

end date Date

Page 52: NU AVDDH Data Databases and CMS

Practical II (b)

•Add a 4th column to your Excel (containing an ID) table and save it as a new CSV file:

•books_ids.csv

•Make sure your IDs are unique from everyone else’s -- how can we ensure this?

Page 53: NU AVDDH Data Databases and CMS

Normalization, Conformance

& Authorities

Page 54: NU AVDDH Data Databases and CMS
Page 55: NU AVDDH Data Databases and CMS

contributor

creator

date description

formatidentifier

language

publisher

relation

rights

source

subject

http://www.flickr.com/photos/ccacnorthlib/4131838228/

title

typeDUBLINCORE

Page 56: NU AVDDH Data Databases and CMS

Consistency is [usually] key!

“color” vs. “colour”

“Rembrandt” vs.“Rembrandt

Harmenszoon van Rijn”

“coarse” vs. “rough”

in. vs. cm.

“steamship” vs. “steamboat”

Page 57: NU AVDDH Data Databases and CMS

Why does it matter?

Does “steamboat” = “steamship” ?How do “stupid” computers know that?

steamship

Page 58: NU AVDDH Data Databases and CMS

http://en.wikipedia.org/wiki/File:Mars_Climate_Orbiter_-_mishap_diagram.png

Page 59: NU AVDDH Data Databases and CMS

How to improve conformance in

data:

•Develop style guides

•Use a controlled vocabulary

•Consult an authority

Page 60: NU AVDDH Data Databases and CMS
Page 61: NU AVDDH Data Databases and CMS

AAT

TGN

ULAN

Page 62: NU AVDDH Data Databases and CMS

AAT

TGN

ULAN

“motor home”

{TAXONOMY

Page 63: NU AVDDH Data Databases and CMS
Page 64: NU AVDDH Data Databases and CMS

Thought Question

•We know what a taxonomy is...

•What’s a “folksonomy” ?

Page 65: NU AVDDH Data Databases and CMS
Page 66: NU AVDDH Data Databases and CMS

Databases

Page 67: NU AVDDH Data Databases and CMS
Page 68: NU AVDDH Data Databases and CMS

Source: Wikimedia Commonshttp://upload.wikimedia.org/wikipedia/commons/1/12/Oracle_Headquarters_Redwood_Shores.jpg

Page 69: NU AVDDH Data Databases and CMS

DATABASE at Postmasters, March 2009 by Michael Mandiberg / CC BY-SAhttp://www.flickr.com/photos/theredproject/3332644561/

Page 70: NU AVDDH Data Databases and CMS

1960’s 1970’s 1980’s 1990’s

Relational PersonalWeb & Open

SourceHierarchical

Page 71: NU AVDDH Data Databases and CMS

Hierarchical Databases

File System

Note Organizers

Page 72: NU AVDDH Data Databases and CMS

Relational Database Systems

XML/Document Databases

Page 73: NU AVDDH Data Databases and CMS

Relational Database Systems

XML/Document Databases

SQLSQL

No SQLNo SQL

Page 74: NU AVDDH Data Databases and CMS

$⃠ ActorActorActorActor MovieMovieMovieMovie

RoleRoleRoleRole

SELECT * FROM actor WHERE lastname = ‘Freeman’;

Page 75: NU AVDDH Data Databases and CMS

RelationalActor

id Number

firstname Text

lastname Text

birth date Date

death date Date

firstname at birth Text

lastname at birth Text

height (in inches) Number

Movie

id Number

title Text

length (minutes) Number

release date Date

Role

movie id Number

actor id Number

character name Text

Page 76: NU AVDDH Data Databases and CMS
Page 77: NU AVDDH Data Databases and CMS

SQL Query:

Monsieur Monsieur Database,Database,

Tell me the title Tell me the title of the movie of the movie with ID 103with ID 103

Monsieur Monsieur Database,Database,

Tell me the title Tell me the title of the movie of the movie with ID 103with ID 103

OK. But OK. But only if you only if you speak my speak my language!language!

OK. But OK. But only if you only if you speak my speak my language!language!

SELECT id, title FROM movie WHERE id = ‘103’;

Result:

http://commons.wikimedia.org/wiki/File:Fetita_cu_cheie_icon.png

id title

103 Elysium

Page 78: NU AVDDH Data Databases and CMS

SQL Query:Monsieur Monsieur Database,Database,

Tell me Tell me everything everything about any about any

actors with last actors with last name name

“Freeman”“Freeman”

Monsieur Monsieur Database,Database,

Tell me Tell me everything everything about any about any

actors with last actors with last name name

“Freeman”“Freeman”

OK. But OK. But only if you only if you speak my speak my language!language!

OK. But OK. But only if you only if you speak my speak my language!language!

SELECT * FROM actor WHERE lastname = ‘Freeman’;

Result:

idfirstna

melastname birth date

death

date

fn at birth

ln at birthheigh

t

102 Morgan Freeman1937-06-

01Morgan Freeman 74

http://commons.wikimedia.org/wiki/File:Fetita_cu_cheie_icon.png

Page 79: NU AVDDH Data Databases and CMS

SQL Query:Tell me the Tell me the titles and titles and

characters of characters of the movies the movies

starring starring someone someone namednamed

Matt DamonMatt Damon

Tell me the Tell me the titles and titles and

characters of characters of the movies the movies

starring starring someone someone namednamed

Matt DamonMatt Damon

OK. But OK. But only if you only if you speak my speak my language!language!

OK. But OK. But only if you only if you speak my speak my language!language!

SELECT movie.title, role.character_name FROM movie, role, actor WHERE actor.firstname = ‘Matt’ AND actor.lastname = ‘Damon’ AND role.actor_id = actor.id AND role.movie_id = movie.id;

Result:

http://commons.wikimedia.org/wiki/File:Fetita_cu_cheie_icon.png

title character_name

Invictus Francois Pienaar

Elysium Max

Page 80: NU AVDDH Data Databases and CMS

Demo

MySQL Administration using phpMyAdmin to create a “books”

tablein the “booksdb” database

Page 81: NU AVDDH Data Databases and CMS
Page 82: NU AVDDH Data Databases and CMS

Practical III

follow me to usephpMyAdmin to upload your CSV

data

http://tinyurl.com/mattbase101

Page 83: NU AVDDH Data Databases and CMS

Demo

Sample website using our book data

http://tinyurl.com/mattbooks101

Page 84: NU AVDDH Data Databases and CMS
Page 85: NU AVDDH Data Databases and CMS

Web InterfaceWeb InterfaceWeb InterfaceWeb Interface

DatabaseDatabaseDatabaseDatabase

????

Page 86: NU AVDDH Data Databases and CMS

Web InterfaceWeb InterfaceWeb InterfaceWeb Interface

DatabaseDatabaseDatabaseDatabase

ApplicationApplicationApplicationApplication

Page 87: NU AVDDH Data Databases and CMS

Web InterfaceWeb InterfaceWeb InterfaceWeb Interface

DatabaseDatabaseDatabaseDatabase

““CODE”CODE”““CODE”CODE”

Page 88: NU AVDDH Data Databases and CMS

Web InterfaceWeb InterfaceWeb InterfaceWeb Interface

DatabaseDatabaseDatabaseDatabase

php javapython ruby

perl

Page 89: NU AVDDH Data Databases and CMS
Page 90: NU AVDDH Data Databases and CMS

Web InterfaceWeb InterfaceWeb InterfaceWeb Interface

DatabaseDatabaseDatabaseDatabase

php javapython ruby

perlWrite your ownapplication?

Use an existing application?

Both!

Page 91: NU AVDDH Data Databases and CMS

Web InterfaceWeb InterfaceWeb InterfaceWeb Interface

DatabaseDatabaseDatabaseDatabase

C M SContent Management System

Page 92: NU AVDDH Data Databases and CMS
Page 93: NU AVDDH Data Databases and CMS
Page 94: NU AVDDH Data Databases and CMS
Page 95: NU AVDDH Data Databases and CMS
Page 96: NU AVDDH Data Databases and CMS
Page 97: NU AVDDH Data Databases and CMS
Page 98: NU AVDDH Data Databases and CMS
Page 99: NU AVDDH Data Databases and CMS
Page 100: NU AVDDH Data Databases and CMS
Page 101: NU AVDDH Data Databases and CMS

Practical IV

•Consider Wordpress: Pages, Posts, Comments, Authors...

•What might it’s data model be?

Page 102: NU AVDDH Data Databases and CMS

PagePost

Comment

Author Category

Page 103: NU AVDDH Data Databases and CMS
Page 104: NU AVDDH Data Databases and CMS
Page 105: NU AVDDH Data Databases and CMS

Recap IV

•Databases have data

•Users have browsers, phones, etc...

•Application code spans the two and customizes the interactive experience

•CMSs provide a pre-built framework for interacting with data

•CMSs can be customized & extended