{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,10,5]],"date-time":"2025-10-05T19:48:17Z","timestamp":1759693697880},"reference-count":46,"publisher":"Cambridge University Press (CUP)","issue":"3","license":[{"start":{"date-parts":[[2008,5,1]],"date-time":"2008-05-01T00:00:00Z","timestamp":1209600000000},"content-version":"unspecified","delay-in-days":0,"URL":"https:\/\/www.cambridge.org\/core\/terms"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Theory and Practice of Logic Programming"],"published-print":{"date-parts":[[2008,5]]},"abstract":"<jats:title>Abstract<\/jats:title><jats:p><jats:italic>Extensible Markup Language (XML)<\/jats:italic>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.<jats:italic>XPath<\/jats:italic>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<jats:italic>query language<\/jats:italic>against an XML document. In this paper we present a proposal for the implementation of the<jats:italic>XPath<\/jats:italic>language in logic programming. With this aim we will describe the representation of XML documents by means of a<jats:italic>logic program<\/jats:italic>.<jats:italic>Rules<\/jats:italic>and<jats:italic>facts<\/jats:italic>can be used for representing the document schema and the XML document itself. In particular, we will present<jats:italic>how to index XML documents<\/jats:italic>in logic programs: rules are supposed to be stored in<jats:italic>main memory<\/jats:italic>, however facts are stored in<jats:italic>secondary memory<\/jats:italic>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<jats:italic>XPath<\/jats:italic>language against a logic program representing an XML document. It evolves the<jats:italic>specialization of the logic program<\/jats:italic>with regard to the<jats:italic>XPath<\/jats:italic>expression. Finally, we will also explain how to<jats:italic>combine the indexing and the top-down evaluation<\/jats:italic>of the logic program.<\/jats:p>","DOI":"10.1017\/s1471068407003183","type":"journal-article","created":{"date-parts":[[2008,1,15]],"date-time":"2008-01-15T13:57:45Z","timestamp":1200405465000},"page":"323-361","source":"Crossref","is-referenced-by-count":13,"title":["Querying XML documents in logic programming"],"prefix":"10.1017","volume":"8","author":[{"given":"J. M.","family":"ALMENDROS-JIM\u00c9NEZ","sequence":"first","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"A.","family":"BECERRA-TER\u00d3N","sequence":"additional","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"F. J.","family":"ENCISO-BA\u00d1OS","sequence":"additional","affiliation":[],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"56","published-online":{"date-parts":[[2008,5,1]]},"reference":[{"key":"S1471068407003183_ref43","unstructured":"Wadler P. 2002. XQuery: A typed functional language for querying XML. In Advanced Functional Programming, International School, LNCS 2638. Heidelberg, Germany, 188\u2013212."},{"key":"S1471068407003183_ref16","unstructured":"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\u2013270."},{"key":"S1471068407003183_ref41","unstructured":"W3C. 2007b. XML Path Language (XPath) 2.0. Tech. rep., www.w3.org."},{"key":"S1471068407003183_ref37","unstructured":"W3C. 2001. XML Schema 1.0. Tech. rep., www.w3.org."},{"key":"S1471068407003183_ref7","unstructured":"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\u2013560."},{"key":"S1471068407003183_ref19","volume-title":"XQuery from the experts","author":"Chamberlin","year":"2004"},{"key":"S1471068407003183_ref12","unstructured":"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\u2013139."},{"key":"S1471068407003183_ref20","unstructured":"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\u2013285."},{"key":"S1471068407003183_ref18","doi-asserted-by":"publisher","DOI":"10.1147\/sj.414.0597"},{"key":"S1471068407003183_ref15","unstructured":"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\u2013310."},{"key":"S1471068407003183_ref45","unstructured":"Wielemaker J. 2005. SWI-Prolog SGML\/XML Parser, Version 2.0.5. Tech. rep., Human Computer-Studies (HCS), University of Amsterdam. March."},{"key":"S1471068407003183_ref28","unstructured":"Marian A. and Simeon J. 2003. Projecting XML documents. In Proc. of International Conference on Very Large Databases. Morgan Kaufmann, Burlington, USA, 213\u2013224."},{"key":"S1471068407003183_ref21","unstructured":"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\u20131112."},{"key":"S1471068407003183_ref10","unstructured":"Boley H. 2000a. Relationships between logic programming and RDF. In Proc. of Advances in Artificial Intelligence, LNCS 2112. Heidelberg, Germany, 201\u2013218."},{"key":"S1471068407003183_ref6","unstructured":"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\u2013133."},{"key":"S1471068407003183_ref1","volume-title":"Data on the Web: From Relations to Semistructured Data and XML","author":"Abiteboul","year":"2000"},{"key":"S1471068407003183_ref3","volume-title":"Proceedings of the Workshop on Logic Programming","author":"Almendros-Jim\u00e9nez","year":"2007"},{"key":"S1471068407003183_ref42","unstructured":"W3C. 2007c. XML Query Working Group and XSL Working Group, XQuery 1.0: An XML Query Language. Tech. rep., www.w3.org."},{"key":"S1471068407003183_ref9","doi-asserted-by":"crossref","unstructured":"Berners-Lee T. , Hendler J. and Lassila O. 2001. The semantic web \u2013 A new form of Web content that is meaningful to computers will unleash a revolution of new possibilities. Scientic American May, 36 pages.","DOI":"10.1038\/scientificamerican0501-34"},{"key":"S1471068407003183_ref13","unstructured":"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\u20131325."},{"key":"S1471068407003183_ref17","doi-asserted-by":"publisher","DOI":"10.1017\/S147106840100117X"},{"key":"S1471068407003183_ref35","unstructured":"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\u2013215."},{"key":"S1471068407003183_ref46","unstructured":"Wolz R. 2004. Web Ontology Reasoning with Logic Databases. Ph.D. thesis, Universit\u00e4t Fridericiana zu Karlsruhe."},{"key":"S1471068407003183_ref44","unstructured":"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\u2013159."},{"key":"S1471068407003183_ref39","unstructured":"W3C. 2004b. Resource Description Framework (RDF). Tech. rep., www.w3.org."},{"key":"S1471068407003183_ref4","first-page":"493","volume-title":"Handbook of Theoretical Computer Science","author":"Apt","year":"1990"},{"key":"S1471068407003183_ref24","unstructured":"Fern\u00e1ndez 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\u201345."},{"key":"S1471068407003183_ref23","unstructured":"Fern\u00e1ndez M. and Simeon J. 2003. Growing XQuery. In Proc. of the Object-Oriented Programming, European Conference, LNCS 2743. Heidelberg, Germany, 405\u2013430."},{"key":"S1471068407003183_ref29","doi-asserted-by":"publisher","DOI":"10.1017\/S147106840300187X"},{"key":"S1471068407003183_ref22","doi-asserted-by":"publisher","DOI":"10.1109\/4236.877487"},{"key":"S1471068407003183_ref30","unstructured":"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\u2013908."},{"key":"S1471068407003183_ref32","unstructured":"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."},{"key":"S1471068407003183_ref14","doi-asserted-by":"publisher","DOI":"10.1016\/0004-3702(96)00004-5"},{"key":"S1471068407003183_ref33","unstructured":"Seipel D. 2002. Processing XML-documents in Prolog. In Procs. of the Workshop on Logic Programming 2002. Technische Universit\u00e4t Dresden, Dresden, Germany, 15 pages."},{"key":"S1471068407003183_ref36","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796802004392"},{"key":"S1471068407003183_ref26","unstructured":"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\u2013731."},{"key":"S1471068407003183_ref27","doi-asserted-by":"publisher","DOI":"10.1145\/767193.767195"},{"key":"S1471068407003183_ref5","unstructured":"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\u201385."},{"key":"S1471068407003183_ref25","unstructured":"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\u201357."},{"key":"S1471068407003183_ref34","unstructured":"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\u201313."},{"key":"S1471068407003183_ref2","first-page":"1651","article-title":"Magic sets for the XPath language","volume":"12","author":"Almendros-Jim\u00e9nez","year":"2006","journal-title":"Journal of Universal Computer Science"},{"key":"S1471068407003183_ref11","unstructured":"Boley H. 2000b. Relationships between logic programming and XML. In Proc. of the Workshop on Logic Programming, GMD Report 90. W\u00fcrzburg, Germany, 19\u201334."},{"key":"S1471068407003183_ref8","unstructured":"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\u201363."},{"key":"S1471068407003183_ref31","volume-title":"Applied Semantics: Advanced Lectures","author":"R\u00e9my","year":"2002"},{"key":"S1471068407003183_ref38","unstructured":"W3C. 2004a. OWL Ontology Web Language. Tech. rep., www.w3.org."},{"key":"S1471068407003183_ref40","unstructured":"W3C. 2007a. Extensible Markup Language (XML). Tech. rep., www.w3c.org."}],"container-title":["Theory and Practice of Logic Programming"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.cambridge.org\/core\/services\/aop-cambridge-core\/content\/view\/S1471068407003183","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2023,5,15]],"date-time":"2023-05-15T21:15:59Z","timestamp":1684185359000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.cambridge.org\/core\/product\/identifier\/S1471068407003183\/type\/journal_article"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2008,5]]},"references-count":46,"journal-issue":{"issue":"3","published-print":{"date-parts":[[2008,5]]}},"alternative-id":["S1471068407003183"],"URL":"https:\/\/doi.org\/10.1017\/s1471068407003183","relation":{},"ISSN":["1471-0684","1475-3081"],"issn-type":[{"value":"1471-0684","type":"print"},{"value":"1475-3081","type":"electronic"}],"subject":[],"published":{"date-parts":[[2008,5]]}}}