Download presentation
Presentation is loading. Please wait.
1
IS432 Semi-Structured Data
Lecture 6: XML Mapping to Object/Relational Databases Dr. Gamal Al-Shorbagy
2
-----------------------------
Table Based Mapping <A> <B> <C>ccc</C> <D>ddd</D> <E>eee</E> </B> <C>fff</C> <D>ggg</D> <E>hhh</E> </A> Table A C D E ccc ddd eee fff ggg hhh
3
Table Based Mapping <Tables> <Table_1> <Row>
<Column_1>...</Column_1> ... <Column_n>...</Column_n> </Row> ... <Column_1>...</Column_1> </Table> <Tables> <Table_1> <Row> <Column_1>...</Column_1> ... <Column_n>...</Column_n> </Row> </Table_1> <Table_n> <Column_m>...</Column_m> </Table_n> </Tables>
4
Table Based Mapping Advantages Disadvantages Simplicity
Easy to write code Easy to transfer data between XML and Database Disadvantages Too simple to work with complex XML documents Does not preserve physical structure Such as character and entity references, CDATA sections, Character encodings The document type or DTD Comments, or processing instructions.
5
XML-Object-Relational Mapping
RDB <XML/> Instance
6
XML-Object-Relational Mapping
7
XML-Object-Relational Mapping
Instance RDB DTD DTD Object Schema Relational Schema
8
Object Relational Mapping
9
Object Relational Mapping
10
Object Relational Mapping
Object SalesOrder{ number =1234; customer = “Abdullah”; date = ; items = {pointer to Item objects}; } Object Item{ number =1; item = “CD-ROM”; Quantity = 1; price = 25; } Object Item{ number = 2; item = “DRAM”; Quantity = 1; price = 65; }
11
Object Relational Mapping
SalesOrder number customer date 1234 Abdullah …. Items sonumber number Item quantity price 1234 1 CD-ROM 25 2 DRAM 65
12
Sub Elements - Composition
13
Element Occurrence Constraints
14
Object-Relational Mapping
15
Mapping Complex Content Models
<!ELEMENT A (B?, (C | ((D | E | F | G)*, (H | I)+, J?)))>
16
Mapping Sequences
17
Mapping Choices
18
Mapping Repeated Children
19
Mapping Groups
20
Mapping Attributes
21
Mapping Attributes
22
Take Home Quiz Create XML Schema/XML to store data in following relational database tables. Students Name ID Book_ID Ahmad 0001 1111 Ali 0002 1112 Hassan 0003 1113 Books Book_ID Title Author 1111 XML for Dummies Ahmad Ali 1112 Semi Structured Data 1113 XML in Summer
23
Thanks
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.