Skip to main content Accessibility help
×
Home

Querying XML documents in logic programming*

  • J. M. ALMENDROS-JIMÉNEZ (a1), A. BECERRA-TERÓN (a1) and F. J. ENCISO-BAÑOS (a1)

Abstract

Extensible Markup Language (XML) is a simple, very flexible text format derived from SGML. Originally designed to meet the challenges of large-scale electronic publishing, XML is also playing an increasingly important role in the exchange of a wide variety of data on the Web and elsewhere. XPath language is the result of an effort to provide address parts of an XML document. In support of this primary purpose, it becomes in a query language against an XML document. In this paper we present a proposal for the implementation of the XPath language in logic programming. With this aim we will describe the representation of XML documents by means of a logic program. Rules and facts can be used for representing the document schema and the XML document itself. In particular, we will present how to index XML documents in logic programs: rules are supposed to be stored in main memory, however facts are stored in secondary memory by using two kind of indexes: one for each XML tag, and other for each group of terminal items. In addition, we will study how to query by means of the XPath language against a logic program representing an XML document. It evolves the specialization of the logic program with regard to the XPath expression. Finally, we will also explain how to combine the indexing and the top-down evaluation of the logic program.

Copyright

References

Hide All
Abiteboul, S., Buneman, P. and Suciu, D. 2000. Data on the Web: From Relations to Semistructured Data and XML. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA.
Almendros-Jiménez, J. M., Becerra-Terón, A. and Enciso-Baños, F. J. 2006. Magic sets for the XPath language. Journal of Universal Computer Science 12, 11, 16511678.
Almendros-Jiménez, J. M., Becerra-Terón, A. and Enciso-Baños, F. J. 2007. Integrating XQuery and logic programming. In Proceedings of the Workshop on Logic Programming, University of Würzburg, Würzburg, Germany, 12 pages.
Apt, K. R. 1990. Logic programming. In Handbook of Theoretical Computer Science, Vol. B: Formal Models and Semantics, van Leewen, J., Ed. MIT Press, Massachusetts Institute of Technology, USA, Chapter 10, 493574.
Atanassow, F., Clarke, D. and Jeuring, J. 2004. UUXML: A type-preserving XML schema haskell data binding. In Proc. of Practical Aspects of Declarative Languages. LNCS 3057. Heidelberg, Germany, 71–85.
Bailey, J., Bry, F., Furche, T. and Schaffert, S. 2005. Web and semantic web query languages: A survey. In Proc. of Reasoning Web, First International Summer School, LNCS 3564. Heidelberg, Germany, 35–133.
Baumgartner, R., Flesca, S. and Gottlob, G. 2001. The elog web extraction language. In Proc. of International Conference on Logic for Programming, Artificial Intelligence, and Reasoning, LNCS 2250. Heidelberg, Germany, 548–560.
Benzaken, V., Castagna, G. and Frish, A. 2005. CDuce: An XML-centric general-purpose language. In Proc. of the ACM SIGPLAN International Conference on Functional Programming. ACM Press, New York, USA, 51–63.
Berners-Lee, T., Hendler, J. and Lassila, O. 2001. The semantic web – A new form of Web content that is meaningful to computers will unleash a revolution of new possibilities. Scientic American May, 36 pages.
Boley, H. 2000a. Relationships between logic programming and RDF. In Proc. of Advances in Artificial Intelligence, LNCS 2112. Heidelberg, Germany, 201–218.
Boley, H. 2000b. Relationships between logic programming and XML. In Proc. of the Workshop on Logic Programming, GMD Report 90. Würzburg, Germany, 19–34.
Boley, H. 2001. The rule markup language: RDF-XML data model, XML schema hierarchy, and XSL transformations. In Proc. of International Conference on Applications of Prolog. Prolog Association of Japan, Tokyo, Japan, 124–139.
Boncz, P. A., Grust, T., van Keulen, M., Manegold, S., Rittinger, J. and Teubner, J. 2005. Pathfinder: XQuery - the relational way. In Proc. of the International Conference on Very Large Databases. ACM Press, New York, USA, 1322–1325.
Borgida, A. 1996. On the relative expressiveness of description logics and predicate logics. Artificial Intelligence 82, 1-2, 353367.
Bry, F. and Schaffert, S. 2002a. The XML query language Xcerpt: Design principles, examples, and semantics. In Proc. of Web, Web-Services, and Database Systems, LNCS 2593. Heidelberg, Germany, 295–310.
Bry, F. and Schaffert, S. 2002b. Towards a declarative query and transformation language for XML and semistructured data: Simulation unification. In Proc. of International Conference on Logic Programming, LNCS 2401. Heidelberg, Germany, 255–270.
Cabeza, D. and Hermenegildo, M. 2001. Distributed WWW Programming using (Ciao-) prolog and the PiLLoW library. Theory and Practice of Logic Programming 1, 3, 251282.
Chamberlin, D. 2002. XQuery: An XML query language. IBM Systems Journal 41, 4, 597615.
Chamberlin, D., Draper, D., Fernández, M., Kay, M., Robie, J., Rys, M., Simeon, J., Tivy, J. and Wadler, P. 2004. XQuery from the experts. Addison Wesley, Boston, USA.
Coelho, J. and Florido, M. 2003. Type-based XML processing in logic programming. In Proc. of the International Symposium on Practical Aspects of Declarative Languages, LNCS 2562. Heidelberg, Germany, 273–285.
Coelho, J. and Florido, M. 2004. CLP(Flex): Constraint logic programming applied to XML processing. In Proceedings of the CoopIS/DOA/ODBASE, LNCS 3291. Heidelberg, Germany, 1098–1112.
Decker, S., Melnik, S., Harmelen, F. V., Fensel, D., Klein, M. C. A., Broekstra, J., Erdmann, M. and Horrocks, I. 2000. The Semantic Web: The Roles of XML and RDF. IEEE Internet Computing 4, 5, 6374.
Fernández, M. and Simeon, J. 2003. Growing XQuery. In Proc. of the Object-Oriented Programming, European Conference, LNCS 2743. Heidelberg, Germany, 405–430.
Fernández, M., Simeon, J. and Wadler, P. 2000. An algebra for XML query. In Proc. of Foundation of Software Technology and Theoretical Computer Science, LNCS 1974. Heidelberg, Germany, 11–45.
Grosof, B. N., Horrocks, I., Volz, R. and Decker, S. 2003. Description logic programs: Combining logic programs with description logic. In Proc. of the International Conference on World Wide Web. ACM Press, USA, 48–57.
Horrocks, I. and Patel-Schneider, P. F. 2004. A Proposal for an OWL rules language. In Proc. of International Conference on World Wide Web. ACM Press, New York, USA, 723–731.
Hosoya, H. and Pierce, B. C. 2003. XDuce: A statically typed XML processing language. ACM Transactions on Internet Technology 3, 2, 117148.
Marian, A. and Simeon, J. 2003. Projecting XML documents. In Proc. of International Conference on Very Large Databases. Morgan Kaufmann, Burlington, USA, 213–224.
May, W. 2004. XPath-Logic and XPathLog: A logic-programming style XML data manipulation language. Theory and Practice of Logic Programming 4, 3, 239287.
O'Neil, P., O'Neil, E., Pal, S., Cseri, I., Schaller, G. and Westbury, N. 2004. OrdPaths: Insert-friendly XML node labels. In Proc. of the ACM SIGMOD Conference. ACM Press, New York, USA, 903–908.
Rémy, D. 2002. Applied Semantics: Advanced Lectures, LNCS 2395. Heidelberg, Germany. Chapter Using, Understanding, and Unraveling the OCaml Language. From Practice to Theory and Vice Versa, 115–137.
Schaffert, S. and Bry, F. 2002. A gentle introduction to Xcerpt, a rule-based query and transformation language for XML. In Proc. of International Workshop on Rule Markup Languages for Business Rules on the Semantic Web. CEUR Workshop Proceedings 60, Aachen, Germany, 22 pages.
Seipel, D. 2002. Processing XML-documents in Prolog. In Procs. of the Workshop on Logic Programming 2002. Technische Universität Dresden, Dresden, Germany, 15 pages.
Simeon, J. and Wadler, P. 2003. The essence of XML. In Proc. of SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM Press, New York, USA, 1–13.
Tatarinov, I., Viglas, S. D., Beyer, K., Shanmugasundaram, J., Shekita, E. and Zhang, C. 2002. Storing and querying ordered XML using a relational database system. In Proc. of the ACM SIGMOD Conference. ACM Press, New York, USA, 204–215.
Thiemann, P. 2002. A typed representation for HTML and XML documents in Haskell. Journal of Functional Programming 12, 4&5, 435468.
W3C. 2001. XML Schema 1.0. Tech. rep., www.w3.org.
W3C. 2004a. OWL Ontology Web Language. Tech. rep., www.w3.org.
W3C. 2004b. Resource Description Framework (RDF). Tech. rep., www.w3.org.
W3C. 2007a. Extensible Markup Language (XML). Tech. rep., www.w3c.org.
W3C. 2007b. XML Path Language (XPath) 2.0. Tech. rep., www.w3.org.
W3C. 2007c. XML Query Working Group and XSL Working Group, XQuery 1.0: An XML Query Language. Tech. rep., www.w3.org.
Wadler, P. 2002. XQuery: A typed functional language for querying XML. In Advanced Functional Programming, International School, LNCS 2638. Heidelberg, Germany, 188–212.
Wallace, M. and Runciman, C. 1999. Haskell and XML: Generic combinators or type-based translation? In Proceedings of the International Conference on Functional Programming. ACM Press, New York, USA, 148–159.
Wielemaker, J. 2005. SWI-Prolog SGML/XML Parser, Version 2.0.5. Tech. rep., Human Computer-Studies (HCS), University of Amsterdam. March.
Wolz, R. 2004. Web Ontology Reasoning with Logic Databases. Ph.D. thesis, Universität Fridericiana zu Karlsruhe.

Keywords

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed