OPTIMIZED STREAMING EVALUATION OF XML QUERIES
First Claim
1. A computer-implemented method for evaluating XPath expressions, comprising the steps of:
- (1) sending criteria from an XPath evaluation component to an XML event-streaming component;
wherein the criteria is based at least upon a next unmatched step in an XPath expression;
(2) streaming an XML event from the XML event-streaming component to the XPath evaluation component;
wherein the XML event-streaming component determines the XML event based on the criteria;
(3) matching the XML event to said next unmatched step in the XPath expression;
(4) repeating steps 1-3 with respect to a new next unmatched step in the XPath expression, until it is determined that there are no remaining unmatched steps in the XPath expression; and
(5) outputting an XPath result based at least upon the XML event streamed in the last iteration of step 2.
1 Assignment
0 Petitions
Accused Products
Abstract
A database system may perform a streaming evaluation of an XPath expression by utilizing an XPath evaluation component in tandem with an XML event-streaming component. For a more optimal filtered streaming evaluation, the XML event-streaming component may provide an interface whereby the evaluation component sends certain criteria to the event-streaming component when requesting an XML event. The criteria may be based on a next unmatched step in the XPath expression. In response to the request for an XML event, the event-streaming component may only return events that match the criteria. The evaluation component may be, for example, a compiled state machine for the XPath expression. The criteria may be pre-compiled for each possible state in the state machine. The event-streaming component may also utilize the criteria along with schema information to skip parsing of certain segments of XML data.
126 Citations
25 Claims
-
1. A computer-implemented method for evaluating XPath expressions, comprising the steps of:
-
(1) sending criteria from an XPath evaluation component to an XML event-streaming component; wherein the criteria is based at least upon a next unmatched step in an XPath expression; (2) streaming an XML event from the XML event-streaming component to the XPath evaluation component; wherein the XML event-streaming component determines the XML event based on the criteria; (3) matching the XML event to said next unmatched step in the XPath expression; (4) repeating steps 1-3 with respect to a new next unmatched step in the XPath expression, until it is determined that there are no remaining unmatched steps in the XPath expression; and (5) outputting an XPath result based at least upon the XML event streamed in the last iteration of step 2. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 21, 22, 23)
-
-
19. A method for evaluating an XPath expression comprising the computer-implemented steps of:
-
compiling a state machine based on an XPath expression, the state machine comprising states and transitions that reflect the steps of the XPath expression; evaluating the XPath expression using the state machine, wherein the step of evaluating comprises; receiving one or more XML events from an XML event-streaming component; maintaining state information based on the content and ordering of the one or more XML events, wherein the state information indicates a current state in the state machine; based at least upon transitions from the current state to subsequent states, determining criteria, wherein the criteria describes characteristics of any XML event that will transition the state machine to at least one of the subsequent states; requesting, from the XML event-streaming component, a next XML event that meets the criteria; in response to said requesting, receiving an XML event from the XML streaming component that meets the criteria; and generating an XPath result based on the evaluation. - View Dependent Claims (24)
-
-
20. A computer-implemented method for evaluating an XML query, comprising the steps of:
-
compiling a state machine based on one or more XPath expressions; wherein the state machine comprises a first set of states, a set of transitions, and a set of conditions; wherein each transition in the set of transitions indicates a transformation from a state in the first set of states to a state in a second set of states; wherein each condition in the set of conditions describes, for a distinct transition in the set of transitions, criteria under which input received by the state machine will result in the distinct transition; and while executing the state machine in the first set of states; sending data from the state machine to an XML event-streaming component indicating the set of conditions; parsing an XML data source with the XML event-streaming component until the XML streaming engine generates an event that meets the criteria of at least one condition in the set of conditions; sending input from the XML event-streaming component to the state machine indicating the event; and based on the event, transitioning the state machine to a third set of states, wherein the third set of states comprises an accepting state, wherein the state machine outputs the XML event as an XPath result. - View Dependent Claims (25)
-
Specification