Sign In/My Account | View Cart  
advertisement

Article:
 Going Native: Making the Case for XML Databases
Subject: XML data model vs. relational model
Date: 2005-04-01 22:55:46
From: rpbourret
Response to: XML data model vs. relational model

There are actually a number of XML data models. For example, DOM, SAX, XPath 1.0, XQuery 1.0 / XPath 2.0, and the Infoset all explicitly or implicity define data models. What these all have in common is that they are ordered trees of nodes (elements, attributes, text, etc.) and scalar values. (The XQuery data model is actually an ordered forest.)


Although it's not quite technically correct, it's easiest to think of the XML data model as a DOM tree. No markup in sight -- just an ordered hierarchy of nodes, with values at the leaves.


There is no single XML data model used by all native XML databases. This is because most native XML databases predate XQuery and some even predate XPath. Consequently, many invented their own query languages and corresponding data models. Currently, the most common query language in native XML databases is XPath (with extensions for multi-document queries). In the future it will be XQuery. For information about the XQuery / XPath 2.0 data model, see http://www.w3.org/TR/xpath-datamodel/


As Michael noted, there isn't anything you can model with the XML data model but not the relational data model. In fact, there is a generic mapping from DTDs to relational schemas (see http://www.xml.com/lpt/a/2001/05/09/dtdtodbs.html). The only problem will occur with schemaless XML, and you can always map that to a generic set of tables (Elements, Attributes, etc.)


So to quote Michael again, the problem is practical, not theoretical. For example, if you map the XHTML schema to a relational schema, the p element alone is mapped to 36 different tables. As you can imagine, reconstructing an XHTML document requires an impractical number of joins.


Previous Message Previous Message Move up to Parent Message Up Next Message Next Message


Full Text Titles Only Newest First

Sponsored By: