WO2005024670A1 - Method and mechanism for efficient storage and query of xml documents based on paths - Google Patents

Method and mechanism for efficient storage and query of xml documents based on paths Download PDF

Info

Publication number
WO2005024670A1
WO2005024670A1 PCT/US2004/029070 US2004029070W WO2005024670A1 WO 2005024670 A1 WO2005024670 A1 WO 2005024670A1 US 2004029070 W US2004029070 W US 2004029070W WO 2005024670 A1 WO2005024670 A1 WO 2005024670A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
path
document
identifier
column
Prior art date
Application number
PCT/US2004/029070
Other languages
French (fr)
Inventor
Ravi Murthy
Nipun Agarwal
Eric Sedlar
Original Assignee
Oracle International Corporation
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oracle International Corporation filed Critical Oracle International Corporation
Publication of WO2005024670A1 publication Critical patent/WO2005024670A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/84Mapping; Conversion

Definitions

  • XML extensible markup language
  • W3C World Wide Web Consortium
  • XML is a meta-language developed and standardized by the World Wide Web Consortium (W3C) that permits use and creation of customized marlcup languages for different types of documents.
  • XML is a variant of and is based on the Standard Generalized Marlcup Language (SGML), the international standard meta-language for text markup systems that is also the parent meta-language for the Hyper-Text Markup Language (HTML). Since its adoption as a standard language, XML has become widely used to describe and implement many kinds of document types. Increasingly greater amounts of content are being created and stored as XML documents in modern computing systems, with the XML documents often being stored in database management systems.
  • SGML Standard Generalized Marlcup Language
  • HTML Hyper-Text Markup Language
  • XML documents may be structured or unstructured. Structured data will conform to an XML schema. Unstructured data may not be associated with any specifically identifiable schema.
  • unstructured XML documents may be created as a result of ad hoc editing.
  • an unstructured XML document may be created by combining multiple structured documents together into an unstructured collection.
  • XPath is a language for addressing parts of an XML document that has been defined by the W3C organization, in which the parts of an XML document are modeled as a tree of nodes. Further information about the XPath language can be found at the W3C website at http://www.w3.org/TR/xpath, the contents of which are incorporated herein by reference in its entirety. Queries involving XPath predicates are often used to filter XML documents and extract fragments within documents.
  • inverted indexes and functional indexes can be used to improve certain types of filter queries.
  • the more general form of filter queries which involve range predicates and collection traversals are still not satisfied by such indexes, and hence require inefficient DOM-based evaluation.
  • functional indexes can be built only on XPath expressions returning a single value. If the XPath expression returns more than one value, a functional index cannot be created.
  • An inverted list index serves as a primary filter but needs an expensive functional evaluation of the XPath as a post-filter operation.
  • Embodiments of the present invention disclose a new approach for storing, accessing, and managing data, such as XML data. Also disclosed are embodiments of new storage formats for string XML data. The approach supports efficient evaluation of XPath queries and also improves the performance of data/fragment extraction, and can be applied to schema-less documents. The invention is applicable to all database systems and other servers which support storing and managing XML content. In addition, the approach can be applied to store, manage, and retrieve other types of unstructured or semi-structured data in a database system. Further details of aspects, objects, and advantages of the invention are described below in the detailed description, drawings, and claims. Both the foregoing general description and the following detailed description are exemplary and explanatory, and are not intended to be limiting as to the scope of the invention.
  • Fig. 1 is a flowchart of a process for managing XML data according to an embodiment of the invention.
  • Fig. 2 is a flowchart of a process for storing XML data according to an embodiment of the invention.
  • Figs. 3a-c shows an example XML document.
  • Fig. 4 shows an example Path_Table according to an embodiment of the invention.
  • Fig. 5 shows an example Path_h ⁇ dex_Table according to an embodiment of the invention.
  • Fig. 1 is a flowchart of a process for managing XML data according to an embodiment of the invention.
  • Fig. 3a-c shows an example XML document.
  • Fig. 4 shows an example Path_Table according to an embodiment of the invention.
  • Fig. 5 shows an example Path_h ⁇ dex_Table according to an embodiment of the invention.
  • FIG. 6 is a flowchart of a process for converting an XPath expression to a SQL query according to an embodiment of the invention.
  • Fig. 7 is a diagram of a computer system with which the present invention can be implemented.
  • Embodiments of the present invention provide methods, systems, and computer program products for managing, storing, and accessing unstructured and semi-structured data, such as XML documents, in relational and object-relational database systems. For the purpose of explanation, the following description is specifically made with reference to managing, storing, and accessing XML documents in a relational database system.
  • Embodiments of the present invention discloses a new approach for storing, accessing, and managing XML data which supports efficient evaluation of XPath queries and also improves the performance of data/fragment extraction.
  • the approach can be applied to schema-less documents to enable efficient XPath processing.
  • the approach is similar to name- value pair storage but extended to handle mapping from paths to values — without losing the hierarchical (parent-child) information.
  • Some advantages of this approach include more generic solution to store any XML collection, efficient and/or exact filtering for a large subset of XPath expressions, and more usefulness for extracting fragments based on XPath expressions.
  • An embodiment provides an efficient mechanism for storing arbitrary XML data (not conforming to any schema) based on paths. This storage mechanism allows for high performance of evaluating a large class of XPath queries including range predicates and collection traversals.
  • FIG. 1 is a flowchart showing a high- level overview of a process for storing, accessing, and managing XML documents in a relational database system.
  • the process begins by storing the XML document(s) into a defined relational schema.
  • the format for storing the XML data can be configured based upon a data model that may be either commonly defined or desirable for processing purposes.
  • the storage format can be configured to facilitate XPath processing, and therefore the storage format can be defined based upon the tree-of-nodes approach for modeling XML documents that is specified by the XPath standards.
  • decisions may be made regarding whether to create one or more indexes upon the stored XML data. If so, then the index could be created corresponding to the fields of the defined schema format for storing the XML data (106).
  • operations can be performed to access the stored XML data (108).
  • the format for storing the XML data can be configured based upon a defined data model, such as a storage format that is configured to facilitate XPath processing. Described here is one embodiment of a storage format for storing XML data that is defined based upon the tree-of-nodes approach for modeling XML documents, e.g., as specified by the XPath standards, hi this embodiment, any set of arbitrary XML documents, e.g., an XML collection, can be stored in a single (universal) relational schema consisting of two tables.
  • the first table referred to herein as the PATH_TABLE
  • the second table referred to herein as the PATH_LNDEX_TABLE
  • the following shows an example schema for the PATH TABLE according to an embodiment of the invention:
  • the DOCID refers to the document identifier that is assigned to the XML documents. Each XML document will have a unique DOCID value.
  • PJD refers a unique identifier for a path, which functions as a key into the PATH_rNDEX_TABLE. Multiple nodes within an XML document may have the same path, and therefore may be associated with the same PLD value.
  • a "node" can be defined as specified in the standard XPath specifications from W3C.
  • the STARTPOS entry identifies the starting position of a node and the ENDPOS entry identifies the ending position of that node.
  • the NODEVALVL entry identifies the hierarchical level of a node within an XML document.
  • the NODETYPE column identifies the type of the node that is associated with the present entry. Examples of such types could include an element type, attribute type, or text type. In one embodiment, these types are implemented to be similar to the node types defined by the DOM standard. If the node associated with the present entry is associated with a value, e.g., because the node is an attribute or text type, then the NODEVAL column will contain the node value.
  • the following shows an example schema for the PATH_LNDEX___TABLE according to an embodiment of the invention:
  • Each PH) entry identifies a unique path.
  • the PATH column stores the path value that is associated with a PID.
  • the NODENAME column identifies the terminal node for a given path.
  • the NODENAME column can also be defined as a virtual column base upon the PATH column. This type of column is useful while reconstructing the document/fragment to create the appropriate tag names.
  • Fig. 2 shows a flowchart of an embodiment of a process for storing XML documents into a database using these tables. When an XML document is processed for storage, a unique identifier is assigned to that document, i.e., in the DOCLD field.
  • the entire path for a given node is stored in the PATH TABLE (218). If both a PATHJTABLE and a PATH_INDEX_TABLE are used, then the entire path for a node is stored in the PATH_LNDEX_TABLE and only a path identifier for that node is stored in the node entry in the PATHJTABLE. In this approach, the path associated with the node is identified at 206. A determination is made whether an entry for the identified path already exists in the PATH_INDEX_TABLE (208).
  • the identifier for the path is identified (210) and associated with the node (216), i.e., by storing the PID value in the PID column for the node. Otherwise, a new PID value is assigned (212) and a new entry is created in the PATHJNDEXJTABLE for the newly identified path (214). The new PID value is thereafter associated with the node in the PLD column of the PATH_TABLE (216).
  • hierarchical information and type/value information for the node is stored in the entry for the node in the PATHJTABLE.
  • the hierarchical information for the XML data is tracked by viewing the XML document as a tree and assigning a start and an end position to each node, e.g., by using pre-order and post-order traversal numbers.
  • the node level (tree depth) and the node type are stored.
  • Node values are stored for leaf text nodes, attribute nodes, and other nodes that are associated with a value.
  • a determination is made whether there are further node(s) to process within the XML document. If so, then the process returns back to 204 to process the next node within the XML document. Otherwise, at 226, a determination is made whether there are further XML document(s) to store in the database.
  • Fig. 3 a shows the example XML document 300 shown in Fig. 3 a.
  • Fig. 3b shows the position numbers for each of the document portions in the example XML document 300.
  • Fig. 3c shows how the position numbers can be defined by identifying pre-order and post-order traversal numbers for a tree model of the document.
  • Fig. 5 shows an example PathJTable 500 for the XML document 300 of Figs. 3a-c.
  • the DOCTD column of entry 502 contains this value of "1". It is noted that all entries in the PathJTable 500 associated with the same XML document 300 will have the same DOCTD value.
  • the "PID" value provides a key into the PathJt ⁇ dex JTable to find the correct path associated with an entry in the PathJTable 500.
  • Fig. 4 shows an example Path_Index JTable 400 that is associated with the XML document of Fig. 3 a. Entry 402 in Path_rndex_Table 400 includes a PATH column that contains the actual path value associated with the PID.
  • Path_Index JTable 400 that is associated with the XML document of Fig. 3 a.
  • Entry 402 in Path_rndex_Table 400 includes a PATH column that contains the actual path value associated with the PID.
  • One advantage of having this type of table is that the same pathnames do not have to be repeated over and over again to reference the different nodes in the XML document. Instead, the different nodes can be associated with the appropriate PTD in this table to be associated with the correct path within the document. Referring back to Fig.
  • the "STARTPOS” column for entry 502 identifies the start position for element "a", which is the position of the ⁇ a> node. Here, it begins at the first position of the document, hence having a position of "1".
  • the "ENDPOS” value identifies the ending position of the "a” element, which is at the position of the ⁇ /a> node. Here, it ends at the last position of the document, and when each position in this example document 300 is counted if it is a start node, end node, or attribute node, then the end position for this element is at position 19.
  • the NODELVL column identifies the hierarchical level of an element.
  • Element “a” is at the highest hierarchical level of the XML document 300, and therefore is associated with a value of "1" in the NODELVL column for entry 502.
  • the NODETYPE column identifies the type of node that is being stored.
  • entry 502 corresponds to element "a” , and therefore the node type stored in the NODETYPE column for entry 502 would be of type "element”.
  • the NODEVAL column stores the node value, if any, that is associated with the entry.
  • element "a” is not directly associated with a node value.
  • the NODEVAL column for entry 502 does not contain a stored value.
  • the other entries in PathJTable 500 similarly define the other portions of the XML document 300.
  • the other entries in the Path_Index_Table 400 define the other paths that appear in the XML document 300.
  • One or more indexes can be created on the PathJTable 500 and
  • Path Jndex JTable 400 to speed up the evaluation of XPath queries and document and fragment construction operations.
  • indexes e.g., Btree indexes
  • PATHJNDEXJTABLE 400 in one embodiment of the invention: • unique index on pid [primary key] • unique index on (path) reverse
  • the presently described embodiment of the invention provides an approach for allowing SQL to be used to query, access, and reconstruct the stored XML data, even if the XML data was originally unstructured or semi-structured.
  • a document can be reconstructed very efficiently in a streaming fashion by evaluating the following example SQL query.
  • the query returns all the nodes of the XML document (identified by a docid value) in the document order. Based on the start, end positions and the node level, the appropriate tagging can be added to the output XML stream. select i.nodename, p. startpos, p.endpos, p.nodetype, p.nodeval from path able p, path ndex able i where p.
  • a fragment can be identified by a rowid of the row in the path able corresponding to the element. Given a rowid of the pathjable, the corresponding fragment can be constructed by evaluating the following query. The query returns the nodes within the fragment in document order. Based on the start, end positions and the node level, the output fragment can be constructed. select i.nodename, p.
  • the primary syntactic construct in the XPath language is the XPath expression.
  • An XPath expression is evaluated to yield an object, which corresponds to the result of a search upon one or more XML documents.
  • Embodiments of the present invention provide an approach for facilitating and enabling XPath processing. This section describes how XPath expressions are translated into queries on the underlying path and index tables corresponding to XML documents stored as described with respect to Figs. 1-5. Using this approach, any XPath expression can be converted into a SQL query to access the stored XML data.
  • Fig. 6 shows a flowchart of an embodiment of a process for rewriting an XPath expression into a SQL query.
  • the process breaks the input XPath expression into multiple components, e.g., using the following rules: 1.
  • Each continuous segment of simple XPath e.g., a set of node names separated by "/" such as /a/b/c/d, corresponds to a single XPath component.
  • the term "a//b” means any b that is a child of a, but at levsl of the hierarchy.
  • the process creates a SQL query corresponding to each of the XPath components.
  • the SQL query comprises a join of the pathjndexjable and the pathjable and further includes, for example, the following : 1. Condition for the path being chosen; 2. Condition for the node type (if needed); and/or 3. Condition for the node value (if present).
  • the process joins the SQL query corresponding a component to its previous component using, for example, the following join conditions: 1. Join on the docid (i.e., for the same document); and/or 2. Join on the hierarchy relationship - startpos, endpos (e.g., a parent- child relationship).
  • XPath searches for the content(s) of one or more XML fragments corresponding to the location path "/a/b/c/d".
  • XPath /a/b/c/d
  • a relative location path consists of a sequence of one or more location steps separated by the "/" symbol. The steps in a relative location path are composed together from left to right.
  • this XPath expression can be translated to the following SQL statement that queries against the PathJTable and PathJndexJTable: select pi.
  • docid pi. docid and p3.
  • nodetype 3;
  • the following XPath expression combines aspects of the previous three examples: XPath: /a[//id>"l"]/b/c/d
  • SYSTEM ARCHITECTURE OVERVIEW The execution of the sequences of instructions required to practice the invention may be performed in embodiments of the invention by a computer system 1400 as shown in Fig. 7. In an embodiment of the invention, execution of the sequences of instructions required to practice the invention is performed by a single computer system 1400. According to other embodiments of the invention, two or more computer systems 1400 coupled by a communication link 1415 may perform the sequence of instructions required to practice the invention in coordination with one another. In order to avoid needlessly obscuring the invention, a description of only one computer system 1400 will be presented below; however, it should be understood that any number of computer systems 1400 may be employed to practice the invention. A computer system 1400 according to an embodiment of the invention will now be described with reference to Fig.
  • FIG. 7 is a block diagram of the functional components of a computer system 1400 according to an embodiment of the invention.
  • the term computer system 1400 is broadly used to describe any computing device that can store and independently run one or more programs.
  • Each computer system 1400 may include a communication interface 1414 coupled to the bus 1406.
  • the communication interface 1414 provides two-way communication between computer systems 1400.
  • the communication interface 1414 of a respective computer system 1400 transmits and receives electrical, electromagnetic or optical signals, that include data streams representing various types of signal information, e.g., instructions, messages and data.
  • a communication link 1415 links one computer system 1400 with another computer system 1400.
  • the communication link 1415 may be a LAN, in which case the communication interface 1414 may be a LAN card, or the communication link 1415 may be a PSTN, in which case the communication interface 1414 may be an integrated services digital network (ISDN) card or a modem.
  • a computer system 1400 may transmit and receive messages, data, and instructions, including program, i.e., application, code, through its respective communication link 1415 and communication interface 1414. Received program code may be executed by the respective processor(s) 1407 as it is received, and/or stored in the storage device 1410, or other associated non- volatile media, for later execution.
  • program i.e., application
  • the computer system 1400 operates in conjunction with a data storage system 1431, e.g., a data storage system 1431 that contains a database 1432 that is readily accessible by the computer system 1400.
  • the computer system 1400 communicates with the data storage system 1431 through a data interface 1433.
  • a data interface 1433 which is coupled to the bus 1406, transmits and receives electrical, electromagnetic or optical signals, that include data streams representing various types of signal information, e.g., instructions, messages and data.
  • the functions of the data interface 1433 may be performed by the communication interface 1414.
  • Computer system 1400 includes a bus 1406 or other communication mechanism for communicating instructions, messages and data, collectively, information, and one or more processors 1407 coupled with the bus 1406 for processing information.
  • Computer system 1400 also includes a main memory 1408, such as a random access memory (RAM) or other dynamic storage device, coupled to the bus 1406 for storing dynamic data and instructions to be executed by the processor(s) 1407.
  • the main memory 1408 also may be used for storing temporary data, i.e., variables, or other intermediate information during execution of instructions by the processors) 1407.
  • the computer system 1400 may further include a read only memory (ROM) 1409 or other static storage device coupled to the bus 1406 for storing static data and instructions for the processors) 1407.
  • ROM read only memory
  • a storage device 1410 such as a magnetic disk or optical disk, may also be provided and coupled to the bus 1406 for storing data and instructions for the processor(s) 1407.
  • a computer system 1400 may be coupled via the bus 1406 to a display device 1411, such as, but not limited to, a cathode ray tube (CRT), for displaying information to a user.
  • An input device 1412 e.g., alphanumeric and other keys, is coupled to the bus 1406 for communicating information and command selections to the processor(s) 1407.
  • an individual computer system 1400 performs specific operations by their respective processor(s) 1407 executing one or more sequences of one or more instructions contained in the main memory 1408.
  • Such instructions may be read into the main memory 1408 from another computer-usable medium, such as the ROM 1409 or the storage device 1410. Execution of the sequences of instructions contained in the main memory 1408 causes the processor(s) 1407 to perform the processes described herein. In alternative embodiments, hard-wired circuitry may be used in place of or in combination with software instructions to implement the invention. Thus, embodiments of the invention are not limited to any specific combination of hardware circuitry and/or software.
  • Non-volatile media i.e., media that can retain information in the absence of power
  • Volatile media i.e., media that can not retain information in the absence of power
  • Transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise the bus 1406.
  • Transmission media can also take the form of carrier waves; i.e., electromagnetic waves that can be modulated, as in frequency, amplitude or phase, to transmit information signals. Additionally, transmission media can talce the form of acoustic or light waves, such as those generated during radio wave and infrared data communications.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method, mechanism, and computer program product for storing, accessing, and managing XML data is disclosed. The approach supports efficient evaluation of XPath queries and also improves the performance of data/fragment extraction. The approach can be applied to schema-less documents. The approach is applicable to all database systems and other servers which support storing and managing XML content. In addition, the approach can be applied to store, manage, and retrieve other types of unstructured or semi-structured data in a database system.

Description

METHOD AND MECHANISM FOR EFFICIENT STORAGE AND QUERY OF XML DOCUMENTS BASED ON PATHS
CROSS-REFERENCE TO RELATED APPLICATIONS The present application claims priority to U.S. Provisional Application Serial No. 60/500,450, filed on September 5, 2003, which is hereby incorporated by reference in its entirety.
COPYRIGHT NOTICE A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent files and records, but otherwise reserves all copyright rights.
BACKGROUND AND SUMMARY The extensible markup language (XML) is a meta-language developed and standardized by the World Wide Web Consortium (W3C) that permits use and creation of customized marlcup languages for different types of documents. XML is a variant of and is based on the Standard Generalized Marlcup Language (SGML), the international standard meta-language for text markup systems that is also the parent meta-language for the Hyper-Text Markup Language (HTML). Since its adoption as a standard language, XML has become widely used to describe and implement many kinds of document types. Increasingly greater amounts of content are being created and stored as XML documents in modern computing systems, with the XML documents often being stored in database management systems. Therefore, there is a growing demand for database systems that provide capabilities to store, manage and query XML content natively in a database. As such, mechanisms for efficient storage and querying of arbitrary XML data is becoming important in building a scalable and robust content management platform. The content of XML documents may be structured or unstructured. Structured data will conform to an XML schema. Unstructured data may not be associated with any specifically identifiable schema. For example, unstructured XML documents may be created as a result of ad hoc editing. As another example, an unstructured XML document may be created by combining multiple structured documents together into an unstructured collection. There are many scenarios in which users need to store and query XML documents that do not conform to any pre-defined XML schemas. One of the severe limitations of conventional databases that work with XML data is the lack of efficient processing for schema-less XML documents, particularly when attempting to perform XPath processing on these schema-less documents. XPath is a language for addressing parts of an XML document that has been defined by the W3C organization, in which the parts of an XML document are modeled as a tree of nodes. Further information about the XPath language can be found at the W3C website at http://www.w3.org/TR/xpath, the contents of which are incorporated herein by reference in its entirety. Queries involving XPath predicates are often used to filter XML documents and extract fragments within documents. In many cases, documents that do not conform to an XML Schema can only be stored in CLOB columns. However, this mode of storage impacts the performance of XPath-based searches. Inverted indexes and functional indexes can be used to improve certain types of filter queries. However, the more general form of filter queries which involve range predicates and collection traversals are still not satisfied by such indexes, and hence require inefficient DOM-based evaluation. Moreover, functional indexes can be built only on XPath expressions returning a single value. If the XPath expression returns more than one value, a functional index cannot be created. An inverted list index serves as a primary filter but needs an expensive functional evaluation of the XPath as a post-filter operation. The post- filter step is a significant bottleneck especially for large documents. Finally, neither of the two indexing options are effective in extracting fragments based on user specified XPaths. Embodiments of the present invention disclose a new approach for storing, accessing, and managing data, such as XML data. Also disclosed are embodiments of new storage formats for string XML data. The approach supports efficient evaluation of XPath queries and also improves the performance of data/fragment extraction, and can be applied to schema-less documents. The invention is applicable to all database systems and other servers which support storing and managing XML content. In addition, the approach can be applied to store, manage, and retrieve other types of unstructured or semi-structured data in a database system. Further details of aspects, objects, and advantages of the invention are described below in the detailed description, drawings, and claims. Both the foregoing general description and the following detailed description are exemplary and explanatory, and are not intended to be limiting as to the scope of the invention.
BRIEF DESCRIPTION OF THE DRAWINGS
The accompanying drawings are included to provide a further understanding of the invention and, together with the Detailed Description, serve to explain the principles of the invention. The same or similar elements between figures may be referenced using the same reference numbers. Fig. 1 is a flowchart of a process for managing XML data according to an embodiment of the invention. Fig. 2 is a flowchart of a process for storing XML data according to an embodiment of the invention. Figs. 3a-c shows an example XML document. Fig. 4 shows an example Path_Table according to an embodiment of the invention. Fig. 5 shows an example Path_hιdex_Table according to an embodiment of the invention. Fig. 6 is a flowchart of a process for converting an XPath expression to a SQL query according to an embodiment of the invention. Fig. 7 is a diagram of a computer system with which the present invention can be implemented. DETAILED DESCRIPTION Embodiments of the present invention provide methods, systems, and computer program products for managing, storing, and accessing unstructured and semi-structured data, such as XML documents, in relational and object-relational database systems. For the purpose of explanation, the following description is specifically made with reference to managing, storing, and accessing XML documents in a relational database system. It is noted, however, that the following description is equally applicable to other types of data in other types of storage systems, and is not to be limited in its scope to only XML documents. In addition, the following description explicitly uses query syntax conforming to the structured query language (SQL). It is noted that the following description is also applicable to other types of query languages and syntaxes. Embodiments of the present invention discloses a new approach for storing, accessing, and managing XML data which supports efficient evaluation of XPath queries and also improves the performance of data/fragment extraction. The approach can be applied to schema-less documents to enable efficient XPath processing. In one embodiment, the approach is similar to name- value pair storage but extended to handle mapping from paths to values — without losing the hierarchical (parent-child) information. Some advantages of this approach include more generic solution to store any XML collection, efficient and/or exact filtering for a large subset of XPath expressions, and more usefulness for extracting fragments based on XPath expressions. An embodiment provides an efficient mechanism for storing arbitrary XML data (not conforming to any schema) based on paths. This storage mechanism allows for high performance of evaluating a large class of XPath queries including range predicates and collection traversals. These benefits easily outweigh the possible increase in the time to insert the document, e.g., due to the overhead of shredding the document into multiple rows, and to reconstruct the entire document, e.g., due to the extra work in putting together multiple relational rows into a document. As noted, embodiments of the invention provides an approach to define format(s) for storing, accessing, and managing arbitrary XML data comprising sets of documents not conforming to any schema. Fig. 1 is a flowchart showing a high- level overview of a process for storing, accessing, and managing XML documents in a relational database system. At 102, the process begins by storing the XML document(s) into a defined relational schema. In one approach, the format for storing the XML data can be configured based upon a data model that may be either commonly defined or desirable for processing purposes. For example, in one embodiment, the storage format can be configured to facilitate XPath processing, and therefore the storage format can be defined based upon the tree-of-nodes approach for modeling XML documents that is specified by the XPath standards. At 104, decisions may be made regarding whether to create one or more indexes upon the stored XML data. If so, then the index could be created corresponding to the fields of the defined schema format for storing the XML data (106). Once the XML data has been stored into the desired storage formats, operations can be performed to access the stored XML data (108). Each of these process actions is described in more detail below. As mentioned above, the format for storing the XML data can be configured based upon a defined data model, such as a storage format that is configured to facilitate XPath processing. Described here is one embodiment of a storage format for storing XML data that is defined based upon the tree-of-nodes approach for modeling XML documents, e.g., as specified by the XPath standards, hi this embodiment, any set of arbitrary XML documents, e.g., an XML collection, can be stored in a single (universal) relational schema consisting of two tables. The first table, referred to herein as the PATH_TABLE, stores the path, value pair and associated hierarchical information for the XML data. The second table, referred to herein as the PATH_LNDEX_TABLE, assigns unique path ids to path strings, thereby avoiding repeated storage of large path strings. It is noted that the second table is not required, and that the full path can be stored within the PATH_TABLE. However, this approach may be less efficient since it may cause the same large path strings to be repeated multiple times within the table. The following shows an example schema for the PATH TABLE according to an embodiment of the invention:
Figure imgf000007_0001
Figure imgf000008_0001
In this schema, the DOCID refers to the document identifier that is assigned to the XML documents. Each XML document will have a unique DOCID value. PJD refers a unique identifier for a path, which functions as a key into the PATH_rNDEX_TABLE. Multiple nodes within an XML document may have the same path, and therefore may be associated with the same PLD value. In the present embodiment, a "node" can be defined as specified in the standard XPath specifications from W3C. The STARTPOS entry identifies the starting position of a node and the ENDPOS entry identifies the ending position of that node. Based on pre-order and post-order traversal of the tree of nodes, the NODEVALVL entry identifies the hierarchical level of a node within an XML document. The NODETYPE column identifies the type of the node that is associated with the present entry. Examples of such types could include an element type, attribute type, or text type. In one embodiment, these types are implemented to be similar to the node types defined by the DOM standard. If the node associated with the present entry is associated with a value, e.g., because the node is an attribute or text type, then the NODEVAL column will contain the node value. The following shows an example schema for the PATH_LNDEX__TABLE according to an embodiment of the invention:
Figure imgf000008_0002
Each PH) entry identifies a unique path. The PATH column stores the path value that is associated with a PID. The NODENAME column identifies the terminal node for a given path. The NODENAME column can also be defined as a virtual column base upon the PATH column. This type of column is useful while reconstructing the document/fragment to create the appropriate tag names. Fig. 2 shows a flowchart of an embodiment of a process for storing XML documents into a database using these tables. When an XML document is processed for storage, a unique identifier is assigned to that document, i.e., in the DOCLD field. If a separate PATH NDEXJTABLE is not used, then the entire path for a given node is stored in the PATH TABLE (218). If both a PATHJTABLE and a PATH_INDEX_TABLE are used, then the entire path for a node is stored in the PATH_LNDEX_TABLE and only a path identifier for that node is stored in the node entry in the PATHJTABLE. In this approach, the path associated with the node is identified at 206. A determination is made whether an entry for the identified path already exists in the PATH_INDEX_TABLE (208). If so, then the identifier for the path is identified (210) and associated with the node (216), i.e., by storing the PID value in the PID column for the node. Otherwise, a new PID value is assigned (212) and a new entry is created in the PATHJNDEXJTABLE for the newly identified path (214). The new PID value is thereafter associated with the node in the PLD column of the PATH_TABLE (216). At 220 and 222, hierarchical information and type/value information for the node is stored in the entry for the node in the PATHJTABLE. The hierarchical information for the XML data is tracked by viewing the XML document as a tree and assigning a start and an end position to each node, e.g., by using pre-order and post-order traversal numbers. In addition, the node level (tree depth) and the node type are stored. Node values are stored for leaf text nodes, attribute nodes, and other nodes that are associated with a value. At 224, a determination is made whether there are further node(s) to process within the XML document. If so, then the process returns back to 204 to process the next node within the XML document. Otherwise, at 226, a determination is made whether there are further XML document(s) to store in the database. If so, then the process returns back to 202 to process the additional XML documents. To illustrate this process, consider the example XML document 300 shown in Fig. 3 a. A number of different nodes are present in this document. For the purposes of explanation, consider if the start, end, and attribute value portions of each element in the document are assigned to a position number. These position number will then be used to define the relative start positions and end positions for the nodes or fragments in the document. Fig. 3b shows the position numbers for each of the document portions in the example XML document 300. Fig. 3c shows how the position numbers can be defined by identifying pre-order and post-order traversal numbers for a tree model of the document. In this example document 300, element "a" is at the highest level of the document hierarchy and begins at position 1 and ends at position 19. Fig. 5 shows an example PathJTable 500 for the XML document 300 of Figs. 3a-c. Consider the first entry 502 in this table, which corresponds to the "a" element in the document 300. Assume that the DOCTD value of "1" has been assigned to the XML document 300. Therefore, the DOCTD column of entry 502 contains this value of "1". It is noted that all entries in the PathJTable 500 associated with the same XML document 300 will have the same DOCTD value. The "PID" value provides a key into the PathJtαdex JTable to find the correct path associated with an entry in the PathJTable 500. For entry 502, the PLD value of "1" corresponds to a path of "a.". Fig. 4 shows an example Path_Index JTable 400 that is associated with the XML document of Fig. 3 a. Entry 402 in Path_rndex_Table 400 includes a PATH column that contains the actual path value associated with the PID. One advantage of having this type of table is that the same pathnames do not have to be repeated over and over again to reference the different nodes in the XML document. Instead, the different nodes can be associated with the appropriate PTD in this table to be associated with the correct path within the document. Referring back to Fig. 5, the "STARTPOS" column for entry 502 identifies the start position for element "a", which is the position of the <a> node. Here, it begins at the first position of the document, hence having a position of "1". The "ENDPOS" value identifies the ending position of the "a" element, which is at the position of the </a> node. Here, it ends at the last position of the document, and when each position in this example document 300 is counted if it is a start node, end node, or attribute node, then the end position for this element is at position 19. The NODELVL column identifies the hierarchical level of an element. Element "a" is at the highest hierarchical level of the XML document 300, and therefore is associated with a value of "1" in the NODELVL column for entry 502. The NODETYPE column identifies the type of node that is being stored. Here, entry 502 corresponds to element "a" , and therefore the node type stored in the NODETYPE column for entry 502 would be of type "element". The contents within the NODETYPE column can also be stored as numerical equivalents defined for each type, e.g., ELEMENTS, ATTR=2, TEXT=3, etc. The NODEVAL column stores the node value, if any, that is associated with the entry. Here, element "a" is not directly associated with a node value. Therefore, the NODEVAL column for entry 502 does not contain a stored value. I The other entries in PathJTable 500 similarly define the other portions of the XML document 300. The other entries in the Path_Index_Table 400 define the other paths that appear in the XML document 300. One or more indexes can be created on the PathJTable 500 and
Path Jndex JTable 400 to speed up the evaluation of XPath queries and document and fragment construction operations. For example, to improve the efficiency of the document retrieval and XPath processing, the following are examples of indexes, e.g., Btree indexes, that can be created on the PATHJTABLE 500 in one embodiment of the invention: • pid • docid, startpos • docid, nodelvl, startpos • substr(nodeval, 1, 1400) The following are examples of indexes that can be created on the
PATHJNDEXJTABLE 400 in one embodiment of the invention: • unique index on pid [primary key] • unique index on (path) reverse Once the XML document has been stored into this type of schema, all or part of the document can be accessed by querying against the known columns of the stored version of the document. In this manner, any of the well-known query methods that have been extensively provided to access relational database tables can be used to efficiently and effectively access XML data stored with this approach. For example, the structured query language (SQL) is a widely adopted mechanism for accessing data stored in a relational database system. The presently described embodiment of the invention provides an approach for allowing SQL to be used to query, access, and reconstruct the stored XML data, even if the XML data was originally unstructured or semi-structured. A document can be reconstructed very efficiently in a streaming fashion by evaluating the following example SQL query. The query returns all the nodes of the XML document (identified by a docid value) in the document order. Based on the start, end positions and the node level, the appropriate tagging can be added to the output XML stream. select i.nodename, p. startpos, p.endpos, p.nodetype, p.nodeval from path able p, path ndex able i where p. docid = :1 and p.pid = i.pid order by p. startpos A fragment can be identified by a rowid of the row in the path able corresponding to the element. Given a rowid of the pathjable, the corresponding fragment can be constructed by evaluating the following query. The query returns the nodes within the fragment in document order. Based on the start, end positions and the node level, the output fragment can be constructed. select i.nodename, p. startpos, p.endpos, p.nodetype, p.nodeval from pathjable p, pathjndex Jable i, (select docid, startpos, endpos from pathjable where rowid = :1) p2 where p.docid = p2.docid and p. startpos >= p2. startpos and p.endpos <= p2. endpos and p.pid = i.pid order by p.startpos As noted above, one of the current limitations of prior database systems is the lack of efficient XPath processing for schema-less XML documents. The primary syntactic construct in the XPath language is the XPath expression. An XPath expression is evaluated to yield an object, which corresponds to the result of a search upon one or more XML documents. Embodiments of the present invention provide an approach for facilitating and enabling XPath processing. This section describes how XPath expressions are translated into queries on the underlying path and index tables corresponding to XML documents stored as described with respect to Figs. 1-5. Using this approach, any XPath expression can be converted into a SQL query to access the stored XML data. Fig. 6 shows a flowchart of an embodiment of a process for rewriting an XPath expression into a SQL query. At 602, the process breaks the input XPath expression into multiple components, e.g., using the following rules: 1. Each continuous segment of simple XPath, e.g., a set of node names separated by "/" such as /a/b/c/d, corresponds to a single XPath component. The term "a//b" means any b that is a child of a, but at levsl of the hierarchy. 2. Each occurrence of a predicate within the XPath causes creation of new components. For example, /a/b[@id="2"]/c/d consists of the following components - /a/b and @id and /a/b/c/d. At 604, the process creates a SQL query corresponding to each of the XPath components. The SQL query comprises a join of the pathjndexjable and the pathjable and further includes, for example, the following : 1. Condition for the path being chosen; 2. Condition for the node type (if needed); and/or 3. Condition for the node value (if present). At 606, the process joins the SQL query corresponding a component to its previous component using, for example, the following join conditions: 1. Join on the docid (i.e., for the same document); and/or 2. Join on the hierarchy relationship - startpos, endpos (e.g., a parent- child relationship). The next section of this document describes several examples of the embodiment of the translation techniques to convert an XPath expression into a SQL query. The following example XPath expression searches for the content(s) of one or more XML fragments corresponding to the location path "/a/b/c/d". XPath: /a/b/c/d In the XPath language, a relative location path consists of a sequence of one or more location steps separated by the "/" symbol. The steps in a relative location path are composed together from left to right. Using the process described above, this XPath expression can be translated to the following SQL statement that queries against the PathJTable and PathJndexJTable: select pi. nodeval from pathjable pi, pathjndex Jable il where il.path = 'a.b.c.d.' and il.pid = p I.pid and pl.nodetype = 3; This query checks for nodes corresponding to the path "a.b.c.d" that also have the appropriate node type to contain a node value (e.g., nodetype= "3"), and returns the value of those node(s) . Consider the following XPath expression which contains a "[id=l]" predicate: XPath: /a/b[id="l"]/c This XPath expression can be translated to the following SQL statement that queries against the PathJTable and PathJndexJTable: select p3. nodeval from pathjable pi, pathjndex Jable il, pathjable p2, pathjndex Jable i2, pathjable p3, pathjndex Jable i3 where il.path = 'a.b.' and il.pid = p I.pid and p2.docid = pi .docid and p2. startpos > p 1.startpos and p2.startpos < pi. endpos and p2.nodeval = T and p2.pid = i2.ρid and i2.path = 'a.b.@id.' and p3. docid = pi. docid and p3. startpos > pi. startpos and p3. startpos < pi .endpos and p3.pid = i3.pid and i3.pafh ='a.b.c.' and p3.nodetype = 3 ; Consider the following XPath expression, which includes the "//" symbol: XPath: lie The "//" symbol specifies selection of all the descendents of the document root. A "like" operator can be used to evaluate this type XPath expression. This following is an example SQL statement that can be used to queries against the PathJTable and PathJndexJTable for this XPath expression: select pi. nodeval from pathjable pi, pathjndex Jable il where il.path like '%c.' and il.pid = p I.pid and pi. nodetype = 3; The following XPath expression combines aspects of the previous three examples: XPath: /a[//id>"l"]/b/c/d This XPath expression can be translated to the following SQL statement: select p3.nodeval from pathjable pi, pathjndex Jable il, pathjable p2, pathjndex Jable i2, pathjable p3, pathjndex Jable i3 where il .path = 'a.' and il.pid = p I.pid and pi. nodetype = 1 and p2. docid = pi. docid and p2.nodetype = 3 and p2. nodeval > 1 and p2.pid = i2.pid and i2.path like '%@id.' and p3.docid = pi. docid and p3. startpos > pi. startpos and p3. startpos < pi. endpos and p3.pid = i3.pid and i3.path = 'a.b.c.d.' and p3.nodetype = 3 ;
SYSTEM ARCHITECTURE OVERVIEW The execution of the sequences of instructions required to practice the invention may be performed in embodiments of the invention by a computer system 1400 as shown in Fig. 7. In an embodiment of the invention, execution of the sequences of instructions required to practice the invention is performed by a single computer system 1400. According to other embodiments of the invention, two or more computer systems 1400 coupled by a communication link 1415 may perform the sequence of instructions required to practice the invention in coordination with one another. In order to avoid needlessly obscuring the invention, a description of only one computer system 1400 will be presented below; however, it should be understood that any number of computer systems 1400 may be employed to practice the invention. A computer system 1400 according to an embodiment of the invention will now be described with reference to Fig. 7, which is a block diagram of the functional components of a computer system 1400 according to an embodiment of the invention. As used herein, the term computer system 1400 is broadly used to describe any computing device that can store and independently run one or more programs. Each computer system 1400 may include a communication interface 1414 coupled to the bus 1406. The communication interface 1414 provides two-way communication between computer systems 1400. The communication interface 1414 of a respective computer system 1400 transmits and receives electrical, electromagnetic or optical signals, that include data streams representing various types of signal information, e.g., instructions, messages and data. A communication link 1415 links one computer system 1400 with another computer system 1400. For example, the communication link 1415 may be a LAN, in which case the communication interface 1414 may be a LAN card, or the communication link 1415 may be a PSTN, in which case the communication interface 1414 may be an integrated services digital network (ISDN) card or a modem. A computer system 1400 may transmit and receive messages, data, and instructions, including program, i.e., application, code, through its respective communication link 1415 and communication interface 1414. Received program code may be executed by the respective processor(s) 1407 as it is received, and/or stored in the storage device 1410, or other associated non- volatile media, for later execution. In an embodiment, the computer system 1400 operates in conjunction with a data storage system 1431, e.g., a data storage system 1431 that contains a database 1432 that is readily accessible by the computer system 1400. The computer system 1400 communicates with the data storage system 1431 through a data interface 1433. A data interface 1433, which is coupled to the bus 1406, transmits and receives electrical, electromagnetic or optical signals, that include data streams representing various types of signal information, e.g., instructions, messages and data. In embodiments of the invention, the functions of the data interface 1433 may be performed by the communication interface 1414. Computer system 1400 includes a bus 1406 or other communication mechanism for communicating instructions, messages and data, collectively, information, and one or more processors 1407 coupled with the bus 1406 for processing information. Computer system 1400 also includes a main memory 1408, such as a random access memory (RAM) or other dynamic storage device, coupled to the bus 1406 for storing dynamic data and instructions to be executed by the processor(s) 1407. The main memory 1408 also may be used for storing temporary data, i.e., variables, or other intermediate information during execution of instructions by the processors) 1407. The computer system 1400 may further include a read only memory (ROM) 1409 or other static storage device coupled to the bus 1406 for storing static data and instructions for the processors) 1407. A storage device 1410, such as a magnetic disk or optical disk, may also be provided and coupled to the bus 1406 for storing data and instructions for the processor(s) 1407. A computer system 1400 may be coupled via the bus 1406 to a display device 1411, such as, but not limited to, a cathode ray tube (CRT), for displaying information to a user. An input device 1412, e.g., alphanumeric and other keys, is coupled to the bus 1406 for communicating information and command selections to the processor(s) 1407. According to one embodiment of the invention, an individual computer system 1400 performs specific operations by their respective processor(s) 1407 executing one or more sequences of one or more instructions contained in the main memory 1408. Such instructions may be read into the main memory 1408 from another computer-usable medium, such as the ROM 1409 or the storage device 1410. Execution of the sequences of instructions contained in the main memory 1408 causes the processor(s) 1407 to perform the processes described herein. In alternative embodiments, hard-wired circuitry may be used in place of or in combination with software instructions to implement the invention. Thus, embodiments of the invention are not limited to any specific combination of hardware circuitry and/or software. The term "computer-usable medium," as used herein, refers to any medium that provides information or is usable by the processor(s) 1407. Such a medium may take many forms, including, but not limited to, non- volatile, volatile and transmission media. Non-volatile media, i.e., media that can retain information in the absence of power, includes the ROM 1409, CD ROM, magnetic tape, and magnetic discs. Volatile media, i.e., media that can not retain information in the absence of power, includes the main memory 1408. Transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise the bus 1406. Transmission media can also take the form of carrier waves; i.e., electromagnetic waves that can be modulated, as in frequency, amplitude or phase, to transmit information signals. Additionally, transmission media can talce the form of acoustic or light waves, such as those generated during radio wave and infrared data communications. In the foregoing specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention. For example, the reader is to understand that the specific ordering and combination of process actions shown in the process flow diagrams described herein is merely illustrative, and the invention can be performed using different or additional process actions, or a different combination or ordering of process actions. The specification and drawings are, accordingly, to be regarded in an illustrative rather than restrictive sense.

Claims

CLAIMSWhat is claimed is:
1. A method for storing unstructured XML data into a relational database, comprising: assigning a document identifier to an XML document; parsing the XML document to identify a node; for the identified node in the XML document: storing path information for the node; storing hierarchical information for the node; and storing node data for the node.
2. The method of claim 1 in which the hierarchical information comprises a hierarchical level within the XML document.
3. The method of claim 1 in which the node data comprises a start position, end position, node type, or node value.
4. The method of claim 1 in which the document identifier is a unique identifier for each different XML document.
5. The method of claim 1 in which the path information comprises a full path for the node.
6. The method of claim 1 in which the path information comprises a path identifier.
7. The method of claim 6 in which the path identifier corresponds to a key to a path entry containing a full path for the node.
8. The method of claim 7 in which the path entry resides in a first table structure and the path information, hierarchical information, and node data reside in a second table structure.
9. The method of claim 7 in which the path entry comprises node name corresponding to a name of a terminal node.
10. The method of claim 1 further comprising: maintaining one or more indexes.
11. The method of claim 10 in which the one or more indexes comprise an index on a path identifier, an index on the document identifier and a start position, or an index on the document identifier, start position, and node level.
12. The method of claim 10 in which the path identifier corresponds to a key to a path entry containing a full path for the node, the path entry resides in a separate table, and the one or more indexes comprise an index on path identifiers or a unique index on reverse paths.
13. A system for performing the method of any of claims 1-12.
14. A computer program product comprising a computer usable medium, the computer usable medium having executable code, an execution of which causes the method of any of claims 1 - 12 to be performed.
15. A method to access a computer-implemented structure for storing XML data in a relational database, the computer implemented structure comprising a first table structure, the first table structure comprising a document identifier corresponding to an XML document, path information for a node within the XML document, hierarchical information for the node, and node data for the node, the method comprising: generating a SQL query against the computer-implemented structure; and producing a result set based upon executing the SQL query.
16. The method of claim 15 in which the SQL query reconstructs the XML document.
17. The method of claim 16 in which the SQL query provides the same result as the following: select i.nodename, p. startpos, p.endpos, p.nodetype, p.nodeval from pathjable p, pathjndexjable i where p. docid = : 1 and p.pid = i.pid order by p. startpos where pathjable comprises a first column for the start position of the node (startpos), a second column for the end position of the node (endpos), a node type column (nodetype), a node value column (nodeval), a path identifier column (pid), and a document identifier column (docid), and a pathjndexjable comprises a path identifier column (pid), a path column (path), and a nodename column (nodename).
18. The method of claim 15 in which the SQL query identifier a fragment within the XML document.
19. The method of claim 18 in which the SQL query provides the same result as the following: select i.nodename, p. startpos, p.endpos, p.nodetype, p.nodeval from pathjable p, pathjndexjable i, (select docid, startpos, endpos from pathjable where rowid = : 1) p2 where p. docid = p2. docid and p.startpos >= p2. startpos and p.endpos <= p2. endpos and p.pid = i.pid order by p.startpos where pathjable comprises a first column for the start position of the node (startpos), a second column for the end position of the node (endpos), a node type column (nodetype), a node value column (nodeval), a path identifier column (pid), and a document identifier column (docid), and a pathjndexjable comprises a path identifier column (pid), a path column (path), and a nodename column (nodename).
20. The method of claim 15 in which the SQL query corresponds to an XPath expression.
21. The method of claim 20 in which the XPath expression is translated to the SQL query by: breaking the XPath expression into multiple components; creating a new SQL query corresponding to each of the multiple components; and joining the new SQL query corresponding a component to its previous component.
22. The method of claim 21 in which the XPath expression is broken into multiple components by considering each continuous segment of simple XPath, wherein each occurrence of a predicate within the XPath causes creation of a new component.
23. The method of claim 22 wherein a set of node names separated by "/" corresponds to a single XPath component.
24. The method of claim 21 in which the new SQL query comprises a join of a pathjndexjable and a pathjable.
25. The method of claim 21 in which the new SQL query comprises one or more conditions.
26. The method of claim 25 in which the one or more conditions comprises a condition for the path being chosen, a condition for the node type, or a condition for the node value.
27. The method of claim 21 in which the act of joining the new SQL query corresponding the component to its previous component uses a join condition comprising a join on a document identifier or a join on a hierarchy relationship.
28. A system for performing the method of any of claims 15-27.
29. A computer program product comprising a computer usable medium, the computer usable medium having executable code, an execution of which causes the method of any of claims 15-27 to be performed.
30. A method for managing an unstructured document in a relational database system, comprising: storing the unstructured document in a storage structure in the relational database system, the storage structure corresponding to a universal schema; determining whether to create an index upon the storage structure, wherein one or more indexes are maintained if desired; and accessing the unstructured documents by accessing the storage structure.
31. The method of claim 30 in which the unstructured document comprises an XML document.
32. The method of claim 31 in which the storage structure comprises: a document identifier corresponding to an XML document; path information for a node within the XML document; hierarchical information for the node; and node data for the node.
33. The method of claim 32 in which the one or more indexes comprise an index on a path identifier, an index on the document identifier and a start position, or an index on the document identifier, start position, and node level.
34. The method of claim 31 further comprising a second structure for storing path data, the second structure comprising: a path identifier; a full path for the node; and a node name corresponding to a name of a terminal node.
35. The method of claim 34 in which the one or more indexes comprise an index on path identifiers or a unique index on reverse paths.
36. The method of claim 31 in which the unstructured documents are accessed by accessing the storage structure using a SQL query.
37. The method of claim 36 in which the SQL query reconstructs the XML document.
38. The method of claim 36 in wliich the SQL query identifier a fragment within the unstructured documents .
39. A system for performing the method of any of claims 30-38.
40. A computer program product comprising a computer usable medium, the computer usable medium having executable code, an execution of which causes the method of any of claims 30-38 to be performed.
PCT/US2004/029070 2003-09-05 2004-09-03 Method and mechanism for efficient storage and query of xml documents based on paths WO2005024670A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
US50045003P 2003-09-05 2003-09-05
US60/500,450 2003-09-05
US10/763,355 US7478100B2 (en) 2003-09-05 2004-01-23 Method and mechanism for efficient storage and query of XML documents based on paths
US10/763,355 2004-01-23

Publications (1)

Publication Number Publication Date
WO2005024670A1 true WO2005024670A1 (en) 2005-03-17

Family

ID=34228701

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2004/029070 WO2005024670A1 (en) 2003-09-05 2004-09-03 Method and mechanism for efficient storage and query of xml documents based on paths

Country Status (2)

Country Link
US (2) US7478100B2 (en)
WO (1) WO2005024670A1 (en)

Families Citing this family (99)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7146409B1 (en) * 2001-07-24 2006-12-05 Brightplanet Corporation System and method for efficient control and capture of dynamic database content
US7698642B1 (en) 2002-09-06 2010-04-13 Oracle International Corporation Method and apparatus for generating prompts
US8037082B2 (en) * 2003-07-22 2011-10-11 International Business Machines Corporation Isolated ordered regions (IOR) node order
US8694510B2 (en) * 2003-09-04 2014-04-08 Oracle International Corporation Indexing XML documents efficiently
US8229932B2 (en) * 2003-09-04 2012-07-24 Oracle International Corporation Storing XML documents efficiently in an RDBMS
US7478100B2 (en) * 2003-09-05 2009-01-13 Oracle International Corporation Method and mechanism for efficient storage and query of XML documents based on paths
US7480646B2 (en) * 2003-10-23 2009-01-20 Microsoft Corporation Type path indexing
US7607110B2 (en) * 2003-10-23 2009-10-20 Microsoft Corporation Element persistent identification
US20050091273A1 (en) * 2003-10-24 2005-04-28 International Business Machines Corporation Integrated control and data manager for i2 demand manager
US7426516B1 (en) * 2003-11-24 2008-09-16 Novell, Inc. Mechanism for supporting indexed tagged content in a general purpose data store
US20050131926A1 (en) * 2003-12-10 2005-06-16 Siemens Corporate Research Inc. Method of hybrid searching for extensible markup language (XML) documents
US7976539B2 (en) * 2004-03-05 2011-07-12 Hansen Medical, Inc. System and method for denaturing and fixing collagenous tissue
US7974681B2 (en) 2004-03-05 2011-07-05 Hansen Medical, Inc. Robotic catheter system
JP4313703B2 (en) * 2004-03-12 2009-08-12 彼方株式会社 Information processing apparatus, system, method, and program
US8312110B2 (en) * 2004-03-12 2012-11-13 Kanata Limited Content manipulation using hierarchical address translations across a network
US7200595B2 (en) * 2004-03-29 2007-04-03 Microsoft Corporation Systems and methods for fine grained access control of data stored in relational databases
US7599937B2 (en) * 2004-06-28 2009-10-06 Microsoft Corporation Systems and methods for fine grained access control of data stored in relational databases
US7302447B2 (en) * 2005-01-14 2007-11-27 International Business Machines Corporation Virtual columns
US7603362B2 (en) * 2004-08-20 2009-10-13 Microsoft Corporation Ordered list management
US7698633B2 (en) * 2004-11-24 2010-04-13 Rojer Alan S Markup metalanguage
JP4301513B2 (en) * 2004-11-26 2009-07-22 インターナショナル・ビジネス・マシーンズ・コーポレーション Judgment method of access control effect using policy
US20060129745A1 (en) * 2004-12-11 2006-06-15 Gunther Thiel Process and appliance for data processing and computer program product
US7949941B2 (en) * 2005-04-22 2011-05-24 Oracle International Corporation Optimizing XSLT based on input XML document structure description and translating XSLT into equivalent XQuery expressions
US7849049B2 (en) 2005-07-05 2010-12-07 Clarabridge, Inc. Schema and ETL tools for structured and unstructured data
US7849048B2 (en) 2005-07-05 2010-12-07 Clarabridge, Inc. System and method of making unstructured data available to structured data analysis tools
US7917482B1 (en) * 2005-08-10 2011-03-29 Infoblox Inc. Indexing of database queries
US7548926B2 (en) * 2005-10-05 2009-06-16 Microsoft Corporation High performance navigator for parsing inputs of a message
US7533111B2 (en) * 2005-12-30 2009-05-12 Microsoft Corporation Using soap messages for inverse query expressions
US20070198479A1 (en) * 2006-02-16 2007-08-23 International Business Machines Corporation Streaming XPath algorithm for XPath expressions with predicates
US20070260450A1 (en) * 2006-05-05 2007-11-08 Yudong Sun Indexing parsed natural language texts for advanced search
US20080097959A1 (en) * 2006-06-14 2008-04-24 Nec Laboratories America, Inc. Scalable xml filtering with bottom up path matching and encoded path joins
US7774700B2 (en) * 2006-06-20 2010-08-10 Oracle International Corporation Partial evaluation of XML queries for program analysis
US20080059439A1 (en) * 2006-08-30 2008-03-06 Lucent Technologies Inc. Query Translation from XPath to SQL in the Presence of Recursive DTDs
US9436779B2 (en) * 2006-11-17 2016-09-06 Oracle International Corporation Techniques of efficient XML query using combination of XML table index and path/value index
US7840590B2 (en) * 2006-12-18 2010-11-23 Oracle International Corporation Querying and fragment extraction within resources in a hierarchical repository
US20080147615A1 (en) * 2006-12-18 2008-06-19 Oracle International Corporation Xpath based evaluation for content stored in a hierarchical database repository using xmlindex
US7908260B1 (en) 2006-12-29 2011-03-15 BrightPlanet Corporation II, Inc. Source editing, internationalization, advanced configuration wizard, and summary page selection for information automation systems
US8078611B2 (en) * 2007-01-03 2011-12-13 Oracle International Corporation Query modes for translation-enabled XML documents
US20080201338A1 (en) * 2007-02-16 2008-08-21 Microsoft Corporation Rest for entities
US20080201234A1 (en) * 2007-02-16 2008-08-21 Microsoft Corporation Live entities internet store service
US7860899B2 (en) * 2007-03-26 2010-12-28 Oracle International Corporation Automatically determining a database representation for an abstract datatype
US20080319957A1 (en) * 2007-06-19 2008-12-25 Microsoft Corporation Extensible command trees for entity data model platform
US20090063533A1 (en) * 2007-08-27 2009-03-05 International Business Machines Corporation Method of supporting multiple extractions and binding order in xml pivot join
US8972377B2 (en) * 2007-10-25 2015-03-03 International Business Machines Corporation Efficient method of using XML value indexes without exact path information to filter XML documents for more specific XPath queries
US8046353B2 (en) * 2007-11-02 2011-10-25 Citrix Online Llc Method and apparatus for searching a hierarchical database and an unstructured database with a single search query
EP2240875A1 (en) * 2008-01-15 2010-10-20 International Business Machines Corporation Method and system for navigation of a data structure
US8145641B2 (en) * 2008-01-18 2012-03-27 Oracle International Corporation Managing feature data based on spatial collections
US20090210400A1 (en) * 2008-02-15 2009-08-20 Microsoft Corporation Translating Identifier in Request into Data Structure
US8868482B2 (en) * 2008-03-20 2014-10-21 Oracle International Corporation Inferring schemas from XML document collections
US8397158B1 (en) * 2008-03-31 2013-03-12 Sonoa Networks India (PVT) Ltd System and method for partial parsing of XML documents and modification thereof
US9715558B2 (en) * 2008-04-14 2017-07-25 International Business Machines Corporation Structure-position mapping of XML with variable-length data
US8010544B2 (en) * 2008-06-06 2011-08-30 Yahoo! Inc. Inverted indices in information extraction to improve records extracted per annotation
JP5220483B2 (en) * 2008-06-06 2013-06-26 インターナショナル・ビジネス・マシーンズ・コーポレーション Computer system for performing aggregate calculation on tree-structured data, method and computer program therefor
US10452716B2 (en) * 2008-06-07 2019-10-22 International Business Machines Corporation Optimizing complex path endpoint resolution
US20100030727A1 (en) * 2008-07-29 2010-02-04 Sivasankaran Chandrasekar Technique For Using Occurrence Constraints To Optimize XML Index Access
US8073843B2 (en) * 2008-07-29 2011-12-06 Oracle International Corporation Mechanism for deferred rewrite of multiple XPath evaluations over binary XML
JP5484471B2 (en) 2008-09-19 2014-05-07 オラクル・インターナショナル・コーポレイション Storage-side storage request management
TWI385537B (en) * 2009-05-04 2013-02-11 Univ Nat Taiwan Assisting method and apparatus for accessing markup language document
US8745031B2 (en) * 2009-05-28 2014-06-03 Oracle International Corporation Cache-based predicate handling for queries on XML data using uncorrelated path-based row sources
US8825745B2 (en) 2010-07-11 2014-09-02 Microsoft Corporation URL-facilitated access to spreadsheet elements
US20120072824A1 (en) * 2010-09-20 2012-03-22 Research In Motion Limited Content acquisition documents, methods, and systems
US9317595B2 (en) 2010-12-06 2016-04-19 Yahoo! Inc. Fast title/summary extraction from long descriptions
US8392408B1 (en) 2011-05-04 2013-03-05 Google Inc. Coordinating successive search queries using a query cursor
US8645388B1 (en) * 2011-06-16 2014-02-04 Emc Corporation Method and system for processing a query
US8826284B1 (en) 2011-10-31 2014-09-02 Google Inc. Scalable task scheduling
US9110933B1 (en) 2011-11-04 2015-08-18 Google Inc. Processing data triggers in an untrusted environment based on information stored in a trusted environment
US8862588B1 (en) * 2011-11-30 2014-10-14 Google Inc. Generating an empirically-determined schema for a schemaless database
US9064013B1 (en) 2011-11-30 2015-06-23 Google Inc. Application of resource limits to request processing
US8650204B2 (en) * 2011-12-19 2014-02-11 Oracle International Corporation Techniques for efficiently supporting XQuery update facility in SQL/XML
US9477749B2 (en) 2012-03-02 2016-10-25 Clarabridge, Inc. Apparatus for identifying root cause using unstructured data
US9235607B1 (en) 2012-03-29 2016-01-12 Google Inc. Specifying a predetermined degree of inconsistency for test data
JP2013218627A (en) * 2012-04-12 2013-10-24 Nippon Telegr & Teleph Corp <Ntt> Method and device for extracting information from structured document and program
US9824128B1 (en) 2012-08-01 2017-11-21 The United States Of America As Represented By The Administrator Of Nasa System for performing single query searches of heterogeneous and dispersed databases
US10489365B2 (en) * 2013-03-14 2019-11-26 Oracle International Corporation Predicate offload of large objects
US10642837B2 (en) 2013-03-15 2020-05-05 Oracle International Corporation Relocating derived cache during data rebalance to maintain application performance
US10528590B2 (en) 2014-09-26 2020-01-07 Oracle International Corporation Optimizing a query with extrema function using in-memory data summaries on the storage server
US20140380246A1 (en) * 2013-06-24 2014-12-25 Aol Inc. Systems and methods for multi-layer user content navigation
US20150039587A1 (en) * 2013-07-31 2015-02-05 Oracle International Corporation Generic sql enhancement to query any semi-structured data and techniques to efficiently support such enhancements
US10565178B1 (en) * 2015-03-11 2020-02-18 Fair Isaac Corporation Efficient storage and retrieval of XML data
US10776357B2 (en) 2015-08-26 2020-09-15 Infosys Limited System and method of data join and metadata configuration
US10353966B2 (en) 2015-11-19 2019-07-16 BloomReach, Inc. Dynamic attributes for searching
WO2017116341A2 (en) 2015-12-31 2017-07-06 Turkcell Teknoloji Arastirma Ve Gelistirme Anonim Sirketi A system for parallel processing and data modelling
CN107085595B (en) * 2017-03-23 2023-07-14 国网浙江省电力公司信息通信分公司 Unstructured metadata association method and system for power industry
US11328000B1 (en) 2017-07-05 2022-05-10 Liberty Mutual Insurance Company Method, apparatus and computer program product for transforming structured hierarchical data into flattened lineage and attribute tables
US11086876B2 (en) 2017-09-29 2021-08-10 Oracle International Corporation Storing derived summaries on persistent memory of a storage device
US11409741B2 (en) 2017-09-30 2022-08-09 Oracle International Corporation Enabling data format specific database functionalities over existing data types by marking operand values
CN107633870B (en) * 2017-10-25 2020-12-08 天津开心生活科技有限公司 Data extraction method and device, storage medium and electronic equipment
CN108021629B (en) * 2017-11-22 2021-06-11 贝壳找房(北京)科技有限公司 Method, device and system for generating advertisement material data
CN110633315A (en) * 2018-06-20 2019-12-31 中国移动通信集团有限公司 Data processing method and device and computer storage medium
US11157478B2 (en) 2018-12-28 2021-10-26 Oracle International Corporation Technique of comprehensively support autonomous JSON document object (AJD) cloud service
US11200234B2 (en) 2019-06-14 2021-12-14 Oracle International Corporation Non-disruptive dynamic ad-hoc database catalog services
US10990596B2 (en) 2019-06-14 2021-04-27 Oracle International Corporation Non-disruptive referencing of special purpose operators for database management systems
CN111462327B (en) * 2020-03-12 2022-12-13 成都飞机工业(集团)有限责任公司 Unstructured data analysis method for three-dimensional inspection model of three-dimensional modeling software
US11640380B2 (en) 2021-03-10 2023-05-02 Oracle International Corporation Technique of comprehensively supporting multi-value, multi-field, multilevel, multi-position functional index over stored aggregately stored data in RDBMS
CN116266108A (en) * 2021-12-17 2023-06-20 北京字跳网络技术有限公司 Group node export and import method and device
US20230342339A1 (en) * 2022-04-22 2023-10-26 Dell Products L.P. Methods Make Web and Business Application Data Access Agnostic to Schema Variations and Migrations
US11841838B1 (en) 2022-05-23 2023-12-12 Dell Products L.P. Data schema compacting operation when performing a data schema mapping operation
US11966375B2 (en) * 2022-05-25 2024-04-23 Hop.dev, Inc. Enabling communication between multiple databases having disparate indices
CN116627972B (en) * 2023-05-25 2024-03-01 成都融见软件科技有限公司 Structured data discrete storage system for covering index

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001042881A2 (en) * 1999-12-06 2001-06-14 B-Bop Associates, Inc. System and method for the storage, indexing and retrieval of xml documents using relational databases
US20020156811A1 (en) * 2000-05-23 2002-10-24 Krupa Kenneth A. System and method for converting an XML data structure into a relational database

Family Cites Families (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5455945A (en) 1993-05-19 1995-10-03 Vanderdrift; Richard System and method for dynamically displaying entering, and updating data from a database
US6671853B1 (en) * 1999-07-15 2003-12-30 International Business Machines Corporation Method and system for selectively streaming markup language documents
US6662342B1 (en) 1999-12-13 2003-12-09 International Business Machines Corporation Method, system, and program for providing access to objects in a document
US6594651B2 (en) 1999-12-22 2003-07-15 Ncr Corporation Method and apparatus for parallel execution of SQL-from within user defined functions
US6507834B1 (en) 1999-12-22 2003-01-14 Ncr Corporation Method and apparatus for parallel execution of SQL from stored procedures
US6678686B1 (en) 1999-12-28 2004-01-13 Ncr Corporation Method and apparatus for evaluating index predicates on complex data types using virtual indexed streams
US6742054B1 (en) * 2000-04-07 2004-05-25 Vitria Technology, Inc. Method of executing a data transformation specification
US6678672B1 (en) 2000-05-31 2004-01-13 Ncr Corporation Efficient exception handling during access plan execution in an on-line analytic processing system
US6925631B2 (en) 2000-12-08 2005-08-02 Hewlett-Packard Development Company, L.P. Method, computer system and computer program product for processing extensible markup language streams
US7178100B2 (en) 2000-12-15 2007-02-13 Call Charles G Methods and apparatus for storing and manipulating variable length and fixed length data elements as a sequence of fixed length integers
US6665663B2 (en) 2001-03-15 2003-12-16 International Business Machines Corporation Outerjoin and antijoin reordering using extended eligibility lists
US20010029604A1 (en) 2001-04-27 2001-10-11 Jacob Dreyband Descriptive data construct mapping method and apparatus
US6799184B2 (en) * 2001-06-21 2004-09-28 Sybase, Inc. Relational database system providing XML query support
US7117220B2 (en) 2001-10-15 2006-10-03 Vanderdrift Richard William System and method for non-programmers to dynamically manage multiple sets of XML document data
US6832219B2 (en) * 2002-03-18 2004-12-14 International Business Machines Corporation Method and system for storing and querying of markup based documents in a relational database
WO2003107323A1 (en) 2002-06-13 2003-12-24 Cerisent Corporation A subtree-structured xml database
AUPS300402A0 (en) 2002-06-17 2002-07-11 Canon Kabushiki Kaisha Indexing and querying structured documents
US7162485B2 (en) 2002-06-19 2007-01-09 Georg Gottlob Efficient processing of XPath queries
US7171407B2 (en) 2002-10-03 2007-01-30 International Business Machines Corporation Method for streaming XPath processing with forward and backward axes
US7478100B2 (en) * 2003-09-05 2009-01-13 Oracle International Corporation Method and mechanism for efficient storage and query of XML documents based on paths
US7526490B2 (en) * 2004-06-08 2009-04-28 Oracle International Corporation Method of and system for providing positional based object to XML mapping
US7370028B2 (en) * 2004-06-08 2008-05-06 Oracle International Corp. Method of and system for providing namespace based object to XML mapping

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001042881A2 (en) * 1999-12-06 2001-06-14 B-Bop Associates, Inc. System and method for the storage, indexing and retrieval of xml documents using relational databases
US20020156811A1 (en) * 2000-05-23 2002-10-24 Krupa Kenneth A. System and method for converting an XML data structure into a relational database

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
KUDRASS T: "Management of XML documents without schema in relational database systems", INFORMATION AND SOFTWARE TECHNOLOGY, vol. 44, no. 4, 31 March 2002 (2002-03-31), pages 269 - 275, XP004347776 *
YOSHIKAWA M ET AL: "XREL: A PATH-BASED APPROACH TO STORAGE AND RETRIEVAL OF XML DOCUMENTS USING RELATIONAL DATABASES", ACM TRANSACTIONS ON INTERNET TECHNOLOGY, ACM, NEW YORK, NY, US, vol. 1, no. 1, August 2001 (2001-08-01), pages 110 - 141, XP001143686, ISSN: 1049-3301 *

Also Published As

Publication number Publication date
US20050055355A1 (en) 2005-03-10
US7478100B2 (en) 2009-01-13
US8209352B2 (en) 2012-06-26
US20100011010A1 (en) 2010-01-14

Similar Documents

Publication Publication Date Title
US7478100B2 (en) Method and mechanism for efficient storage and query of XML documents based on paths
US7305414B2 (en) Techniques for efficient integration of text searching with queries over XML data
US7024425B2 (en) Method and apparatus for flexible storage and uniform manipulation of XML data in a relational database system
US6721727B2 (en) XML documents stored as column data
US7398265B2 (en) Efficient query processing of XML data using XML index
US7103611B2 (en) Techniques for retaining hierarchical information in mapping between XML documents and relational data
Suciu Semistructured data and XML
US7499915B2 (en) Index for accessing XML data
CA2570462C (en) Efficient extraction of xml content stored in a lob
US6836778B2 (en) Techniques for changing XML content in a relational database
US20090157722A1 (en) Rewriting node reference-based xquery using sql/xml
CA2421214C (en) Method and apparatus for xml data storage, query rewrites, visualization, mapping and referencing
WO2001033433A1 (en) Method and apparatus for establishing and using an xml database
WO2008011294A1 (en) Semantic aware processing of xml documents
CA2561734C (en) Index for accessing xml data
Min et al. XTRON: An XML data management system using relational databases
AU2007229359B2 (en) Method and apparatus for flexible storage and uniform manipulation of XML data in a relational database system
Park et al. Efficient schemes of executing star operators in XPath query expressions
Harrathi et al. A query graph for visual querying structured documents

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BW BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE EG ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NA NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SY TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): GM KE LS MW MZ NA SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
DPEN Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed from 20040101)
122 Ep: pct application non-entry in european phase