XML database

Short description: Database presenting data in XML formats

This article needs to be updated. Please update this article to reflect recent events or newly available information. (March 2015)

|

An XML database is a data persistence software system that allows data to be specified, and stored, in XML format. This data can be queried, transformed, exported and returned to a calling system. XML databases are a flavor of document-oriented databases which are in turn a category of database.

## Contents

* 1 Rationale for XML as a database format
* 2 XML-enabled databases
* 2.1 Example of XML Type Query in IBM DB2 SQL
* 3 Integration with relational databases
* 4 Native XML databases
* 4.1 Language features
* 4.2 Supported APIs
* 5 Data-centric XML datasets
* 6 References

## Rationale for XML as a database format

Reasons to store data in XML format as an XML database include:[1] [2]

* An enterprise may have numerous XML documents with similar data, but dispersed in different XML formats. Conglomerating this data into a singular, standardized XML database structure will avoid compatibility issues
* Data may need to be exposed or ingested as XML, so using another format such as relational forces double-modeling of the data
* XML is very well suited to parse data, deeply nested data and mixed content (such as text with embedded markup tags)
* XML is human readable whereas relational tables require expertise to access
* Metadata is often available as XML
* Semantic web data is available as RDF/XML
* Provides a solution for Object-relational impedance mismatch[3]
* Compatibility with XML use on the data transport layer

## XML-enabled databases

XML-enabled databases typically offer one or more of the following approaches to storing XML within the traditional relational structure:

1. XML is stored into a CLOB (Character large object)
2. XML is `shredded` into a series of Tables based on a Schema[4]
3. XML is stored into a native XML Type as defined by ISO Standard 9075-14[5]

RDBMS that support the ISO XML Type are:

1. IBM DB2 (pureXML[6])
2. Microsoft SQL Server[7]
3. Oracle Database[8]
4. PostgreSQL[9]

Typically an XML-enabled database is best suited where the majority of data are non-XML. For datasets where the majority of data are XML, a native XML database is better suited.

### Example of XML Type Query in IBM DB2 SQL

select
id, vol, xmlquery('$j/name', passing journal as "j") as name
from
journals
where
xmlexists('$j[licence="CreativeCommons"]', passing journal as "j")

## Integration with relational databases

XML databases are often used in combination with relational databases to manage and store hierarchical data. A significant challenge in such integrations is extracting XML documents from relational databases, which requires specialized techniques and tools. These techniques often include:

1. Mapping Relational Data to XML: Schema mapping is a critical process that defines how relational tables correspond to XML elements and attributes.
2. XQuery Processing: Querying XML data extracted from relational databases may involve XQuery, a language designed for querying and transforming XML.

One of the most common scenario involves converting relational data into XML documents[10] to facilitate standards with systems relying on XML-based standards, such as web services or APIs. This process is important in applications where structured and semi-structured data co-exist and must be integrated perfectly.

For example, extracting hierarchical data from relational databases and converting it into XML is a common approach when generating XML feeds, exchanging data between systems, or implementing XML-based configurations.

## Native XML databases

Native XML databases are especially tailored for working with XML data. As managing XML as large strings would be inefficient, and due to the hierarchical nature of XML, custom optimized data structures are used for storage and querying. This usually increases performance both in terms of read-only queries and updates.[11] XML nodes and documents are the fundamental unit of (logical) storage, just as a relational database has fields and rows.

The standard for querying XML data per W3C recommendation is XQuery; the latest version is XQuery 3.1.[12] XQuery includes XPath as a sub-language and XML itself is a valid sub-syntax of XQuery. In addition to XPath, some XML databases support XSLT as a method of transforming documents or query results retrieved from the database.

### Language features

Template:Sort-under

Name  | License  | Native Language  | XQuery 3.1  | XQuery 3.0  | XQuery 1.0  | XQuery Update  | XQuery Full Text  | EXPath Extensions  | EXQuery Extensions  | XSLT 2.0  | XForms 1.1  | XProc 1.0

|
|
|
|
|
|
|
|
|
|
|
|

BaseX | BSD | Java  | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No
eXist | GNU LGPL | Java  | Partial | Partial | Yes | Proprietary | Proprietary | Yes | Yes | Yes | Yes | Yes
MarkLogic Server | Commercial  | C++  | No | Partial | Yes | Proprietary | Proprietary | No | No | Yes | Yes | No
OpenText xDB  | Commercial  | Java  | Partial  | Partial  | Yes  | Yes  | Yes  | No  | No  | No  | No  | No
Oracle Berkeley DB XML  | Commercial  | C/C++  |  |  |  |  |  |  |  |  |  |
Qizx | Commercial  | Java  | No | No | Yes | Yes | Yes | No | No | Yes | No | No
Sedna | Apache License 2.0  | C/C++  |  |  |  |  |  |  |  |  |  |

### Supported APIs

Name  | XQJ | XML:DB  | RESTful  | RESTXQ  | WebDAV

|
|
|
|
|

BaseX  | Yes | Yes | Yes | Yes | Yes
eXist  | Yes | Yes | Yes | Yes | Yes
MarkLogic Server  | Yes | No | Yes | Yes | Yes
Qizx  | No | No | Yes | No | No
Sedna | Yes | Yes | No | No | No

## Data-centric XML datasets

For data-centric XML datasets, the unique and distinct keyword search method, namely, XDMA[13] for XML databases is designed and developed based on dual indexing and mutual summation.

## References

1. ↑ Nicola, Matthias (28 September 2010). "5 Reasons for Storing XML in a Database". http://nativexmldatabase.com/2010/09/28/5-reasons-for-storing-xml-in-a-database/.
2. ↑ Feldman, Damon (11 April 2013). "Moving from Relational Modeling to XML and MarkLogic Data Models". MarkLogic World. http://www.marklogic.com/resources/slides-moving-from-relational-modeling-to-xml-and-marklogic-data-models/resource_download/presentations/. Retrieved 17 March 2015.
3. ↑ [NoSQL Distilled: A Brief Guide to the Emerging World of Polyglot Persistence. Addison-Wesley Educational Publishers Inc, 2009] ISBN 978-0321826626
4. ↑ "XML Schema Storage and Query: Basic". Oracle XML DB Developer's Guide, 10g Release 2. Oracle Corporation. August 2005. http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/xdb05sto.htm. Retrieved 17 March 2015. . Section Creating XMLType Tables and Columns Based on XML Schema
5. ↑ "ISO/IEC 9075-14:2011: Information technology -- Database languages -- SQL -- Part 14: XML-Related Specifications (SQL/XML)". International Organization for Standardization. 2011. http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=53686.
6. ↑ "pureXML overview -- DB2 as an XML database". IBM. http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.1.0/com.ibm.db2.luw.xml.doc/doc/c0022308.html.
7. ↑ "Using XML in SQL Server". Microsoft Corporation. https://msdn.microsoft.com/en-us/library/ms190936.aspx.
8. ↑ "XMLType Operations". Oracle XML DB Developer's Guide, 10g Release 2. Oracle Corporation. August 2005. http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/xdb04cre.htm. Retrieved 17 March 2015.
9. ↑ "8.13. XML Type". PostgreSQL 9.6 Documentation. https://www.postgresql.org/docs/9.6/static/datatype-xml.html. Retrieved 1 April 2017.
10. ↑ "Extracting XML Documents from Relational Databases - 7 Tips" (in en-US). 2025-01-01. https://vividorigins.com/xml-documents-from-relational-databases/.
11. ↑ Matthias, Nicola (22 August 2010). "XML versus Relational Database Performance". https://nativexmldatabase.com/2010/08/22/xml-versus-relational-database-performance/.
12. ↑ "XQuery 3.1 Recommendation". 2017-03-21. http://www.w3.org/TR/xquery-31/.
13. ↑ Selvaganesan, S.; Haw, Su-Cheng; Soon, Lay-Ki (2014). "XDMA: A Dual Indexing and Mutual Summation Based Keyword Search Algorithm for XML Databases" (in en-US). International Journal of Software Engineering and Knowledge Engineering 24 (4): 591–615. doi:10.1142/s0218194014500223.

* v
* t
* e

Database models

Common models|

* Flat
* Hierarchical
* Dimensional
* Network
* Relational
* Entity–relationship
* Enhanced
* Graph
* Object-oriented
* Entity–attribute–value

Other models|

* Associative
* Correlational
* Multidimensional
* Array
* Semantic
* Star schema
* XML database

Implementations|

* Flat file
* Column-oriented
* Document-oriented
* Object-relational
* Deductive
* Temporal
* XML data store
* Key-value store
* Triplestore

* v
* t
* e

Database management systems

Types|

* Object-oriented
* comparison
* Relational
* comparison
* Document-oriented
* Graph
* NoSQL
* NewSQL

Concepts|

* Database
* ACID
* Armstrong's axioms
* CAP theorem
* CRUD
* Null
* Candidate key
* Foreign key
* Superkey
* Surrogate key
* Unique key

Objects|

* Relation
* table
* column
* row
* View
* Transaction
* Transaction log
* Trigger
* Index
* Stored procedure
* Cursor
* Partition

Components|

* Concurrency control
* Data dictionary
* JDBC
* XQJ
* ODBC
* Query language
* Query optimizer
* Query rewriting system
* Query plan

Functions|

* Administration
* Query optimization
* Replication

Related topics|

* Database models
* Database normalization
* Database storage
* Distributed database
* Federated database system
* Referential integrity
* Relational algebra
* Relational calculus
* Relational database
* Relational model
* Object-relational database
* Transaction processing

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/XML database. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=XML_database&oldid=4143426"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template