[Paper Review] Streaming Enumeration on Nested Documents
This paper presents a streaming enumeration algorithm for queries over nested documents (e.g., XML, JSON) using Visibly Pushdown Transducers (VPT), achieving constant-delay enumeration after a single pass over the input. The method ensures worst-case optimal update time and memory usage, with optimal performance for I/O-unambiguous VPT and extendable to all VPT via determinization.
Some of the most relevant document schemas used online, such as XML and JSON, have a nested format. In the last decade, the task of extracting data from nested documents over streams has become especially relevant. We focus on the streaming evaluation of queries with outputs of varied sizes over nested documents. We model queries of this kind as Visibly Pushdown Transducers (VPT), a computational model that extends visibly pushdown automata with outputs and has the same expressive power as MSO over nested documents. Since processing a document through a VPT can generate a massive number of results, we are interested in reading the input in a streaming fashion and enumerating the outputs one after another as efficiently as possible, namely, with constant-delay. This paper presents an algorithm that enumerates these elements with constant-delay after processing the document stream in a single pass. Furthermore, we show that this algorithm is worst-case optimal in terms of update-time per symbol and memory usage.
Motivation & Objective
- To enable efficient, streaming evaluation of queries over nested documents like XML and JSON with minimal memory and constant delay between outputs.
- To address the challenge of enumerating potentially massive output sets from nested documents in a single pass, without storing the entire document.
- To provide theoretical guarantees on update time and memory usage, showing worst-case optimality for the proposed algorithm.
- To extend constant-delay enumeration to the broader class of Visibly Pushdown Transducers (VPT), which capture the expressive power of MSO logic over nested data.
- To demonstrate practical applicability through integration with document spanners and query languages like XPath and XQuery.
Proposed method
- The algorithm models queries as Visibly Pushdown Transducers (VPT), which extend visibly pushdown automata with output capabilities and capture the expressive power of MSO over nested documents.
- It processes the input stream in a single pass, maintaining a compact data structure that tracks relevant states and variable captures for efficient output enumeration.
- For unambiguous VPT, the algorithm constructs a derived transducer T_G that supports constant-delay enumeration by merging variable captures along valid paths.
- The construction uses a merge operation on v-paths—sequences of transitions labeled with capture variables—to compactly represent output sets and enable efficient enumeration.
- The algorithm ensures update-time complexity bounded by O(|Q|²|Δ||2^CX|), which is shown to be worst-case optimal for the problem.
- For general (non-unambiguous) VPT, the method applies determinization to the underlying automaton, extending the constant-delay guarantee to the full VPT class in data complexity.
Experimental results
Research questions
- RQ1Can streaming query evaluation over nested documents be performed with constant-delay enumeration after a single input pass?
- RQ2What is the minimal worst-case update time and memory usage required for such streaming enumeration, and can it be achieved?
- RQ3How can the expressive power of MSO over nested documents be captured in a streaming setting with efficient enumeration?
- RQ4Is it possible to extend constant-delay enumeration from unambiguous to general VPT via determinization?
- RQ5Can the proposed algorithm be applied to practical query languages like XPath, XQuery, or JSON query languages with guaranteed efficiency?
Key findings
- The proposed algorithm achieves constant-delay enumeration for I/O-unambiguous VPT after a single pass over the input stream, with update-time bounded by O(|Q|²|Δ||2^CX|).
- The algorithm is worst-case optimal in terms of update time and memory usage, as there exist input instances requiring at least this much time and space for any streaming algorithm.
- The construction of the derived transducer T_G via merge operations on v-paths ensures correct and efficient output enumeration while preserving the semantics of the original VPT.
- For general VPT, the method achieves constant-delay enumeration by determinizing the underlying EVPA, extending the result to the full class of VPT in data complexity.
- The algorithm can be applied to real-world query languages such as XPath and XQuery, and is compatible with document spanner models for data extraction.
- The entire enumeration pipeline, including output mapping construction, runs in time linear in the output size, ensuring output-linear delay.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.