Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
XML database
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Database presenting data in XML formats}} {{update|date=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 [[XQuery|queried]], transformed, exported and returned to a calling system. XML databases are a flavor of [[document-oriented database]]s which are in turn a category of [[NoSQL]] database. == 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> <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 * 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 [[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> Steve O'Connell gives one reason for the use of XML in databases: the increasingly common use of XML for [[transport layer|data transport]], which has meant that "data is extracted from databases and put into XML documents and vice-versa".<ref name=oconnell2005>{{cite report|author=O'Connell, Steve|work=Advanced Databases Course Notes|title=Section 9.2|type=Syllabus|date=2005|publisher=[[University of Southampton]]|location=Southampton, England}}</ref>{{update inline|date=March 2015}} It may prove more efficient in terms of conversion costs,{{Citation needed|date=December 2024}} and easier to store the data in XML format. In content-based applications, the ability of the native XML database also minimizes the need for extraction or entry of metadata to support searching and navigation. == 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<ref name=oracle>{{cite book|title=Oracle XML DB Developer's Guide, 10''g'' Release 2|date=August 2005|publisher=Oracle Corporation|chapter-url=http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/xdb05sto.htm|access-date=17 March 2015|chapter=XML Schema Storage and Query: Basic}}. Section [http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/xdb05sto.htm#i1042421 Creating XMLType Tables and Columns Based on XML Schema]</ref> #XML is stored into a native XML Type as defined by ISO Standard [[SQL#Anatomy of SQL Standard|9075-14]]<ref name=iso9075-2011>{{cite web|title=ISO/IEC 9075-14:2011: Information technology -- Database languages -- SQL -- Part 14: XML-Related Specifications (SQL/XML)|url=http://www.iso.org/iso/home/store/catalogue_ics/catalogue_detail_ics.htm?csnumber=53686|publisher=[[International Organization for Standardization]]|access-date=17 March 2015|date=2011}}</ref> RDBMS that support the ISO XML Type are: #IBM DB2 (pureXML<ref name=db2purexml>{{cite web|title=pureXML overview -- DB2 as an XML database|url=http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.1.0/com.ibm.db2.luw.xml.doc/doc/c0022308.html|website=IBM Knowledge Center|publisher=[[IBM]]|access-date=17 March 2015}}</ref>) #Microsoft SQL Server<ref name=sqlserver2005>{{cite web|title=Using XML in SQL Server|url=https://msdn.microsoft.com/en-us/library/ms190936.aspx|website=Microsoft Developer Network|publisher=[[Microsoft Corporation]]|access-date=17 March 2015}}</ref> #Oracle Database<ref name=oracle2>{{cite book|title=Oracle XML DB Developer's Guide, 10''g'' Release 2|date=August 2005|publisher=Oracle Corporation|chapter-url=http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/xdb04cre.htm|access-date=17 March 2015|chapter=XMLType Operations}}</ref> #PostgreSQL<ref name=postgresql>{{cite book|title=PostgreSQL 9.6 Documentation|chapter-url=https://www.postgresql.org/docs/9.6/static/datatype-xml.html|access-date=1 April 2017|chapter=8.13. XML Type}}</ref> 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 databases|native XML database]] is better suited. === Example of XML Type Query in IBM DB2 SQL === <syntaxhighlight lang="sql"> select id, vol, xmlquery('$j/name', passing journal as "j") as name from journals where xmlexists('$j[licence="CreativeCommons"]', passing journal as "j") </syntaxhighlight> == 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<ref>{{Cite web |date=2025-01-01 |title=Extracting XML Documents from Relational Databases - 7 Tips |url=https://vividorigins.com/xml-documents-from-relational-databases/ |access-date=2025-01-06 |website=Vivid Origins |language=en-US}}</ref> 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.<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. 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. === Language features === {{sort-under}} {| class="wikitable sortable 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-lic}} | Java | {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{No}} |- | [[eXist]] | {{LGPL-lic}} | Java | {{Partial}} || {{Partial}} || {{Yes}} || {{Proprietary}} || {{Proprietary}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes}} |- | [[MarkLogic Server]] | {{Proprietary|Commercial}} | C++ | {{No}} || {{Partial}} || {{Yes}} || {{Proprietary}} || {{Proprietary}} || {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{No}} |- |OpenText xDB | {{Proprietary|Commercial}} | Java | {{Partial}} | {{Partial}} | {{Yes}} | {{Yes}} | {{Yes}} | {{No}} | {{No}} | {{No}} | {{No}} | {{No}} |- |Oracle Berkeley DB XML | {{Proprietary|Commercial}} |C/C++ | | | | | | | | | | |- | [[Qizx]] | {{Proprietary|Commercial}} | Java | {{No}} || {{No}} || {{Yes}} || {{Yes}} || {{Yes}} || {{No}} || {{No}} || {{Yes}} || {{No}} || {{No}} |- |[[Sedna (database)|Sedna]] |Apache License 2.0 |C/C++ | | | | | | | | | | |} === Supported APIs === {| class="wikitable sortable" |- ! Name ! [[XQuery API for Java|XQJ]] ! XML:DB ! [[Representational State Transfer|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 (database)|Sedna]] | {{Yes}} || {{Yes}} || {{No}} || {{No}} || {{No}} |} == Data-centric XML datasets == For data-centric XML datasets, the unique and distinct keyword search method, namely, XDMA<ref>{{Cite journal|last1=Selvaganesan|first1=S.|last2=Haw|first2=Su-Cheng|last3=Soon|first3=Lay-Ki|title=XDMA: A Dual Indexing and Mutual Summation Based Keyword Search Algorithm for XML Databases|journal=International Journal of Software Engineering and Knowledge Engineering|language=en-US|volume=24|issue=4|pages=591β615|doi=10.1142/s0218194014500223|year=2014}}</ref> for XML databases is designed and developed based on dual indexing and mutual summation. == References == {{reflist}} {{Refbegin}} {{Refend}} {{Database models}} {{Databases}} [[Category:XML]] [[Category:Data management]] [[Category:Data modeling]] [[Category:XML databases| ]] [[Category:Database management systems]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:BSD-lic
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite conference
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite report
(
edit
)
Template:Cite web
(
edit
)
Template:Database models
(
edit
)
Template:Databases
(
edit
)
Template:ISBN
(
edit
)
Template:LGPL-lic
(
edit
)
Template:No
(
edit
)
Template:Partial
(
edit
)
Template:Proprietary
(
edit
)
Template:Refbegin
(
edit
)
Template:Refend
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Sort-under
(
edit
)
Template:Update
(
edit
)
Template:Update inline
(
edit
)
Template:Yes
(
edit
)