Providing XML cursor support on an XML repository built on top of a relational database system
First Claim
1. A method for providing an XML query cursor for traversing and fetching XML data, said XML query cursor constructed via a hybrid approach, said method for queries of XML data stored in a relational database comprising steps of:
- a. receiving one or more queries;
b. translating received queries into one or more SQL queries,c. based on XML query cursor position, selecting specific SQL queries from among said one or more SQL queries and executing said specific SQL queries of data located in said relational database, said step of selecting and executing specific SQL queries further comprising;
choosing a query generated for a root node, sending it to and executing it in said relational database if a previous tree root or next tree root node is selected by XML query cursor position;
choosing a parameterized SQL query generated for current element type if a previous sibling or next sibling node is also selected by XML query cursor position;
choosing one or more parameterized SQL queries, depending on the element type of a selected node, sending one or more queries to and executing one or more queries in said relational database if necessary, if a previous or next node is requested by XML query cursor position; and
navigating to a previous or next tuple of dataset result generated by said execution of selected SQL queries and returning said previous or next tuple, andd. returning XML data from said executing step.
1 Assignment
0 Petitions
Accused Products
Abstract
A system and method are provided for XML query cursor implementation through the steps of query translation and processing, query result navigation, and positioned update. An XML query cursor implemented in Interface Definition Language (IDL) as well as an extension to XQuery, an XML query language, is described. These steps are addressed by one of three approaches: multi-cursor, outer union, or hybrid. In each approach, XML data is assumed to be stored in a relational database with a mapping that maps each element to a row in a relational database table. In each approach, a system and method provide for cursor movements and positioned updates in increments of a node, sub-tree, or entire document. Given a user'"'"'s navigation patterns, a system and method is provided to select either a multi-cursor, outer union, or hybrid approach as an optimal implementation for an XML query cursor.
-
Citations
15 Claims
-
1. A method for providing an XML query cursor for traversing and fetching XML data, said XML query cursor constructed via a hybrid approach, said method for queries of XML data stored in a relational database comprising steps of:
-
a. receiving one or more queries; b. translating received queries into one or more SQL queries, c. based on XML query cursor position, selecting specific SQL queries from among said one or more SQL queries and executing said specific SQL queries of data located in said relational database, said step of selecting and executing specific SQL queries further comprising;
choosing a query generated for a root node, sending it to and executing it in said relational database if a previous tree root or next tree root node is selected by XML query cursor position;
choosing a parameterized SQL query generated for current element type if a previous sibling or next sibling node is also selected by XML query cursor position;
choosing one or more parameterized SQL queries, depending on the element type of a selected node, sending one or more queries to and executing one or more queries in said relational database if necessary, if a previous or next node is requested by XML query cursor position; and
navigating to a previous or next tuple of dataset result generated by said execution of selected SQL queries and returning said previous or next tuple, andd. returning XML data from said executing step. - View Dependent Claims (2)
-
-
3. A method for providing multi-dimensional XML cursor functionality for a query of XML data stored in a relational database comprising steps of:
-
a. receiving a query issued over an XML document; b. translating said query issued over an XML document into a top-level SQL query returning only root nodes in a result, c. generating one or more additional SQL queries, d. choosing an SQL query or SQL queries to send to said relational database via an XML cursor, said XML cursor constructed via an outer union approach, e. executing said SQL query or SQL queries, and f. navigating a dataset resulting from execution of said SQL queries, said navigating step comprising;
choosing and executing a single SQL query to said relational database with resulting dataset;
navigating to a previous or next tuple in said resulting dataset and returning said next or previous tuple if the previous or next node is requested by a navigation component;
traversing through previous tuples in said resulting dataset until a parent, previous sibling, or previous tree root tuple is found, and navigating to a desired tuple directly if distance information is available, and returning said tuple if a parent, previous sibling, or previous tree root node is requested by said navigation component;
or traversing through next tuples in said resulting dataset until a child, next sibling, or next tree root tuple is found, or going to a desired tuple directly if distance information is available, and returning said tuple if a child, next sibling, or next tree root node is requested by said navigation component. - View Dependent Claims (4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
-
-
14. A system for multi-dimensional navigation of an XML document comprising:
-
a. an XML cursor manipulated by a user, said XML cursor implemented via a hybrid approach, said hybrid approach has steps comprising;
choosing a query generated for a root node, sending it to and executing it in said relational database if a previous tree root or next tree root node is selected by XML query cursor position;
choosing a parameterized SQL query generated for current element type if a previous sibling or next sibling node is also selected by XML query cursor position;
choosing one or more parameterized SQL queries, depending on the element type of a selected node, sending one or more queries to and executing one or more queries in said relational database if necessary, if a previous or next node is requested by XML query cursor position, and navigating to a previous or next tuple of dataset result generated by said execution of selected SQL queries and returning said previous or next tuple, andb. an XML schema over which said XML cursor navigates, c. a relational database for storing tuples of XML data corresponding to said XML document, and d. a relational database cursor for traversing said tuples of XML data.
-
-
15. A method for providing multi-dimensional XML cursor functionality for a query of XML data stored in a relational database comprising steps of:
-
a. receiving a query issued over an XML document; b. translating said query issued over an XML document into a top-level SQL query that will return only root nodes in a result, c. generating one or more additional SQL queries, d. choosing an SQL query or SQL queries to send to said relational database via an XML cursor, said XML cursor constructed via an hybrid approach, e. executing said SQL query or SQL queries, and f. navigating a dataset resulting from execution of said SQL queries, said navigating step comprising;
choosing said top-level SQL query generated for a root node, sending it to and executing it in said relational database if a previous tree root or next tree root node is requested by said navigation component;
choosing said parameterized SQL query generated for current element type if a previous sibling or next sibling node is requested by navigation component, choosing one or more parameterized SQL queries, depending on the element type of a requested node, sending one or more queries to and executing one or more queries in said relational database if necessary, if a previous or next node is requested by navigation component; and
, navigating to a previous or next tuple of dataset result generated by said execution of chosen parameterized or top-level SQL queries and returning said previous or next tuple.
-
Specification