[Paper Review] XTQ: A Declarative Functional XML Query Language
XTQ is a declarative, pattern-based functional XML query language that enables expressive, coherent querying of hierarchical and heterogeneous XML data through matching terms and a deductive restructuring mechanism. It supports declarative data extraction, filtering, and transformation of complex nested structures, offering a unified framework that surpasses existing languages in handling disjunctive and hierarchical relationships in XML queries.
Various query languages have been proposed to extract and restructure information in XML documents. These languages, usually claiming to be declarative, mainly consider the conjunctive relationships among data elements. In order to present the operations where the hierarchical and the disjunctive relationships need to be considered, such as restructuring hierarchy and handling heterogeneity, the programs in these languages often exhibit a procedural style and thus the declarativeness in them is not so prominent as in conventional query languages like SQL. In this paper, we propose a declarative pattern-based functional XML query language named XML Tree Query (XTQ). XTQ adopts expressive composite patterns to present data extraction, meanwhile establishing the conjunctive, the disjunctive and the hierarchical relationships among data elements. It uses the matching terms, a composite structure of the variables bound to the matched data elements, to present a global sketch of the extracted data, and develops a deductive restructuring mechanism of matching terms to indicate data transformation, especially for restructuring hierarchy and handling heterogeneity. Based on matching terms, XTQ employs a coherent approach to function declaration and invocation to consistently extract and construct composite data structure, which integrates features of conventional functional languages and pattern-based query languages. Additionally, XTQ also supports data filtering on composite data structure such as hierarchical data, which is seldom deliberately considered in other studies. We demonstrate with various examples that XTQ can declaratively present complex XML queries which are common in practice.
Motivation & Objective
- To address the limited declarativeness of existing XML query languages when handling complex queries involving hierarchy, heterogeneity, and nested data sets.
- To provide a unified framework that explicitly models conjunctive, disjunctive, and hierarchical relationships among data elements in XML documents.
- To support consistent data filtering, transformation, and construction of composite data structures, especially in the context of nested and semistructured XML data.
- To integrate functional programming features with pattern-based querying in a way that maintains declarativeness and compositional clarity.
Proposed method
- XTQ uses expressive composite patterns to represent data extraction and define relationships among elements, including conjunctive, disjunctive, and hierarchical compositions.
- It introduces matching terms—composite structures binding variables to matched data elements—to provide a global sketch of extracted data.
- A deductive restructuring mechanism is employed to transform matching terms, enabling declarative data transformation and hierarchy reorganization.
- The language supports function declaration and invocation based on matching terms, ensuring consistency in extracting and constructing complex data structures.
- It employs connectives like 'par' and 'with' to enable consistent filtering of disjunctive and hierarchical data structures.
- The system integrates virtual function document values to support higher-order functions in a style aligned with document querying.
Experimental results
Research questions
- RQ1How can a query language declaratively express complex XML queries involving hierarchical restructuring and data heterogeneity?
- RQ2What mechanisms enable a coherent and expressive representation of conjunctive, disjunctive, and hierarchical relationships in XML data?
- RQ3How can data filtering be uniformly applied to composite data structures such as nested sets and hierarchical trees in XML?
- RQ4What is the role of matching terms and their restructuring in enabling declarative data transformation without procedural code?
- RQ5How can functional programming features be seamlessly integrated into a pattern-based query language for XML?
Key findings
- XTQ provides a more expressive and coherent framework than existing languages like XQuery, Xcerpt, or TQL for expressing complex XML queries involving disjunctive and hierarchical data relationships.
- The use of matching terms and a deductive restructuring mechanism enables declarative transformation of data structures, reducing the need for procedural subqueries.
- XTQ supports consistent filtering of composite data structures through connectives 'par' and 'with', which is not natively supported in most existing XML query languages.
- The integration of functional programming features—such as higher-order functions via virtual document values—enhances the language’s expressiveness while preserving declarativeness.
- The prototype implementation based on operational semantics demonstrates feasibility, and ongoing work focuses on optimizing performance and extending support for label-keyword queries and schema-based patterns.
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.