XML and Database.

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

Chungnam National University DataBase System Lab
Native XML Database or RDBMS. Data or Document orientation If you are primarily storing documents, then a Native XML Database may be the best option.
XML: Extensible Markup Language
XML DOCUMENTS AND DATABASES
Tamino – a DBMS Designed for XML Dr. Harald Schoning Presenter: Wenhui Li University of Ottawa Instructed by: Dr. Mengchi Liu Carleton University.
1 XQuery Web and Database Management System. 2 XQuery XQuery is to XML what SQL is to database tables XQuery is designed to query XML data What is XQuery?
Lecture-5 Though SQL is the natural language of the DBA, it suffers from various inherent disadvantages, when used as a conventional programming language.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 13-1 COS 346 Day 25.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
Visual Web Information Extraction With Lixto Robert Baumgartner Sergio Flesca Georg Gottlob.
1 COS 425: Database and Information Management Systems XML and information exchange.
3-1 Chapter 3 Data and Knowledge Management
Mark Graves Leveraging Existing DBMS Storage for XML DBMS.
XML and The Relational Data Model
XML –Query Languages, Extracting from Relational Databases ADVANCED DATABASES Khawaja Mohiuddin Assistant Professor Department of Computer Sciences Bahria.
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
2.2 SQL Server 2005 的 XML 支援功能. Overview XML Enhancements in SQL Server 2005 The xml Data Type Using XQuery.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
Databases and LINQ Visual Basic 2010 How to Program 1.
ASP.NET Programming with C# and SQL Server First Edition
Embracing the Value of XML in Institutional Research Jim Few Center for Institutional Effectiveness Kennesaw State University Association.
XML in SQL Server Overview XML is a key part of any modern data environment It can be used to transmit data in a platform, application neutral form.
DATABASE and XML Moussa Mané. Learning Objectives ● Learn about Native XML Databases ● Learn about the conversion technology available ● Understand New.
By Intan, Chan & Lina February, 2003 XML Databases.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
© Paradigm Publishing Inc. 9-1 Chapter 9 Database and Information Management.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
DAY 14: ACCESS CHAPTER 1 Tazin Afrin October 03,
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
Demystifying the eXtensible Markup Language Nick Roberts & Jim Few
XML as a Boxwood Data Structure Feng Zhou, John MacCormick, Lidong Zhou, Nick Murphy, Chandu Thekkath 8/20/04.
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
CHAPTER:14 Simple Queries in SQL Prepared By Prepared By : VINAY ALEXANDER ( विनय अलेक्सजेंड़र ) PGT(CS),KV JHAGRAKHAND.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
Object Persistence (Data Base) Design Chapter 13.
XML and Database COSC643 Sungchul Hong. Is XML a Database? Yes but only in the strictest sense of the term. It is a collection of data. (some sort) XML.
1 Design Issues in XML Databases Ref: Designing XML Databases by Mark Graves.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 8 Advanced SQL.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
1 DBS201: Introduction to Structure Query Language (SQL) Lecture 1.
Chapter 27 The World Wide Web and XML. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.27-2 Topics in this Chapter The Web and the Internet.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
1 JAXP & XPATH. Objectives 2  XPath  JAXP Processing of XPath  Workshops.
Computing & Information Sciences Kansas State University Friday, 20 Oct 2006CIS 560: Database System Concepts Lecture 24 of 42 Friday, 20 October 2006.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Session 1 Module 1: Introduction to Data Integrity
CIS 250 Advanced Computer Applications Database Management Systems.
Introduction to Databases Angela Clark University of South Alabama.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
2) Database System Concepts and Architecture. Slide 2- 2 Outline Data Models and Their Categories Schemas, Instances, and States Three-Schema Architecture.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
( ) 1 Chapter # 8 How Data is stored DATABASE.
XML Databases Presented By: Pardeep MT15042 Anurag Goel MT15006.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
XML: Extensible Markup Language
XML and Databases.
Database.
MANAGING DATA RESOURCES
Web DB Programming: PHP
Data Model.
Business Application Development
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Chapter 8 Advanced SQL.
The ultimate in data organization
Presentation transcript:

XML and Database

Objectives Types of XML Databases Mapping Document Schema to Database Schema Query Language Workshops

XML as DB XML is suitable for database because it handles the data in similar fashion like relational database. The XML database allows data to be manipulated in the XML format. The reason to use XML as database are: Easier to store data in XML format. Wider use of XML for data transport. Minimal cost of data conversion. XPath is used to navigate XML documents and is also used for finding information in an XML document using path expression XQuery, that is built on XPath expressions, is used for finding and extracting elements and attributes from XML documents

XML DB The XML database There are two types: Can be used more efficiently in comparison to other conventional databases when dealing with small amount of data, few users, and a moderate performance requirement. Has some advantages over the conventional database It is portable. It is self-describing in nature. It stores data in nodes. It allows nested and multiple data entries. There are two types: XML-Enabled: maps all XML data to a traditional database Native XML Depends on XML & uses XML documents & elements as the central unit of storage. The benefits It keeps data in one place. It is faster in terms of performance. It can store very large documents.

Document The XML document database Is a collection of XML documents and its parts maintained by a system. May be a database of structures documents or unstructured data. There are two types Data-Centric Documents An XML document is used as storage for data that is structured and appears in a regular order. Is similar structure throughout the document Document-Centric Documents XML is used to create semi-structured documents with irregular content. Is irregular structure throughout the document Feasible: thuan tien, tien loi

Data-Centric <?xml version="1.0" encoding="UTF-8"?> <soccer> <player> <name>David Beckham</name> <matches>50</matches> <goals>70</goals> <penalties>15</penalties> </player> <name>Diego Maradona</name> <matches>200</matches> <goals>100</goals> <penalties>30</penalties> </soccer>

Document Centric <?xml version=“1.0”?> <Book> <Chapter>Networking</Chapter> <Objective>Introduction></Objective> <Objective>Introduction to networks</Objective> <Objective>Introduction to TCP/IP</Objective> <Objective>IP Addressing</Objective> <para> In the previous chapter, we have discussed the JDBC and database access, the JDBC architecture and JDBC-ODBC driver. The four different drivers of JDBC are: </para> </Book>

Relation DB An XML document can be considered as a relational database The document node is considered as a database. The element nodes are considered as tables in a database. An element node along with its only child node of type data node is considered as a field in a table. The child nodes of an element node are considered as records in a table. Absence of a field node in an XML document is considered as null value. Request parameter and Request method

Native XML DBs Some of the features Allow Data Storage in XML Format Enables Query for Data in Collections Provides Query Language to Access Data Enables Updating Data in Collections Spawn: de trung, tao ra

Native XML DBs (cont) Advantages Have robust features to maintain data stored in databases The storage performance is very high, so that you can retrieve the original and unparsed document piece by piece The partial retrieval feature is important in development particularly to identify bugs and enhance performance Enable to sort the data stored in database using an indexing technique Can jump directly to the ID value of the data rather than traversing the whole tree Can store any type of XML data but this is not the true replacement of the existing database systems Is not used as a stand-alone database Spawn: de trung, tao ra

Table-based mapping Uses the data in an XML document & maps it with a relational DB. Is efficient to handle similar type of data. Is used for exchanging data between XML documents & RDBMS. Advantages Matching the structure of table is easier. Coding is simpler. Accessing data is faster. Disadvantages It works on a small part of an XML document. It cannot maintain the physical structure of an XML document Spawn: de trung, tao ra

XML Object mapping The object relational mapping uses XML documents as a tree of objects. These objects are specific to the XML document, which are mapped to the database. Is used due to some drawback, such as limited access to XML documents, of the table-based mapping and use of middleware tools. Is highly vulnerable to problems while handling mixed contents Spawn: de trung, tao ra

Query Language Template-Based Query Language SQL-Based Query Language Template is a system, which is used to rapidly generate some outputs through a pre-defined program. Template-based query generates the content from XML sources and produces one result per child in the root node. The query deals with many aspects such as: Variables: point to an attribute set on the node of an XML database Attributes: are used with the XPath expression to filter the XML data from database Parameters: are used to get the desired result from the database SQL-Based Query Language Such as XQuery and SQL/XML, use portable queries to get XML data SQL/XML Is easy to use because it uses some additional queries from the existing SQL language. Are completely different technologies used in the industry though there is a similarity in the name. Is a technology used in SQL Server to import XML data into an SQL Server db Spawn: de trung, tao ra

XQuery Is developed by the XML Query Working Group Is extensively used as a query language for XML. Is particularly designed to create queries not only on XML data but also on any data presented in XML format. Features It is used for querying XML data. It is built on XPath expressions. It extracts information using Web services. It is used to transform XML data to XHTML. It is case-sensitive. Some of the specifications of XQuery are Elements, attributes, and variables should use valid XML names. String values should be enclosed in a single or double quotes. Variables should begin with a $ sign. Comments should be delimited by:. Keywords are case sensitive and should be of lowercase characters Spawn: de trung, tao ra

Example <?xml version="1.0" encoding="UTF-8"?> <table> <row> <id>0001</id> <firstname>Bob</firstname> <lastname>Aranow</lastname> <street>2 Any St.</street> <city>Anytown</city> <state>NY</state> <zip>22000</zip> </row> <id>0002</id> <firstname>Charles</firstname> <street>3 Any St.</street> <state>AL</state> </table> Spawn: de trung, tao ra

Example (cont) public class XQueryTableMappingEx { public static void main (String[] args) { try { Document doc = new Builder().build (new File(“Person.xml”)); Nodes node = XQueryUtil.xquery (doc, "//table/*"); System.out.println("Out of " + node.size () + " people "); node = XQueryUtil.xquery (doc, "//table/row[state=‘NY']"); System.out.println(node.size () + " stay in " + args[1]); }catch(Exception e){ e.printStackTrace (); } Spawn: de trung, tao ra

Data integrating issues Keeping data as a single unit is known as data integrity. Some of the measures that are available in XML to handle data integrity issues are: XML Validation: The content, structure, and data types of an XML document are validated. Must be performed when data integrity is required. Helps the XML data to be well formed and also checks for the semantic mistakes in XML document. Check Constraints Helps to put certain restrictions on the XML columns. The insertion or updating of data in the XML column can be performed only when the constraint criteria is satisfied. Trigger Processing A trigger is a set of statements, which automatically performs an action when a specific operation, such as insert, update, or delete occurs in a table. Triggers have two parts, event and action is used to maintain the data integrity by checking data in a consistent manner. Spawn: de trung, tao ra

WORKSHOP ACTIVITIES Building the console Java application using XQuery can do Query the XML document with get the introduction of the inputted country Query to find number of people living at the inputted state from XML document