Streaming XPath Processing via Forward Axis Graph Traversal
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing XPath processing methods, such as DOM and DFA, are resource-intensive and limited in handling only predefined XPath statements, which can slow system functionality and restrict the processing of XML documents to specific subsets.
Innovation Solution
A streaming event processing system generates a forward axis graph based on XPath queries, allowing for efficient identification of document components by traversing events as a sequence, using nodes and edges to represent query relationships and transitions, enabling flexible processing without the need for extensive resource construction.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If DOM process is used to process XML documents, then query accuracy is improved, but resource consumption increases and processing speed decreases
Solution Approach 1:
The patent segments the XML document processing into two distinct phases: an analysis phase where the document is parsed into a compact representation, and a execution phase where XPath queries are evaluated against this compact form. This segmentation avoids constructing the full DOM tree while maintaining query accuracy, thereby reducing resource consumption compared to traditional DOM processing.
2Measurement precision
If DOM process is used to process XML documents, then query accuracy is improved, but processing speed decreases
Solution Approach 1:
By separating analysis and execution phases, the patent enables faster query processing against the compact representation without sacrificing query accuracy. The compact form allows for more efficient traversal and evaluation compared to full DOM trees.
Solution Approach 2:
The patent creates a compact copy of the XML document structure that preserves the essential hierarchical relationships needed for XPath evaluation, but omits unnecessary node details. This compact copy enables faster processing while maintaining query accuracy.
3Productivity
If DFA processing is used for XPath queries, then processing speed is improved, but adaptability decreases due to limitation to predefined XPath statements
Solution Approach 1:
The patent implements a dynamic query evaluation system where the compact XML representation and query processing mechanism can adapt to arbitrary XPath expressions rather than being restricted to predefined patterns. This dynamic approach maintains processing speed while significantly improving adaptability to different query types.
Solution Approach 2:
The compact XML representation and associated processing logic serve multiple functions: they support various XPath axis types (child, descendant, parent, ancestor, following, preceding), different node tests, and diverse predicate conditions. This universal mechanism replaces multiple specialized DFA implementations.
4Stability of the object's composition
If full DOM tree construction is performed, then complete document structure is preserved, but resource usage increases
Solution Approach 1:
The patent extracts only the essential structural information from the XML document needed for XPath evaluation, creating a compact representation that preserves hierarchical relationships, node identities, and positional information while discarding redundant data. This extraction maintains document structure stability for query purposes while significantly reducing resource usage.
Solution Approach 2:
The compact representation applies different levels of detail to different parts of the document structure based on their relevance to XPath queries. Essential structural elements are preserved with high fidelity, while less critical details are simplified or omitted, optimizing the balance between structure preservation and resource efficiency.
Data Source
AI summary
A query (e.g., an extensible markup language (XML) Path or XPath query) for one or more components of a document (e.g., XML document) may be received. A forward axis graph including a plurality of nodes with edges connecting the nodes may be generated based on the query and corresponding to a traversal of the document as associated with events (e.g., XML SAX events) corresponding to the document. A plurality of matching states of the forward axis graph including at least one final state may be identified, each matching state including a subset of the nodes wherein each incoming edge to the subset originates from one of the nodes of the subset. Whether the one or more components of the query exist within the document may be based on which events correspond to transitions between the matching states and whether the final state is achieved.


