Abstract
Predicate logic has long been seen as a good foundation for querying relational data. This is embodied in the correspondence between relational calculus and first-order logic, and can also be seen in mappings from fragments of the standard relational query language SQL to extensions of first-order logic (e.g. with counting). A key question is what is the analog to this correspondence for querying tree-structured data, as seen, for example, in XML documents. We formalize this as the question of the appropriate logical query language for defining transformations on tree-structured data. The predominant practitioner paradigm for defining such transformations is
top-down tree building
. This is embodied by the XQuery query language, which builds the output tree in parallel starting at the root, based on variable bindings and nodeset queries in the XPath language. The goal of this article is to compare the expressiveness of top-down tree-building languages based on a benchmark of predicate logic. We start by giving a formalized XQuery
XQ
that can serve as a representative of the top-down approach. We show that all queries in
XQ
with only atomic equality are equivalent to first-order interpretations, an analog to first-order logic (FO) in the setting of transformations of tree-structured data. We then consider fragments of atomic
XQ
. We identify a fragment that maps efficiently into first-order, a fragment that maps into existential first-order logic, and a fragment that maps into the navigationally two-variable fragment of first-order logic—an analog of two-variable logic in the setting where data values are unbounded. When
XQ
is considered with deep equality, we find that queries can be translated into FO with counting (
FO
(Cnt)). Translations from
XQ
to logical languages on relations have a number of consequences. We use them to derive complexity bounds for
XQ
fragments, and to bound the Boolean expressiveness of
XQ
fragments.
Publisher
Association for Computing Machinery (ACM)
Reference35 articles.
1. Abiteboul S. Hull R. and Vianu V. 1995. Foundations of Databases. Addison-Wesley. Abiteboul S. Hull R. and Vianu V. 1995. Foundations of Databases. Addison-Wesley.
2. Eliminating definitions and Skolem functions in first-order logic
3. On uniformity within NC1
4. Benedikt M. 2008. Back From Relational Logics to XQuery. To appear. Benedikt M. 2008. Back From Relational Logics to XQuery. To appear.
5. Interpreting Tree-to-Tree Queries
Cited by
12 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献