XPath Query Processing in a Functional-Logic Language

  • Authors:
  • J. M. Almendros-JiméNez;R. Caballero;Y. GarcíA-Ruiz;F. SáEnz-PéRez

  • Affiliations:
  • Dpto. de Lenguajes y Computación, Universidad de Almería, Spain;Dpto. de Sistemas Informáticos y Computación, Universidad Complutense de Madrid, Spain;Dpto. de Sistemas Informáticos y Computación, Universidad Complutense de Madrid, Spain;Dpto. de Ingeniería del Software e Inteligencia Artificial, Universidad Complutense de Madrid, Spain

  • Venue:
  • Electronic Notes in Theoretical Computer Science (ENTCS)
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

XPath is a well-known query language for finding and extracting information from XML documents. This paper shows how the characteristics of this domain-specific language fits very well into the functional-logic paradigm. The proposed framework allows the user to write XPath-like queries as first-class citizens of the functional-logic language TOY, using higher-order combinators for constructing the queries and non-determinism in order to obtain the different answers that XPath queries can return. The result is a very good example of cross-fertilization of two different areas. In the case of TOY, the users can now integrate XML queries in their programs without using any external library or ad hoc interface. In the case of XPath, the use of higher-order patterns allow us to define functions for easily processing the queries. In particular, the paper shows how to trace and debug erroneous queries, and how to detect that a query is a refinement of another query, which can be useful for improving the efficiency of query processing.