Method for converting relational data into XML
First Claim
Patent Images
1. A method for converting relational data from a relational database into extensible markup language (XML) comprising steps of:
- storing a view query that defines a XML view of the relational database;
receiving a user query to access XML data in the XML view of the relational database;
forming an executable query by determining a composition of the view query and the user query;
applying a greedy algorithm to the executable query to form a data extraction portion and an XML construction portion;
transmitting the data extraction portion to the relational database;
receiving at least one tuple stream from the relational database according to the data extraction portion; and
merging the at least one tuple stream and the SML construction portion to generate an XML document, wherein the XML view is capable of defining a document of arbitrary nesting depth.
6 Assignments
0 Petitions
Accused Products
Abstract
A method for converting relational data to XML (eXtensible Markup Language) is provided. The method can use a greedy algorithm to efficiently construct materialized XML views of relational databases. A greedy algorithm designed for XML view definition queries is provided for decomposing a large query into smaller queries and determining which query will run faster without actually running the query.
406 Citations
29 Claims
-
1. A method for converting relational data from a relational database into extensible markup language (XML) comprising steps of:
-
storing a view query that defines a XML view of the relational database;
receiving a user query to access XML data in the XML view of the relational database;
forming an executable query by determining a composition of the view query and the user query;
applying a greedy algorithm to the executable query to form a data extraction portion and an XML construction portion;
transmitting the data extraction portion to the relational database;
receiving at least one tuple stream from the relational database according to the data extraction portion; and
merging the at least one tuple stream and the SML construction portion to generate an XML document, wherein the XML view is capable of defining a document of arbitrary nesting depth. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
converting the executable query into a view tree having plural nodes, each of the nodes having a query;
comparing queries of two adjacent nodes with a combination of the queries of the two adjacent nodes;
selecting either the queries of the two adjacent nodes or the combination of the queries of the two adjacent nodes based on cost; and
repeating said comparing and said selecting of queries until no combination of queries of two adjacent nodes has a cost lower than a cost of the corresponding separate queries.
-
-
10. The method according to claim 1, wherein the step of merging the at least one tuple stream and the XML construction portion to generate an XML document includes applying an integration and tagging algorithm.
-
11. The method according to claim 10, wherein the step of applying an integration and tagging algorithm includes the steps of:
-
receiving the at least one tuple stream, the at least one tuple stream having plural tuples with a corresponding node index for each tuple;
comparing a node index of a first tuple with a node index of a second tuple; and
emitting an XML tag based on said comparing.
-
-
12. A computer readable medium including a set of executable instructions stored thereon for converting relational data stored in a relational database into XML data, the set of instructions including:
-
forming an executable query from a view query and a user query that defines an XML view of the relational database and a user query;
applying a greedy algorithm to the executable query to forma a data extraction portion and an XML construction portion; and
merging the at least one tuple stream and the SML construction portion to generate an XML document, wherein the XML view is capable of defining a document of arbitrary nesting depth. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19)
converting the executable query into a view tree having plural nodes, each of the nodes having a query;
comparing queries of two adjacent nodes with a combination of the queries of the two adjacent nodes; and
selecting either the queries of the two adjacent nodes or the combination of the queries of the two adjacent nodes based on cost.
-
-
18. The computer readable medium according to claim 12, wherein the step of merging the at least one tuple stream and the XML construction portion to generate an XML document includes applying an integration and tagging algorithm.
-
19. The computer readable medium according to claim 18, wherein the step of applying an integration and tagging algorithm includes the steps of:
-
receiving the at least one tuple stream, the at least one tuple stream having plural tuples with a corresponding node index for each tuple;
comparing a node index of a first tuple with a node index of a second tuple; and
emitting an XML tag based on said comparing.
-
-
20. A computer system for converting relational data in a relational database into XML data, and said system comprising:
-
a query composer module configured to form an executable query from a view query and a user query that defines an XML view of the relational data and a user query;
a translator module coupled to the query composer module configured to receive the executable query, partition the executable query through the use of a greedy algorithm, and transmit the data extraction portion to a relational database;
an XML generator module configured to receive the XML-construction portion from said translator module, receive at least one tuple stream from the relational database based on data extraction portion, and merge the at least one tuple stream and the XML-construction portion generate an XML document, wherein the XML view is capable of defining a document of arbitrary nesting depth. - View Dependent Claims (21, 22, 23, 24, 25, 26, 27, 28, 29)
a pattern matcher module configured to match patterns of the user query and the view query to obtain a solutions relation, in which each tuple represents a match; - and
a rewriter module configured to rewrite each tuple.
-
-
29. The computer system according to claim 20, wherein the XML generator module merges the at least one tuple stream and the XML construction portion to generate an XML document by applying an integration and tagging algorithm.
Specification