XML data projection (or pruning) is a natural optimization for main memory query engines: given a query Q over a document D, the subtrees of D that are not necessary to evaluate Q are pruned, thus producing a smaller document D'; the query Q is then executed on D', hence avoiding to allocate and process nodes that will never be reached by Q. In this article, we propose a new approach, based on types, that greatly improves current solutions. Besides providing comparable or greater precision and far lesser pruning overhead, our solution ---unlike current approaches--- takes into account backward axes, predicates, and can be applied to multiple queries rather than just to single ones. A side contribution is a new type system for XPath able to handle backward axes. The soundness of our approach is formally proved. Furthermore, we prove that the approach is also complete (i.e., yields the best possible type-driven pruning) for a relevant class of queries and Schemas. We further validate our approach using the XMark and XPathMark benchmarks and show that pruning not only improves the main memory query engine's performances (as expected) but also those of state of the art native XML databases.
可扩展置标语言(XML)是从SGML派生出来的一种简单、非常灵活的文本格式。XML最初是为了应对大规模电子出版的挑战而设计的,现在它在Web和其他地方的各种数据交换中也发挥着越来越重要的作用。XML语言是努力提供XML文档地址部分的结果。为了支持这一主要目的,它变成了一种针对XML文档的查询语言。在本文中,我们提出了一个建议,在逻辑程序设计中实现的语言。为了达到这个目的,我们将通过一个逻辑程序来描述XML文档的表示。规则和事实可用于表示文档模式和XML文档本身。特别是,我们将介绍如何索引XML文档的逻辑程序:规则应该存储在主存储器中,但事实存储在辅助存储器中使用两种索引:一个为每个XML标签,和其他的每组终端项目。此外,我们还将研究如何通过XML语言对表示XML文档的逻辑程序进行查询。它发展了逻辑程序关于表达式的专门化。最后,我们还将解释如何将索引和逻辑程序的自顶向下评估结合起来。逻辑程序设计理论与实践(Theory and Practice of Logic Programming,TPLP)
XQOWL: An Extension of XQuery for OWL Querying and Reasoning
所谓的Web of Data的主要目标之一是能够处理异构资源,其中数据可以用XML或RDF表示。设计能够同时处理XML和RDF数据的程序设计语言是这方面的一个关键目标。在本文中,我们提出了一个框架,称为XQOWL,使处理XML和RDF/OWL数据与XQuery。XQOWL可以被认为是XQuery语言的扩展,它将XQuery与SPARQL和OWL推理器连接起来。XQOWL将SPARQL查询(通过Jena SPARQL引擎)嵌入到XQuery中,并允许从XQuery调用OWL推理机(HermiT,Pellet和FaCT++)。它允许结合对XML和RDF/OWL资源的查询,以及对RDF/OWL数据的推理。因此,输入数据可以是XML或RDF/OWL,而输出数据可以用XML格式化(也使用RDF/OWL XML序列化)。