Claims
- 1. A method for publishing information in a database in XML form, comprising:
creating a user-defined view over the default XML view of the database; writing an XML query over the default XML view.
- 2. A method for processing XML queries over relational data and meta-data using a relational database system, comprising:
representing the default XML view as an XML query over relational catalog tables; retrieving each row from said relational catalog table; tagging column names and grouping on a table name; binding a new construct directly over the rows of the specified relational table; and executing and tagging the query to produce the default view corresponding to the table.
- 3. The method of claim 2 wherein for said retrieving, each said row represents a unique column in said relational database and includes the name of the column's table and the name of the column itself.
- 4. A method for processing XML queries over relational data and meta-data using a relational database system, comprising:
parsing an input XML query over a default XML view into an internal representation of said query; presenting all non-meta-data references to said default XML view; identifying all meta-data references to said default XML view; substituting each of said non-meta-data references with direct references to relational database tables; replacing each of said meta-data references with a new reference to the internal representation of the default view over relational catalog tables, said new references including a higher-order operator ExecXQuery; optimizing said internal representation of said query; eliminating each ExecXQuery instance by recursively invoking said query processing on the inputs to ExecQuery begin executing the internal representation below ExecXQuery to convert said meta-data references to non-meta-data references; repeating said substituting for all former meta-data references; and returning XML query results.
- 5. The method of claim 4, wherein said internal representation is in XML Query Graph Model format.
- 6. The method of claim 4, wherein said internal representation captures query semantics.
- 7. The method of claim 4, wherein said identifying includes:
binding a first contruct to all “row” elements nested under the category “table” element in the default XML view; selecting only those first construct elements that correspond to a desired category to determine the types that belong to the desired category; binding a second construct to all the “table” elements in the default XML view that correspond to said desired types by
a) getting all said table elements, then; b) selecting those table elements having the same tag name as one of said desired types; determining all desired elements in said second construct; and returning said meta-data references.
- 8. The method of claim 4, wherein said identifying includes:
determining desired types by
a) performing a selection on the category table; b) joining the results of said selection with the tag names of “table” elements in said default XML view; unnesting desired “row” elements from their “table” element; and using the unnested elements to produce returned results.
- 9. The method of claim 4, wherein said operator ExecXQuery corresponds to a sub-query for a particular table in said relational database that, if executed, materializes the “row” elements in the default view for said particular table to produce the result of executing said sub-query.
- 10. The method of claim 4, wherein said optimizing includes pushing down predicates and joins past ExecXQuery to said relational catalog tables.
- 11. The method of claim 4, wherein said executing includes:
producing one or more query strings, each said query string corresponding to a new query that will reconstruct the default XML view of a particular relational table; converting each of said query strings to a corresponding internal representation; unioning each of said query strings together; and grafting the results of said unioning in place of said corresponding ExecXQuery instance.
- 12. The method of claim 4, wherein said eliminating is repeated in a bottom-up manner.
- 13. A computer program product for processing XML queries over relational data and meta-data using a relational database system, comprising a computer-readable medium tangibly embodying computer-executable code thereon, said code including:
a first code for parsing an input XML query over a default XML view into an internal representation of said query; a second code for presenting all non-meta-data references to said default XML view; a third code for identifying all meta-data references to said default XML view; a fourth code for substituting each of said non-meta-data references with direct references to relational database tables; a fifth code for replacing each of said meta-data references with a new reference to the internal representation of the default view over relational catalog tables, said new references including a higher-order operator ExecXQuery; a sixth code for optimizing said internal representation of said query; a seventh code for eliminating each ExecXQuery instance by recursively invoking said query processing on the inputs to ExecQuery begin executing the internal representation below ExecXQuery to convert said meta-data references to non-meta-data references; an eighth code for repeating said substituting for all former meta-data references; and a ninth code for returning XML query results.
- 14. The product of claim 13, wherein said internal representation is in XML Query Graph Model format.
- 15. The product of claim 13, wherein said internal representation captures query semantics.
- 16. The product of claim 13, wherein said identifying includes:
binding a first contruct to all “row” elements nested under the category “table” element in the default XML view; selecting only those first construct elements that correspond to a desired category to determine the types that belong to the desired category; binding a second construct to all the “table” elements in the default XML view that correspond to said desired types by
a) getting all said table elements, then; b) selecting those table elements having the same tag name as one of said desired types; determining all desired elements in said second construct; and returning said meta-data references.
- 17. The product of claim 13, wherein said identifying includes:
determining desired types by
a) performing a selection on the category table; b) joining the results of said selection with the tag names of “table” elements in said default XML view; unnesting desired “row” elements from their “table” element; and using the unnested elements to produce returned results.
- 18. The product of claim 13, wherein said operator ExecXQuery corresponds to a sub-query for a particular table in said relational database that, if executed, materializes the “row” elements in the default view for said particular table to produce the result of executing said sub-query.
- 19. The product of claim 13, wherein said optimizing includes pushing down predicates and joins past ExecXQuery to said relational catalog tables.
- 20. The method of claim 13, wherein said executing includes:
producing one or more query strings, each said query string corresponding to a new query that will reconstruct the default XML view of a particular relational table; converting each of said query strings to a corresponding internal representation; unioning each of said query strings together; and grafting the results of said unioning in place of said corresponding ExecXQuery instance.
- 21. The method of claim 13, wherein said eliminating is repeated in a bottom-up manner.
- 22. A system for processing XML queries over relational data and meta-data using a relational database system, comprising:
means for parsing an input XML query over a default XML view into an internal representation of said query; means for presenting all non-meta-data references to said default XML view; means for identifying all meta-data references to said default XML view; means for substituting each of said non-meta-data references with direct references to relational database tables; means for replacing each of said meta-data references with a new reference to the internal representation of the default view over relational catalog tables, said new references including a higher-order operator ExecXQuery; means for optimizing said internal representation of said query; means for eliminating each ExecXQuery instance by recursively invoking said query processing on the inputs to ExecQuery begin executing the internal representation below ExecXQuery to convert said meta-data references to non-meta-data references; means for repeating said substituting for all former meta-data references; and means for returning XML query results.
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This invention is related to two commonly-owned pending U.S. patent applications, each of which is hereby incorporated by reference, including:
[0002] U.S. Ser. No. 10/234,876 “System, Method, and Computer Program Product For Querying XML Documents Using A Relational Database System”, filed Aug. 30, 2002, and
[0003] U.S. Ser. No. 09/810,167 “Tagging XML Query Results Over Relational DBMSs”, filed Mar. 19, 2001.