## Monad comprehensions : a versatile representation for queries

2003
Grust, Torsten
##### Publication type
Contribution to a collection
##### Published in
The Functional Approach to Data Management : Modeling, Analyzing and Integrating Heterogeneous Data / Gray, Peter M. D. et al. (ed.). - Berlin Heidelberg : Springer, 2003. - pp. 288-311. - ISBN 3-540-00375-4
##### Abstract
This chapter is an exploration of the possibilities that open up if we consistently adopt a style of database query and collection processing which allows us to look inside collections and thus enables us to play with atomic constructors instead of the monolithic collection values they build. This comprehension of values goes well together with a completely functional style of query formulation: queries map between the constructors of different collection types. It turns out that a single uniform type of mapping, the catamorphism, is sufficient to embrace the functionality of today's database query languages, like SQL, OQL, but also XPath. Monad comprehensions provide just the right amount of syntactic sugar to express these mappings in a style that is similar to relational calculus (but goes beyond its expressiveness). The major portion of this chapter, however, demonstrates how monad comprehensions enable a succinct yet deep understanding of database queries. We will revisit a number of problems in the advanced query processing domain to see how monad comprehensions can (a) provide remarkably concise proofs of correctness for earlier work, (b) clarify and then broaden the applicability of existing query optimisation techniques, and (c) enable query transformations which otherwise require extensive sets of rewriting rules.
##### Subject (DDC)
004 Computer Science
##### Cite This
ISO 690GRUST, Torsten, 2003. Monad comprehensions : a versatile representation for queries. In: GRAY, Peter M. D., ed. and others. The Functional Approach to Data Management : Modeling, Analyzing and Integrating Heterogeneous Data. Berlin Heidelberg:Springer, pp. 288-311. ISBN 3-540-00375-4
BibTex
@incollection{Grust2003Monad-6158,
year={2003},
title={Monad comprehensions : a versatile representation for queries},
isbn={3-540-00375-4},
publisher={Springer},
booktitle={The Functional Approach to Data Management : Modeling, Analyzing and Integrating Heterogeneous Data},
pages={288--311},
editor={Gray, Peter M. D.},
author={Grust, Torsten}
}

RDF
<rdf:RDF
xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:bibo="http://purl.org/ontology/bibo/"
xmlns:dspace="http://digital-repositories.org/ontologies/dspace/0.1.0#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:void="http://rdfs.org/ns/void#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" >
<void:sparqlEndpoint rdf:resource="http://localhost/fuseki/dspace/sparql"/>
<dc:format>application/pdf</dc:format>
<dc:language>eng</dc:language>
<dc:contributor>Grust, Torsten</dc:contributor>
<bibo:uri rdf:resource="http://kops.uni-konstanz.de/handle/123456789/6158"/>
<dcterms:issued>2003</dcterms:issued>
<foaf:homepage rdf:resource="http://localhost:8080/"/>
<dc:creator>Grust, Torsten</dc:creator>
<dcterms:title>Monad comprehensions : a versatile representation for queries</dcterms:title>
<dcterms:available rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2011-03-24T16:09:52Z</dcterms:available>
<dcterms:bibliographicCitation>First publ. in: The Functional Approach to Data Management : Modeling, Analyzing and Integrating Heterogeneous Data / Peter M. D. Gray ... (ed.). - Berlin, Heidelberg : Springer, 2004. - S. 288-311. - ISBN 3-540-00375-4</dcterms:bibliographicCitation>
<dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2011-03-24T16:09:52Z</dc:date>
<dspace:isPartOfCollection rdf:resource="https://kops.uni-konstanz.de/server/rdf/resource/123456789/36"/>
<dcterms:isPartOf rdf:resource="https://kops.uni-konstanz.de/server/rdf/resource/123456789/36"/>
<dcterms:abstract xml:lang="eng">This chapter is an exploration of the possibilities that open up if we consistently adopt a style of database query and collection processing which allows us to look inside collections and thus enables us to play with atomic constructors instead of the monolithic collection values they build. This comprehension of values goes well together with a completely functional style of query formulation: queries map between the constructors of different collection types. It turns out that a single uniform type of mapping, the catamorphism, is sufficient to embrace the functionality of today's database query languages, like SQL, OQL, but also XPath. Monad comprehensions provide just the right amount of syntactic sugar to express these mappings in a style that is similar to relational calculus (but goes beyond its expressiveness). The major portion of this chapter, however, demonstrates how monad comprehensions enable a succinct yet deep understanding of database queries. We will revisit a number of problems in the advanced query processing domain to see how monad comprehensions can (a) provide remarkably concise proofs of correctness for earlier work, (b) clarify and then broaden the applicability of existing query optimisation techniques, and (c) enable query transformations which otherwise require extensive sets of rewriting rules.</dcterms:abstract>
<dcterms:rights rdf:resource="https://rightsstatements.org/page/InC/1.0/"/>
<dc:rights>terms-of-use</dc:rights>