Presentation is loading. Please wait.

Presentation is loading. Please wait.

XML과 Database 홍기형 성신여자대학교 성신여자대학교 홍기형.

Similar presentations


Presentation on theme: "XML과 Database 홍기형 성신여자대학교 성신여자대학교 홍기형."— Presentation transcript:

1 XML과 Database 홍기형 성신여자대학교 성신여자대학교 홍기형

2 차례 Database, Web, and XML XML Database Systems Data Models
Query Language and Processing Storage and Index Other issues 성신여자대학교 홍기형

3 Database and Web, before XML
DB : a back-end server for Web Applications CGI JDBC Embedded SQL Web Information Retrieval Target to manage (Web DB) Thin Client Scripts Middle Tier HTML Web Server Template Engine Scripts HTML Templates Application Server Application Code Mapping Code Back End 성신여자대학교 홍기형

4 XML eXtensible Markup Language
A new emerging standard for data representation and exchange on the internet See the XML catalog , Separating content from presentation Easy to provide multiple view of the same data Easily parsed and self-describing 성신여자대학교 홍기형

5 XML Extensible — a dynamic data model
Simple — human-readable, easy to use Flexible — for handling complex data Portable — for cross-platform data exchange Standard — easy to integrate, widely adopted It is important that these points are clear. To understand these benefits is to understand the difference between different XML tools. Most tools support the benefits at the top of the list, but to fully leverage XML, a tool has to support the entire list. Simple: a data format that is as easy to use as HTML. Extensible: the biggie - it is a dynamic data mode so that you are not locked into a rigid data model. Flexible: Just because it is simple does not mean that it is limited. XML is flexible enough to handle all the complex data that today’s apps rely on including relationships and hierarchical info. Portable: just like HTML and Java Standard: all the benefits of standards (plug and play, easy to learn) apply here BREAK FOR DEMO 성신여자대학교 홍기형

6 HTML과 XML 문서 비교 성신여자대학교 홍기형

7 Data mixed with presentation
XML Is All About Data HTML example: <heading1> Invoice </heading1> <bold>To: Joe Bloggs <P> From: J. Abrams <P> Date: 2/1/1999<P> Amount: $100 <P> Tax: 21% <P> Total $121 </bold> Data mixed with presentation Let’s illustrate the difference between HTML and XML, and demonstrate where HTML falls short. Here is some HTML that shows an invoice from a guy named Joe. But if you look at the HTML, all that it can tell you is that “Joe” should be displayed in bold because (click) HTML mixes data with presentation. This is why XML was born. (click) It comes to you from the World Wide Web Consortium (W3C), the same people who brought you HTML. This example shows you the same invoice in XML. The first thing you will notice is that it is (click) human readable. It is ASCII so it is readable as well as portable. Also, XML includes tags (click) so that even though I haven’t told you anything about this data in advance, you can read it and easily understand the data in this invoice. This is essential for sharing data over the Web. But the killer feature of XML - XML Nirvana - is that XML is (click) extensible. If, all-of-a-sudden, you want to keep Joe’s address - no problem! You can easily add a new field to a single data object without disrupting any of your existing data. XML is a dynamic data model (!!), which means that you can easily expand to add new and unanticipated functions to your business or work with new partners. For database people: no schema evolution!!! 성신여자대학교 홍기형

8 XML Is All About Data Human Readable Comes with Tags XML example:
<Invoice> <Customer> Joe Bloggs </Customer> <From> J. Abrams </From> <Date year=‘1999’ month=‘2’ day = ‘1’ /> <Amount unit = ‘Dollars’> 100 </Amount> <TaxRate> 21 </TaxRate> <Total currency = “Dollars”>121 </Total> </Invoice> Comes with Tags 성신여자대학교 홍기형

9 XML Is All About Data Extensible XML example: <Invoice>
<Customer> <Name>Joe Bloggs </Name> <Address> 25 Mall Road </Address> </Customer> <From> J. Abrams </From> <Date year=‘1999’ month=‘2’ day = ‘1’ /> <Amount unit = ‘Dollars’> 100 </Amount> <TaxRate> 21 </TaxRate> <Total unit = “Dollars”>121 </Total> </Invoice> <Name>Joe Bloggs </Name> <Address> 25 Mall Road </Address> 성신여자대학교 홍기형

10 XML Family of Standards
DOM (Document Object Model) XML Namespaces XSL (style language) XQL (XSL query language) XML Data / DCD / Schema XUL (updates, future) …many more XML is more than just a data format, it comes with a family of interface standards for accessing and manipulating the data. The W3C continues to pump these out, with many new additions in the years to come. Object Design is a member of the W3C, and is actively involved with developing these standards. So let’s take a look at some of these standards, which today’s tools must support to fully leverage XML: XML is the data format standard DOM is the API for writing apps on top of XML XML Namespaces (recommended): how to differentiate between two tags of the same name but in different contexts. Such as the name of the book versus the name of the buyer of the book. These three are recommended by the W3C (I.e. are standards today) and the following are still in the process of being finalized: XSL: XML Style Language (2nd working draft) - lets you present the data in various styles - order the data, filter it (similar to a select statement). XQL: XML Query language (draft) - a standard way of querying XML data (similar to SQL) XML Data: ways of handling application (non-document) data. We are very involved with those committees at the W3C (target date for Proposed Recommendation is 9/99). XUL: XML update language for updating an XML document at the element level. This is still just at the idea stage. 성신여자대학교 홍기형

11 Building Web Applications with XML
Thin Client Scripts Quickly react to changes Lower maintenance costs Does not depend on a single vendor Middle Tier HTML Web Server / App Server XSL Application Code DOM XML Server Standard API and Template Language XML Back End 성신여자대학교 홍기형

12 Legacy DBs for XML Applications
XML as a new data-exchange format for legacy DB applications DB2XML Transforming the results of database queries or complete databases into XML documents or into HTML documents using XSLT stylesheets. DB2XML can be used: as a standalone tool (with GUI or command line), as a servlet to dynamically generate XML-documents using the DB2XML API 성신여자대학교 홍기형

13 XML Database Systems 3 approaches Build special-purpose systems
Lore, Strudel Best performance for XML data Use object-oriented database systems eXelon, Monet, Ozone Object-oriented modeling Use relational database systems Oracle, Microsoft Matured large market 성신여자대학교 홍기형

14 Lore Query Processor Data Engine Textual Interface Query Plan
Generator Preprocessing (Lorel2OQL) Parsing Applications HTML GUI Utilities Query Operators Object Manager Optimizer External Data API Physical Storage External, Read-only Data Sources queries Non-query Requests Query Processor Data Engine 성신여자대학교 홍기형

15 eXelon 성신여자대학교 홍기형

16 Oracle 8i 성신여자대학교 홍기형

17 Data Models for XML XML is not a data model
Structure of an XML document an ordered list of elements each element may have a set of attributes may have (sub)elements (nested elements) Structured data and full text mixed together DOM defines how to translate an XML document into a data structure for processing Need a true data model for XML data 성신여자대학교 홍기형

18 OEM: a Semi-structured Data Model
Object Exchange Model (Lore) Semi-structured Data Self-describing structure, the lack of schema the structure changes rapidly and unpredictably Labeled direct graph Node : Object (OID) or atomic value (leaf) Labeled Edge : object-subobject relationship 성신여자대학교 홍기형

19 OEM, an example <DBGroup> <Member Name=“유” Advisor=“m1”>
<Age>28</Age> </Member> <Member ID=“m1”, Project=“p1”> <Name>박</Name> <Advisor>홍</Advisor> <Project ID=“p1” Member=“m1”> <Title>XML DB</Title> </Project> </DBGroup> DBGroup &1 Member Project Member &2 &3 &4 {Name=“Smith”, Advisor=“m1”} {ID=“m1, Project=“p1”} {ID=“p1, Project=“m1”} Age Name Advisor Title &5 &6 &7 &8 Text Text Text Text &12 &9 &10 &11 “28” “박” “홍” 성신여자대학교 홍기형

20 Issues in Data Modeling
How to simultaneously view XML information in both a set of documents a single large database No loss of information in XML How to represent the Ordering of elements external/internal entities, processing instructions 성신여자대학교 홍기형

21 XML DB Design When should attributes (subelements) be used? Is a 1-to-1 relationship best represented using element nesting or IDREFs? How to translate the conceptual model (OEM?) into an XML encoding? Need to identify the relationship between DTDs and traditional DB schema 성신여자대학교 홍기형

22 Query Languages for XML DB
Requirements Path Expressions Queries over the structured and semistructured data full text the mixture of data elements and full text W3C, Query Languages for the Web, 1998 QL for semistructured data Lorel, UnQL XQL, XML-QL 성신여자대학교 홍기형

23 XML-QL Syntax Select <variable-list> where <XML-pattern>+ Example select $n, $h where <person> <age=$a> <name> $n </name> <address> 서울 성북구 동선동3가</address> [<hobby> $h </hobby>] </person>, $a > 18 성신여자대학교 홍기형

24 Issues in Query Processing
The true requirements for XML QL is not known Need to review all facets of traditional query processing Need to Develop a new IR model proximity in XML documents similarity measure between XML elements 성신여자대학교 홍기형

25 How to integrate Optimization Schemes
traditional (DB) query processing model and information retrieval model Optimization Schemes for not well-structured XML data for queries mixed with full text retrieval and structured/semistructured search 성신여자대학교 홍기형

26 Storage Structure and Indexing
Clustering schemes for storing XML data New index types for quickly finding certain elements, attributes, and more complex structural patterns element orderings Determine the level of parsing for storing XML documents Based on the analysis of encoding pattern merging identical text strings (sub-patterns) by using appropriate IDREFs compression based on regular patterns 성신여자대학교 홍기형

27 Issues in Various DB Features
Full view support for XML both virtual and materialized views incremental maintenance XSL as a view definition language Data integrity issue What are constraints on XML data? key, referential, domain How to represent the constraints How to check them when changes occur 성신여자대학교 홍기형

28 Transaction Control over XML database Performance Evaluation
Trigger active database capabilities in XML Transaction Control over XML database Performance Evaluation need to make an appropriate benchmark for XML data XML data set query types mix of queries and updates 성신여자대학교 홍기형

29 References Research issues Storing XML data into RDBMSs
Data Management for XML: Research Directions, More on Data Management for XML, Storing XML data into RDBMSs A Performance Evaluation of Alternative Mapping Schemes for Storing XML Data in a Relational Database, ercim.inria. publications/RR-3680 XML Database Systems 성신여자대학교 홍기형


Download ppt "XML과 Database 홍기형 성신여자대학교 성신여자대학교 홍기형."

Similar presentations


Ads by Google