From XQuery to Relational Logics

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 l...

Full description

Bibliographic Details
Main Authors: Benedikt, M, Koch, C
Format: Journal article
Language:English
Published: 2009
_version_ 1797075960486428672
author Benedikt, M
Koch, C
author_facet Benedikt, M
Koch, C
author_sort Benedikt, M
collection OXFORD
description 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 logican 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. © 2009 ACM.
first_indexed 2024-03-06T23:57:32Z
format Journal article
id oxford-uuid:74c263cb-31bc-46de-90de-a5edcf6c3fad
institution University of Oxford
language English
last_indexed 2024-03-06T23:57:32Z
publishDate 2009
record_format dspace
spelling oxford-uuid:74c263cb-31bc-46de-90de-a5edcf6c3fad2022-03-26T20:05:00ZFrom XQuery to Relational LogicsJournal articlehttp://purl.org/coar/resource_type/c_dcae04bcuuid:74c263cb-31bc-46de-90de-a5edcf6c3fadEnglishSymplectic Elements at Oxford2009Benedikt, MKoch, CPredicate 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 logican 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. © 2009 ACM.
spellingShingle Benedikt, M
Koch, C
From XQuery to Relational Logics
title From XQuery to Relational Logics
title_full From XQuery to Relational Logics
title_fullStr From XQuery to Relational Logics
title_full_unstemmed From XQuery to Relational Logics
title_short From XQuery to Relational Logics
title_sort from xquery to relational logics
work_keys_str_mv AT benediktm fromxquerytorelationallogics
AT kochc fromxquerytorelationallogics