and di s t r i b u t e d databases on the web nathaniel ayewah cse 8330 presentation smu
TRANSCRIPT
Overview
XML Technologies
XML and Databases
Will XML supplant Relational DBs?
Querying XMLQuerying XML
Different ApproachesDifferent Approaches
XML Example(a) HTML
<html> <body> <h1>Southern Methodist
Universiy</h1> <p>PO Box 0133, Dallas, TX
75275</p> <p>SMU is a private university of more
than 11,000 students near the vibrant heart of Dallas.</p>
</body></html>
(b) XML
<?xml version=”1.0”?><school> <name>Southern Methodist
University</name> <address> <box>PO Box 0133</box> <city>Dallas</city> <state>TX</state> <zipcode>75275</zipcode> </address> <description>SMU is a private university
of more than 11,000 students near the vibrant heart of Dallas. </description>
</school>
meta languagemeta language
On Data and Documents
Data-centric .Regular StructureRegular Structure
<departments> <department id=”CSE”> <name>Computer Science</name> <facultysize>23</facultysize> <rating>Excellent</rating> </department> <department id=”EE”> <name>Electrical Engineering</name> <facultysize>4353</facultysize> <rating>O.K.</rating> </department></departments>
. Document-centricIrregular StructureIrregular Structure
<advertisement> <header>Rock the SEAS Vote! <what>Vote for your favorite faculty member.</what> </header> <description> Once a year, you get to choose your <bold>favorite faculty member</bold>. That time has come again. <when>March 25 to April 1</when> <how>Stop by the CSE office</how> <why>because you care</why> </description></advertisement>
vs
XML Technologies
XSLTXSLT
XQueryXQuery
XML-QLXML-QLXPathXPath
XQLXQLXSL-FOXSL-FO
XPointerXPointer
XML SchemaXML Schema
DTDDTDSAXSAX
DOMDOM
XML EncryptionXML Encryption
XML SignatureXML Signature
SOAPSOAP
UDDIUDDI
WSDLWSDL
XML Technologies
Validation and Structure Query Languages** Parsing and Processing Transformation and Presentation
Validation and Structure
DTD
<!ELEMENT departments (department+)><!ELEMENT department (name, facultysize, rating)><!ELEMENT name (#PCDATA)><!ELEMENT facultysize (#PCDATA)><!ELEMENT rating (#PCDATA)>
<!ATTLIST department id ID #REQUIRED>
Query Languages
Document Community
Database Community
W3C
[XPath/XQL][XPath/XQL]
[XML-QL][XML-QL]
[XQuery][XQuery]
“What is the size of the Computer Science Faculty?”
XQL
Document(“departments.xml”)//department [@id = “CSE”]/facultysize
Output: <facultysize>23</facultysize>
“What is the size of the Computer Science Faculty?”
XML-QL
WHERE <department id=$c> <name>$n</name> <facultysize>$f</facultysize> <rating>$r</rating> </department> IN “departments.xml”, $c = “CSE”
CONSTRUCT <result>$f</result>
Output: <result>23</result>
“What is the size of the Computer Science Faculty?”
XQuery
for $b in doc(“departments.xml”)//departmentlet $d := $b/facultysizewhere $b/@id = “CSE”return <result>{$d}</result>
Output: <result>23</result>
http://support.x-hive.com/xquery/index.html
<descriptive-catalog> { for $i in fn:doc("catalog.xml")//item, $p in fn:doc("parts.xml")//part[partno = $i/partno], $s in fn:doc("suppliers.xml")//supplier[suppno = $i/suppno] order by $p/description, $s/suppname return <item> { $p/description, $s/suppname, $i/price } </item> }</descriptive-catalog>
XQuery: Joins
Source: http://www.w3.org/TR/xquery
Classification
Data view Virtual view Query view(d) (v) (q)
Classification: Td,v,q d, v, q {R, X, H, N}
R = Relational Data ModelX = XML Data ModelH = Hybrid Data ModelN = View does not exist
Products
Native XML
XML Enabled
Middleware or XML Server
Wrappers
Standalone XML XQuery Engine
Content Management System
TX,X,X
TR,X,X TR,R,X?
http://www.rpbourret.com/xml/XMLDatabaseProds.htm
TR,R,R
TR,X,X
TR,X,N
TX,R,R
TX,N,X
TX,X,X
XML-Enabled
Relation: Departments XML
ID Name Size <database> <departments> <row> <ID>CSE</ID> <NAME>Computer Science</NAME> <SIZE>234</SIZE> </row> <row> <ID>EE</ID> <NAME>Electrical
Engineering</NAME> <SIZE>334</SIZE> </row> </departments></database>
CSE Computer Science 234
EE Electrical Engineering 334
Default View
Native XML Database
Native Relational
XML Document
Collection
Physical Storage
Tuple(s)
Relation
XML::DB Initiative http://www.xmldb.org
Berkeley DB XML
XML Data Model over Physical Berkeley DB storage system
Native XML Storage
Supports transactions, recovery, indexing, replication, multiple users and concurrency, query processing, standards
C++/Java APIs
http://www.sleepycat.com/products/xml.shtml
Current/Future Research Issues
Physical Storage Query Optimization Distributed Processing/Optimization Static vs Dynamic Processing First, Last, Partial Results Updates