Transcript 401-boeing

20010126
ebis/etat/ebuy/xdia Joint Effort
1
Introduction
• Extensible Markup language XML
• SCHEMA
• DTD
20010126
ebis/etat/ebuy/xdia Joint Effort
2
What is a Schema?
•Schema:
A collection of statements that define the structure
of a set of data as well as constraints on that
structure.
•Schema language:
A language used to define a schema
such as the XML DTD language or an XML
schema language.
20010126
ebis/etat/ebuy/xdia Joint Effort
3
• XML - Extensible Markup Language
<?xml version=“1.0”?>
<USAddress>
<name>”Alice Smith”</name>
<street>”333 Huntington Ave”</street>
<city>”Boston”</city>
<state>”MA”</state>
<zip>”02115”</zip>
</USAddress>
20010126
ebis/etat/ebuy/xdia Joint Effort
4
XML Schema - a specification of the synta x and semantics of XML
documents
DTD - document type definition
<!DOCTYPE USAddress [
<!ELEMENT USAddress(name, street, city, state, zip) >
<!ELEMENT name (#PCDATA) >
<!ELEMENT street (#PCDATA) >
<!ELEMENT city
(#PCDATA) >
<!ELEMENT state (#PCDATA) >
<!ELEMENT zip
(#PCDATA) >
]>
20010126
ebis/etat/ebuy/xdia Joint Effort
5
XML Query Languages
Traditional Way:
• SQL
•XML QL
•Lore
20010126
ebis/etat/ebuy/xdia Joint Effort
6
•XML document for Music
<Music>
CD year =1193”>
<group> Spyro Gyra </group>
<title>Dreams Beyond Control </Title>
<track no=“1”>
<title>Walk the Walk</title>
<composer>Fernandez</composer>
</track>
<track no=“10”>
<title>Same Difference</title>
<composer>Becckenstein</composer>
<composer>Fernandez</composer>
</track>
</cd>
<score>
<title>Morning Dance</title>
<group>Spyro Gyra>/group>
<composer>Beckenstein</composer>
<guitar>C dim 7 …</guitar>
</score>
</music>
20010126
ebis/etat/ebuy/xdia Joint Effort
7
Querying XML in the Traditional Way
Lorel:
1) select music.%
2) select music .%
where music .%.group = “Spyro Gyra”
20010126
ebis/etat/ebuy/xdia Joint Effort
8
•XML QL
Construct <score> {
where
<music>
<score></score>> Element_AS $s
</music>
CONSTRUCT $s
} </scores>
and
CONSTRUCT <favorite> {
WHERE
<music>
<$a>
<group>Spyro Gyra</group>
</>
</music>
CONSRUCT $x
} </favorite>
20010126
ebis/etat/ebuy/xdia Joint Effort
9
•VISIUAL LANGUAGE FOR XML:
•XING
Stands for
XML IN GRAPHIC
20010126
ebis/etat/ebuy/xdia Joint Effort
10
What can Visual language contribute to XML
•Eliminating textual and structure representation
of data.
•Querying of XML data can be accomplished
VIA pattern.
20010126
ebis/etat/ebuy/xdia Joint Effort
11
Criteria for XML VISUAL Language:
•Do not define textual query language
•Use simple and intuitive visualization
of XML
•Employ pattern matching
•Keep the system as simple as possible
20010126
ebis/etat/ebuy/xdia Joint Effort
12
CD
Year:1993
title:Dream Beyond Control
group:Spyro Gyra
Track
Visualization of music schema
No:1
title: walk the walk
composer:Fernande
XING
No:10
title:same differe
composer:Beckensi
composer :fernande
score
Title: morning dance
group: spyro Gyra
composer:Beckens
guitar:C dim 7
20010126
ebis/etat/ebuy/xdia Joint Effort
13
XML and visual Language:
•Support for XML
•Visual Languages contribution
•XML contribution to visual language
20010126
ebis/etat/ebuy/xdia Joint Effort
14
Visualization of XML:
•Well suited
•Attractive
•Can be easily exchanged between
computer
•Simple and interesting for end user
20010126
ebis/etat/ebuy/xdia Joint Effort
15
Document Metaphore:
•Free text together with categorized information
•Field consist of header and value
•Patterns or rules
20010126
ebis/etat/ebuy/xdia Joint Effort
16
Document Patterns:
• Patterns matching provides a light weight
approach to data processing
•Desired data is described by samples or patterns
•Usually a patterns consist of constants and
variables
20010126
ebis/etat/ebuy/xdia Joint Effort
17
Construct <score> {
where
<music>
<score></score>> Element_AS $s
</music>
CONSTRUCT $s
} </scores>
and
CONSTRUCT <favorite> {
WHERE
<music>
<$a>
<group>Spyro Gyra</group>
</>
</music>
CONSRUCT $x
} </favorite>
20010126
ebis/etat/ebuy/xdia Joint Effort
music
SCORE
In XING all Scores can be found
by the above pattern.
18
music
*
Group:Spyro gyra
music
CD
score
Group: Spyro Gyra
Group: Spyro Gyra
CDs and guitar scores of favorite Group
guitar:
20010126
ebis/etat/ebuy/xdia Joint Effort
19
Deep Query:
Is given by any pattern that is prefixed by an ellipsis,
meaning to look for that pattern at any nesting
depth within the searched document.
music
o
o
*
Composer: Beckenstein
20010126
ebis/etat/ebuy/xdia Joint Effort
20
Document rule:
•Document rule can be used to reformat or re-structure query
results.
•Consist of two document patterns that are joined by a
double arrow
P
Q
•P is called the argument pattern
•Q is called result pattern
20010126
ebis/etat/ebuy/xdia Joint Effort
21
Document Rules:
music
Piece {* }
favorite
piece
group:Spyro Gyra
20010126
ebis/etat/ebuy/xdia Joint Effort
22
Document Rules:
music
0
list
0
*
composer:Beckenstein
20010126
ebis/etat/ebuy/xdia Joint Effort
Composer
title
23
Conclusion
Bases on visual document metaphor and
the notation of document pattern and rules,
XING provides a direct and simple
way to locate and select information
in XML data resources.
Xing is usable by broad audience because the
interface is completely independent from
a complex, textual formal query language
20010126
ebis/etat/ebuy/xdia Joint Effort
24
XML-GL
We introduce a data model for XML documents, called XMLGDM (XML Graphical Data Model), which we use to represent
both the expected structure of
XML documents (i.e., their DTDs) and actual documents. The data
model has a graphical representation: a syntax directed translation
produces graphical schemas
of DTDs or of documents. We envision a typical use of XML-GL
in which users are presented with the graphical representation of
the DTD and can produce
queries in XML-GL with a WYSIWYG interface, with suitable
drag and fill commands.
20010126
ebis/etat/ebuy/xdia Joint Effort
25
The Requirements for an XML Query Language
XML is a recent recommendation of the World Wide Web
Consortium for a meta-language to define markups for content
publishing on the Web. Derived from
SGML, XML allows document producers to define and use the set of
tags that best mirrors the structure and conceptual properties of the
information they want to
publish.
The use of XML will bring a major change in the structure of Web
information, which will become more and more a collection of
semistructured objects, i.e., pieces
of content for which at least a partial representation of structure
(known as schema in the database lexicon) is available.
20010126
ebis/etat/ebuy/xdia Joint Effort
26
<!ELEMENT order (shipto, contact?, item+, date)>
<!ATTLIST order number PCDATA #REQUIRED>
<!ELEMENT shipto (fulladdress|reference)>
<!ELEMENT contact (reference|PCDATA)>
<!ELEMENT fulladdress (company, addressline+, city)>
<!ELEMENT reference EMPTY>
<!ATTLIST reference customer IDREF>
<!ELEMENT person (firstname?,lastname,fulladdress)>
<!ATTLIST person id ID>
<!ELEMENT company PCDATA>
<!ELEMENT addressline PCDATA>
<!ELEMENT city PCDATA>
<!ELEMENT date (day, month, year)>
<!ELEMENT day PCDATA>
<!ELEMENT month PCDATA>
<!ELEMENT year PCDATA>
<!ELEMENT item (book, quantity, discount?)>
20010126
ebis/etat/ebuy/xdia Joint Effort
27
An XML-GL query consists of four parts:
1. The extract part identifies the target of the query, by indicating the
target documents and the target elements inside these documents; by
drawing a parallel
2. The match part (optional) specifies logical conditions that the target
elements must satisfy in order to be part of the query result.
3. The construct part specifies the structure of the result document; the
same query can be formulated with different contruction parts, to
obtain results formatted differently.
4. The clip part (optional) specifies the elements from the target
documents to be retained in the constructed result.
20010126
ebis/etat/ebuy/xdia Joint Effort
28
Besides the basic features shown by these examples, XML-GL
addresses the remaining requirements by allowing:
String manipulation capabilities that enlarge the range of possible
queries.
The definition of the transitive closure of the containment and
reference relationships.
Arbitrary computation on document numeric content via built-in
functions.
The exploitation of element order in the documents.
The use of equivalence rules on XML documents and/or XML-GL
queries for defining similarity retrieval.
20010126
ebis/etat/ebuy/xdia Joint Effort
29
Questions!
20010126
ebis/etat/ebuy/xdia Joint Effort
30