Techniques for efficiently storing and querying in a relational database, XML documents conforming to schemas that contain cyclic constructs
First Claim
1. A computer-implemented method for storing XML documents in a relational database, the method comprising:
- populating a first table and a second table, which are stored within said relational database on a storage medium, with data from an XML document that conforms to an XML schema, wherein the document contains an occurrence of a root element type and a first occurrence of a second element type and a second occurrence of said second element type;
wherein the first and second occurrences that descend from the occurrence of a root element type;
wherein the step of populating comprises;
a processor storing a record in the first table, wherein the record in the first table corresponds with at least the occurrence of the root element type; and
storing a first record in the second table, wherein the first record in the second table corresponds with the first occurrence of the second element type;
storing a second record in the second table, wherein the second record corresponds to said second occurrence of the second element type that descends from the first occurrence of the second element type;
wherein each of the first record and the second record in the second table includes a value that identifies the record in the first table; and
wherein the first table is a separate table than the second table;
wherein the schema describes a cyclic construct and the XML document contains a cyclic construct of which the first and second occurrences of the second element type is part.
1 Assignment
0 Petitions
Accused Products
Abstract
To associate XML data objects (“child objects”), stored in rows of relational or object-relational tables, with the appropriate XML data objects (“parent objects”) from which the child objects descend, tables that contain child objects (“out-of-line” tables) are constructed with an additional column. In one embodiment, this column stores values that identify the root objects, in the appropriate table, from which the respective child objects descend. Hence, the root object from which any given object descends is traceable by following the respective value back to the corresponding root object. In one embodiment, this column stores values that identify the complete XML hierarchical path, through multiple tables, back to the root object from which the respective child objects descend. Consequently, XML query language queries against XML documents stored in such tables can be rewritten as SQL queries against the data in the tables, even in the presence of cyclic constructs.
-
Citations
30 Claims
-
1. A computer-implemented method for storing XML documents in a relational database, the method comprising:
-
populating a first table and a second table, which are stored within said relational database on a storage medium, with data from an XML document that conforms to an XML schema, wherein the document contains an occurrence of a root element type and a first occurrence of a second element type and a second occurrence of said second element type;
wherein the first and second occurrences that descend from the occurrence of a root element type;wherein the step of populating comprises; a processor storing a record in the first table, wherein the record in the first table corresponds with at least the occurrence of the root element type; and storing a first record in the second table, wherein the first record in the second table corresponds with the first occurrence of the second element type; storing a second record in the second table, wherein the second record corresponds to said second occurrence of the second element type that descends from the first occurrence of the second element type; wherein each of the first record and the second record in the second table includes a value that identifies the record in the first table; and wherein the first table is a separate table than the second table; wherein the schema describes a cyclic construct and the XML document contains a cyclic construct of which the first and second occurrences of the second element type is part. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30)
-
Specification