XML database: Difference between revisions
imported>Stesmo →External links: Pruned external links to meet WP:EL. Use as cites to source claims, as appropriate, in the article. |
imported>InternetArchiveBot Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5 |
||
| (One intermediate revision by one other user not shown) | |||
| Line 2: | Line 2: | ||
{{update|date=March 2015}} | {{update|date=March 2015}} | ||
An '''XML database''' is a | 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. | ||
== Rationale for XML as a database format == | == Rationale for XML as a database format == | ||
Reasons to store data in XML format as an XML database include:<ref name=nicola2010>{{cite web|last1=Nicola|first1=Matthias|title=5 Reasons for Storing XML in a Database|url=http://nativexmldatabase.com/2010/09/28/5-reasons-for-storing-xml-in-a-database/|website=Native XML Database|access-date=17 March 2015|date=28 September 2010}}</ref> | Reasons to store data in XML format as an XML database include:<ref name=nicola2010>{{cite web|last1=Nicola|first1=Matthias|title=5 Reasons for Storing XML in a Database|url=http://nativexmldatabase.com/2010/09/28/5-reasons-for-storing-xml-in-a-database/|website=Native XML Database|access-date=17 March 2015|date=28 September 2010|archive-date=25 March 2015|archive-url=https://web.archive.org/web/20150325150652/http://nativexmldatabase.com/2010/09/28/5-reasons-for-storing-xml-in-a-database/|url-status=dead}}</ref> | ||
<ref name=feldman2013>{{cite conference|last1=Feldman|first1=Damon|title=Moving from Relational Modeling to XML and MarkLogic Data Models|url=http://www.marklogic.com/resources/slides-moving-from-relational-modeling-to-xml-and-marklogic-data-models/resource_download/presentations/|conference=MarkLogic World|conference-url=http://world.marklogic.com/|date=11 April 2013|access-date=17 March 2015}}</ref> | <ref name=feldman2013>{{cite conference|last1=Feldman|first1=Damon|title=Moving from Relational Modeling to XML and MarkLogic Data Models|url=http://www.marklogic.com/resources/slides-moving-from-relational-modeling-to-xml-and-marklogic-data-models/resource_download/presentations/|conference=MarkLogic World|conference-url=http://world.marklogic.com/|date=11 April 2013|access-date=17 March 2015}}</ref> | ||
* 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 | * 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 | ||
| Line 14: | Line 14: | ||
* Semantic web data is available as [[Resource Description Framework|RDF]]/XML | * Semantic web data is available as [[Resource Description Framework|RDF]]/XML | ||
* Provides a solution for [[Object-relational impedance mismatch]]<ref>[NoSQL Distilled: A Brief Guide to the Emerging World of Polyglot Persistence. Addison-Wesley Educational Publishers Inc, 2009] {{ISBN|978-0321826626}}</ref> | * Provides a solution for [[Object-relational impedance mismatch]]<ref>[NoSQL Distilled: A Brief Guide to the Emerging World of Polyglot Persistence. Addison-Wesley Educational Publishers Inc, 2009] {{ISBN|978-0321826626}}</ref> | ||
* Compatibility with XML use on the [[transport layer|data transport]] layer | |||
== XML-enabled databases == | == XML-enabled databases == | ||
| Line 41: | Line 40: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Integration with | == 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: | 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: | ||
| Line 53: | Line 52: | ||
== Native XML databases == | == 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.<ref>{{cite web|last1=Matthias|first1=Nicola|title=XML versus Relational Database Performance|url=https://nativexmldatabase.com/2010/08/22/xml-versus-relational-database-performance/|website=Native XML Database|access-date=28 Jun 2017|date=22 August 2010}}</ref> XML nodes and documents are the fundamental unit of (logical) storage, just as a [[relational database]] has fields and rows. | 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.<ref>{{cite web|last1=Matthias|first1=Nicola|title=XML versus Relational Database Performance|url=https://nativexmldatabase.com/2010/08/22/xml-versus-relational-database-performance/|website=Native XML Database|access-date=28 Jun 2017|date=22 August 2010|archive-date=4 March 2017|archive-url=https://web.archive.org/web/20170304072744/https://nativexmldatabase.com/2010/08/22/xml-versus-relational-database-performance/|url-status=dead}}</ref> 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.<ref>{{cite web|url=http://www.w3.org/TR/xquery-31/ | title=XQuery 3.1 Recommendation | date=2017-03-21}}</ref> 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. | The standard for querying XML data per W3C recommendation is [[XQuery]]; the latest version is XQuery 3.1.<ref>{{cite web|url=http://www.w3.org/TR/xquery-31/ | title=XQuery 3.1 Recommendation | date=2017-03-21}}</ref> 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. | ||
Latest revision as of 15:53, 27 September 2025
Template:Short description Script error: No such module "Unsubst".
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.
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:
- XML is stored into a CLOB (Character large object)
- XML is `shredded` into a series of Tables based on a Schema[4]
- XML is stored into a native XML Type as defined by ISO Standard 9075-14[5]
RDBMS that support the ISO XML Type are:
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:
- Mapping Relational Data to XML: Schema mapping is a critical process that defines how relational tables correspond to XML elements and attributes.
- 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
| 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 | Template:BSD-lic | Java | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No |
| eXist | Template:LGPL-lic | 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
<templatestyles src="Reflist/styles.css" />
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ [NoSQL Distilled: A Brief Guide to the Emerging World of Polyglot Persistence. Addison-Wesley Educational Publishers Inc, 2009] Template:ISBN
- ↑ Script error: No such module "citation/CS1".. Section Creating XMLType Tables and Columns Based on XML Schema
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "Citation/CS1".
Script error: No such module "Check for unknown parameters". <templatestyles src="Refbegin/styles.css" />
Template:Database models Script error: No such module "Navbox".