Date post: | 01-May-2015 |
Category: |
Documents |
Upload: | donatello-mosca |
View: | 216 times |
Download: | 0 times |
Basi di dati e World Wide Web
Paolo Atzeni
Paolo Merialdo
19/02/2002
19/02/2002 Basi di dati, capitolo 14 2
Richiami: Internet e WWW
• Internet:– Una federazione di reti che usano TCP/IP
• World Wide Web– ipertesto multimediale distribuito– con la possibilità di richiamare programmi e costruire pagine
dinamicamente
19/02/2002 Basi di dati, capitolo 14 3
Il World Wide Web
• ipertesto• multimediale (testo, immagini, suoni, video, …)• distribuito• con componenti autonome• “attivo” (permette di richiamare programmi)
19/02/2002 Basi di dati, capitolo 14 4
Ipertesto
• documento con struttura non sequenziale o• insieme di documenti correlati
• esempi: – un libro (struttura gerarchica, più rimandi, note, bibliografia)– una rivista (con rimandi anche a fascicoli diversi)– un insieme di libri (che si possono citare a vicenda)– …
19/02/2002 Basi di dati, capitolo 14 5
Richiami: HTML
• linguaggio per la specifica di ipermedia• formattazione “logica” dei documenti• riferimenti basati su URL (Uniform Resource Locator):
[Protocollo://] [Server/] Risorsa
– Protocollo: http, ftp, telnet, mailto– Server: nome simbolico o indirizzo IP– Risorsa: specifica di directory e file, anche con parametri, o
anche indirizzo di posta elettronica• costrutto “form” per l’invio di informazioni (parametri, quando
l’URL specifica un programma da eseguire)
19/02/2002 Basi di dati, capitolo 14 6
Richiami: HTTP
• protocollo per la comunicazione fra browser (client) e server Web (“server HTTP”)
• fasi:
1. Apertura della connessione: il browser contatta il server HTTP (indirizzo e protocollo come nell’URL) e richiede una connessione TCP
2. Accettazione della connessione: il server, se disponibile, accetta e invia conferma
3. Richiesta: il client invia la richiesta specifica, con i dettagli della risorsa e gli eventuali parametri
4. Risposta: il server comunica l’esito e il risultato, chiude la connessione
19/02/2002 Basi di dati, capitolo 14 7
HTTP, protocollo senza memoria
• Chiusa una connessione, il server la “dimentica” completamente (a parte il log, che però non viene utilizzato nelle connessioni successive)
• Motivazioni:– semplicità realizzativa (ogni richiesta può essere gestita
indipendentemente dalle altre)• Conseguenze:
– la gestione di attività che richiedono interazioni multiple non è immediata
19/02/2002 Basi di dati, capitolo 14 8
HTTP e programmi: il protocollo CGI (Common Gateway
Interface)• Gateway (o programma CGI): un qualunque progranna
richiamato da un server HTTP• I gateway “aprono” il mondo Web permettendo l’integrazione di
altre funzionalità• Meccanismo di comunicazione:
BrowserServerHTTP
Gateway … 1 2 3
45
19/02/2002 Basi di dati, capitolo 14 9
The Web: a great opportunity
• the diffusion of the Web is ...• the Web (with its browsers) is becoming a standard interface for
the final user– the protocol is very simple and public– the interface is uniform– the content is very rich (in breadth and depth)
• it is becoming a standard interface for accessing many services, with information systems and databases of every type
19/02/2002 Basi di dati, capitolo 14 10
Integration of information systems
• Various motivations:– interaction of components independently developed– cooperation of previously separated business processes– cooperation (or merge) of companies
• Typical requirements:– distribution– heterogeneity– autonomy
19/02/2002 Basi di dati, capitolo 14 11
A topical issue
• a request from our “users”:– “computing facilities should become similar to standard
utilities (gas, phone, power, etc.)”• our usual reply:
– “computing services have application specific features for which standard services would only be a limited solutions (as it is the case for the other utilities)”
• however– what would a standard offer of services be?
19/02/2002 Basi di dati, capitolo 14 12
The great opportunity
• Internet (and Intranets and Extranets) and the World-Wide-Web offer a great opportunity
• a simplified stack of layers:– cooperation (of applications)– interoperability (ftp, telnet, mail, http, ...)– connectivity
• standardization climbs stacks (functionalities get standardized and go down: think to database systems!)
19/02/2002 Basi di dati, capitolo 14 13
Sistemi informativi su Web (WIS)
(Nota: ci riferiamo al Web come strumento “produttivo”; il surfing è marginale)
• Pubblicazione (permanente?) e consultazione su Web: siti “catalogo”– richiedono un approccio sistematico, sempre più importante
al crescere delle dimensioni:• i dati possono cambiare, come si evolve il sito?• i siti presentano ridondanza, per vari motivi
– l’uso di basi di dati può risultare conveniente (spesso poi la base di dati esiste già!)
• Transazioni su Web: perché solo interrogazioni?– il sito può essere aggiornato attraverso il Web stesso– il browser diventa un’interfaccia standard per sistemi
informativi
19/02/2002 Basi di dati, capitolo 14 14
Sistemi informativi su Web, nuove applicazioni
• Commercio elettronico:
– se i cataloghi sono la principale applicazione dei siti di consultazione, è naturale pensare alla “vendita per corrispondenza” (ma con funzionalità aggiuntive: commenti, discussioni, verifiche); sicurezza e affidabilità diventano essenziali
• Gruppi di discussione: ad esempio, recensioni di libri
• Sistemi di supporto al lavoro cooperativo: workflow
• “Data farming”
• Sistemi “embedded”: telefonini, sistemi di navigazione, Internet TV, …
• Nota: alcune applicazioni potrebbero essere su “Intranet” (con possibilità di uniformazione degli strumenti) o “Extranet” (attività “Business-to-business”)
19/02/2002 Basi di dati, capitolo 14 15
Sistemi informativi su Web
Complessitàdei dati
Complessitàdei servizi
Siti data-intensive
Siti di presenza
Siti orientatiai servizi
WIS
19/02/2002 Basi di dati, capitolo 14 16
Portali
• Siti che supportano l'utente nell'utilizzo del Web:– servizi generali:
• posta elettronica, • gruppi di discussione• motori di ricerca e/o ricerca guidata, con classificazione • hosting di siti
– servizi specializzati (portali "verticali"), dipendenti dallo specifico dominio, in particolare con:
• basi di dati "locali" specializzate• integrazione a grana fine di informazioni e servizi locali
e/o offerti (più o meno spontaneamente) da terzi
19/02/2002 Basi di dati, capitolo 14 17
Two worlds?
• Databases can be queried in a flexible way; hypertexts are easy to access, but cannot be “queried”
• Web sites are often difficult to explore, use and monitor
• Database design methods are well known• Web sites are difficult to design and maintain
19/02/2002 Basi di dati, capitolo 14 18
Web and DBs: a contradiction?
• databases are well structured and organized• how much structure and organization is there in the Web?
• it depends, both on the source and on the user• there are different degrees of granularity and structure for our
data• we need to be able to make conversions (from DB to HT and
viceversa)
19/02/2002 Basi di dati, capitolo 14 19
Database approaches
• bottom-up: accessing information from Web sources, and integrating them
• top-down: designing and maintaining Web sites• global: integrating existing sites and offering the information
through new ones
19/02/2002 Basi di dati, capitolo 14 20
Problems with many Web-sites
• design– information is often poorly organized and difficult to access– it is not even clear which pieces of information are available– the access structure is casual and many dangling references
occur– the style of presentation is heterogeneous
• maintenance– difficulties in updating the content (type and values)– difficulties in changing the initially defined structure– difficulties in changing the presentation details
19/02/2002 Basi di dati, capitolo 14 21
Esistono pagine con la stessa struttura
19/02/2002 Basi di dati, capitolo 14 22
Indipendenza dei dati negli ipertesti:stessi dati, diversa struttura ipertestuale
19/02/2002 Basi di dati, capitolo 14 23
Indipendenza dei dati negli ipertesti:stessi dati e stessa struttura ipertestuale,
diversa presentazione
19/02/2002 Basi di dati, capitolo 14 24
Hypertext data-independence
• Data “what information is offered through the site and what are the conceptual details and the logical organization”
• Hypertext “how data is arranged in pages and what navigation links correlate them”
• Presentation “the appearance of each piece of information in pages”
19/02/2002 Basi di dati, capitolo 14 25
Design Issues
• Data
choosing the content
• Hypertext
choosing page organization and navigation paths
• Presentation
defining layout and graphics
Maintenance Issues
• Data
changing the (type of) content
• Hypertext
changing page organization and navigation paths
• Presentation
changing layout and graphics
19/02/2002 Basi di dati, capitolo 14 26
Components and Models
data ER and Relational
hypertext
presentation HTML
What is missing is a model for hypertexts!
19/02/2002 Basi di dati, capitolo 14 27
Models for hypertexts
• in data-intensive Web sites (and often in general) there are (many) pages with a similar (or even the same) structure
• thirty or forty years ago people realized that in an application it is often the case that there are records with the same structure; files with a rather fixed structure were invented with this purpose
• the notion of scheme of the database was later introduced as an overall description of the content of a database
19/02/2002 Basi di dati, capitolo 14 28
Pagine con la stessa struttura
19/02/2002 Basi di dati, capitolo 14 29
Pagine con un'altra struttura
19/02/2002 Basi di dati, capitolo 14 30
A Web page
19/02/2002 Basi di dati, capitolo 14 31
A page-scheme: ProfessorPage
ProfessorPage
NamePositionAddress
EMailResearchList
AreaToResP
19/02/2002 Basi di dati, capitolo 14 32
ADM (Araneus Data Model): a logical model for Web hypertexts
• page-schemes• “unique” pages• simple attributes
– text, images, ...– link (anchor, URL)
• complex attributes: lists (possibly nested)• heterogeneous union• form (as virtual list over form fields and link to the result)
19/02/2002 Basi di dati, capitolo 14 33
A Web page (containing a list of links)
19/02/2002 Basi di dati, capitolo 14 34
A “unique” page-scheme: ProfessorListPage
ProfessorListPage
ProfessorListNameToProfP
19/02/2002 Basi di dati, capitolo 14 35
An ADM Scheme
ProfessorListPage
ProfessorListNameToProfP
ProfessorPage
NamePositionAddress
EMailResearchList
AreaToResP
19/02/2002 Basi di dati, capitolo 14 36
Heterogeneous Union and Forms
19/02/2002 Basi di dati, capitolo 14 37
Heterogeneous Union and Forms in ADM
ProfessorListPage
ProfessorListName
ToProfP
ProfessorPageNamePosition
Address
EMailResearchList
Area
ToResP
Name
Submit
U
SearchProfPage
19/02/2002 Basi di dati, capitolo 14 38
19/02/2002 Basi di dati, capitolo 14 39
Data Models
ER
ADM
Database ConceptualScheme
(entities - relationships)
Hypertext LogicalScheme
(page-schemes, links)
There is a lot of ‘distance’ between the two!
19/02/2002 Basi di dati, capitolo 14 40
19/02/2002 Basi di dati, capitolo 14 41
19/02/2002 Basi di dati, capitolo 14 42
A simple ER scheme
19/02/2002 Basi di dati, capitolo 14 43
An ADM scheme
19/02/2002 Basi di dati, capitolo 14 44
Data Models
ER
ADM
Database ConceptualScheme
(entities - relationships)
Hypertext LogicalScheme
(page-schemes, links)
There is a lot of ‘distance’ between the two!
19/02/2002 Basi di dati, capitolo 14 45
Data Models
ER
ADM
Database ConceptualScheme
(entities - relationships)
Hypertext LogicalScheme
(page-schemes, links)
There is a lot of ‘distance’ between the two!
NCMHypertext Conceptual
Scheme(macroentities,
directed relationships,aggregations)
19/02/2002 Basi di dati, capitolo 14 46
Data Models
Hypertext LogicalScheme
(page-schemes, links)
ER
NCM Hypertext ConceptualScheme
(macroentities,directed relationships,
aggregations)ADM
NCM fills the gap between the two
Database ConceptualScheme
(entities - relationships)
19/02/2002 Basi di dati, capitolo 14 47
Navigation Conceptual Model (NCM)
Hypertext Conceptual Features
• Which concepts should be the hypertext nodes
• Which should be the navigation paths between nodes
• How nodes should be aggregated to build the hierarchical access structure
NCM Constructs
• Macroentity
• Directed Relationship
• Aggregation
19/02/2002 Basi di dati, capitolo 14 48
NCM: Macroentities and directed relationships
Professor
Course
Student
Teacher
Tutorship
Name
Room
Name
Description
Day
Room
HourLessonN
1:1
1:N
1:1Name
...
19/02/2002 Basi di dati, capitolo 14 49
NCM: aggregation nodes
Professor CourseStudent
TeacherTutorship1:11:N1:1
Seminar
People
Department
Activities
19/02/2002 Basi di dati, capitolo 14 50
An NCM scheme
19/02/2002 Basi di dati, capitolo 14 51
19/02/2002 Basi di dati, capitolo 14 52
19/02/2002 Basi di dati, capitolo 14 53
The Araneus Methodology
Database conceptual design
Hypertext logical design
Presentation design
Page GenerationSite generation
Presentation design
Requirements analysis
Database logical design
Hypertext logical design
Hypertext conceptual design
19/02/2002 Basi di dati, capitolo 14 54
design from scratch
Database conceptual design
Hypertext logical design
Presentation design
Page GenerationSite generation
Presentation design
Requirements analysis
Database logical design
Hypertext logical design
Hypertext conceptual design
19/02/2002 Basi di dati, capitolo 14 55
design from an existing database (with an ER scheme)
Database conceptual design
Hypertext logical design
Presentation design
Page GenerationSite generation
Presentation design
Requirements analysis
Database logical design
Hypertext logical design
Hypertext conceptual design
19/02/2002 Basi di dati, capitolo 14 56
design from an existing database (without an ER scheme)
Database conceptual design(reverse engineering)
Hypertext logical design
Presentation design
Page GenerationSite generation
Presentation design
Requirements analysis
Database logical design
Hypertext logical design
Hypertext conceptual design
19/02/2002 Basi di dati, capitolo 14 57
Hypertext conceptual design:from ER to NCM
Database conceptual design
Hypertext logical design
Presentation design
Page GenerationSite generation
Presentation design
Requirements analysis
Database logical design
Hypertext logical design
Hypertext conceptual design
19/02/2002 Basi di dati, capitolo 14 58
Hypertext Conceptual DesignER scheme NCM Scheme
• step 1 choose and describe macroentities: design “views” over the input ER scheme
• step 2choose navigation paths
• step 3shape the hypertext access structure on the basis of (“bottom-up”) conceptual aggregation
19/02/2002 Basi di dati, capitolo 14 59
Hypertext Conceptual DesignER scheme NCM Scheme
step 1 choose and describe macroentities: design “views” over the input ER scheme
usually it corresponds to “de-normalize” the input ER scheme
Course
Lesson
Course
Name
DescriptionName
Description
Day
HourLesson
Day
Hour
1:1
1:N
1:N
ER NCM
19/02/2002 Basi di dati, capitolo 14 60
Hypertext Conceptual DesignER scheme NCM Scheme
step 2 choose navigation paths
it may introduce redundancies
Professor
Research-Group
1:1
1:N
ER NCM
Paper
Professor
Research-Group
1:1
1:NPaper
1:N
1:N
1:N
1:N
1:N
1:N
19/02/2002 Basi di dati, capitolo 14 61
Hypertext Conceptual DesignER scheme NCM Scheme
step 3 shape the hypertext access structure it is based on “bottom-up” conceptual
aggregations
Professor
Research-Group
1:1
1:N
NCM NCM
Seminar
Professor
Research-Group
1:1
1:N
Seminar
...
...
ResearchActivities
19/02/2002 Basi di dati, capitolo 14 62
The Input ER scheme
19/02/2002 Basi di dati, capitolo 14 63
The resulting NCM scheme
19/02/2002 Basi di dati, capitolo 14 64
Hypertext logical design:from NCM to ADM
Database conceptual design
Hypertext logical design
Presentation design
Page GenerationSite generation
Presentation design
Requirements analysis
Database logical design
Hypertext logical design
Hypertext conceptual design
19/02/2002 Basi di dati, capitolo 14 65
Hypertext Logical DesignNCM scheme ADM Scheme
step 1 map each macroentity into either
a page-scheme or a list inside a page-scheme
step 2map each directed relationship into a (list of) link attribute(s)
step 3map each aggregation into a unique page-scheme with link attributes to the target page-schemes
19/02/2002 Basi di dati, capitolo 14 66
Hypertext Logical DesignStep 1 (example)
19/02/2002 Basi di dati, capitolo 14 67
Hypertext Logical DesignStep 1 (example)
19/02/2002 Basi di dati, capitolo 14 68
Hypertext Logical DesignStep 2 (example)
19/02/2002 Basi di dati, capitolo 14 69
Hypertext Logical DesignStep 3 (example)
19/02/2002 Basi di dati, capitolo 14 70
R e s u l t i n g A D M S c h e m e
19/02/2002 Basi di dati, capitolo 14 71
Maintenance
• The Schemes help designers to maintain the hypertext structure• Maintenance activities correspond to apply scheme
transformations:– introduce multilevel lists– introduce forms– split pages– ...
19/02/2002 Basi di dati, capitolo 14 72
Maintenance: example