XQuery in the Functional-Logic Language Toy

  • Jesus M. Almendros-Jiménez
  • Rafael Caballero
  • Yolanda García-Ruiz
  • Fernando Sáenz-Pérez
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6816)

Abstract

This paper presents an encoding of the XML query language XQuery in the functional-logic language \(\mathcal{TOY}\). The encoding is based on the definition of for-let-where-return constructors by means of \(\mathcal{TOY}\) functions, and uses the recently proposed XPath implementation for this language as a basis. XQuery expressions can be executed in \(\mathcal{TOY}\) obtaining sequences of XML elements as answers. Our setting exploits the non-deterministic nature of \(\mathcal{TOY}\) by retrieving the elements of the XML tree once at a time when necessary. We show that one of the advantages of using a rewriting-based language for implementing XQuery is that it can be used for optimizing XQuery expressions by query rewriting. With this aim, XQuery expressions are converted into higher order patterns that can be analyzed and modified by \(\mathcal{TOY}\) functions.

Keywords

Functional-Logic Programming Non-Deterministic Functions XQuery Higher-Order Patterns 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Jesus M. Almendros-Jiménez
    • 1
  • Rafael Caballero
    • 2
  • Yolanda García-Ruiz
    • 2
  • Fernando Sáenz-Pérez
    • 3
  1. 1.Dpto. de Lenguajes y ComputaciónUniversidad de AlmeríaSpain
  2. 2.Departamento de Sistemas Informáticos y ComputaciónUniversidad Complutense de MadridSpain
  3. 3.Departamento de Ingeniería del Software e Inteligencia ArtificialUniversidad Complutense de MadridSpain

Personalised recommendations