Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.7 MB, 156 trang )
Example 30.2 – Example Lorel Queries
Answer
PropertyForRent &5
street &11 “2 Manor Rd”
type &12 “Flat”
monthlyRent &13 375
OverseenBy &4
PropertyForRent &6
street &14 “18 Dale Rd”
type &15 1
annualRent &16 7200
OverseenBy &4
© Pearson Education Limited 1995, 2005
19
Example 30.2 – Example Lorel Queries
Find all properties with annual rent.
SELECT DreamHomes.PropertyForRent
FROM DreamHome.PropertyForRent.annualRent
Answer
PropertyForRent &6
street &14 “18 Dale Rd”
type &15 1
annualRent &16 7200
OverseenBy &4
© Pearson Education Limited 1995, 2005
20
Example 30.2 – Example Lorel Queries
Find all staff who oversee two or more
properties.
SELECT DreamHome.Staff.Name
FROM DreamHome.Staff SATISFIES
2 <= COUNT(SELECT DreamHome.Staff
WHERE DreamHome.Staff.Oversees)
Answer
name &9 “Ann Beech”
© Pearson Education Limited 1995, 2005
21
DataGuide
x
x
A dynamically generated and maintained
structural summary of database, which
serves as a dynamic schema.
Has three properties:
– conciseness: every label path in the database
appears exactly once in the DataGuide;
– accuracy : every label path in DataGuide exists
in original database;
– conv enience: a DataGuide is an OEM (or XML)
object, so can be stored and accessed using same
techniques as for source database.
© Pearson Education Limited 1995, 2005
22
DataGuides
© Pearson Education Limited 1995, 2005
23
DataGuides
x
x
x
Can determine whether a given label path of length
n exists in source database by considering at most
n objects in the DataGuide.
For
example,
to
verify
whether
path
Staff.Oversees.annualRent
exists,
need
only
examine outgoing edges of objects &19, &21, and
&22 in our DataGuide.
Further, only objects that can follow Branch are
the two outgoing edges of object &20.
© Pearson Education Limited 1995, 2005
24
DataGuides
x
DataGuides can be classified as strong or weak:
– strong is where each set of label paths that share
same target set in the DataGuide is exactly the
set of label paths that share same target set in
source database.
© Pearson Education Limited 1995, 2005
25
DataGuides
x
(a) weak DataGuide; (b) strong DataGuide.
© Pearson Education Limited 1995, 2005
26
XML (eXtensible Markup Language)
A meta-language (a language for describing other
languages) that enables designers to create their
own customized tags to provide functionality not
available with HTML.
x
x
Most documents on Web currently stored and
transmitted in HTML.
One strength of HTML is its simplicity.
Simplicity may also be one of its weaknesses,
with users wanting tags to simplify some tasks
and make HTML documents more attractive and
dynamic.
© Pearson Education Limited 1995, 2005
27
XML
x
x
To satisfy this demand, vendors introduced some
browser-specific HTML tags, making it difficult
to develop sophisticated, widely viewable Web
documents.
W3C has produced XML, which could preserve
general application independence that makes
HTML portable and powerful.
© Pearson Education Limited 1995, 2005
28
XML
x
x
x
x
XML is a restricted version of SGML, designed
especially for Web documents.
SGML allows document to be logically separated
into two: one that defines the structure of the
document (DTD), other containing the text itself.
By giving documents a separately defined
structure, and by giving authors ability to define
custom structures, SGML provides extremely
powerful document management system.
However, SGML has not been widely adopted due
to its inherent complexity.
© Pearson Education Limited 1995, 2005
29