A query by example approach for XML querying
Résumé
XML, as a general-purpose annotation system for creating custom markup languages, is becoming more and more important. XML annotations give structure to plain documents and help to interpret their content, making them human or machine readable. However, mechanisms to pretty-print those annotated documents or process them in order to extract information are crucial to make them 19 useful. In a similar way, a collection of XML documents, without any tools capable of retrieving information from it, is useless. To search for specific elements in a marked up document we have, at least, two options: XPath and XQuery. However, the learning curve of these two dialects is high, requiring a considerable level of knowledge. In this context, the idea of Query-by-example can be an important contribution to make easier this learning process, freeing the user from knowing the specific query language details or even the document structure. In this paper, we describe our approach to QBE based on an sample document from the collection where the user specifies his needs. First, we focus on the choice of the adequate document to serve as a sample of the collection, based on different metrics computed over the document. Then, we discuss the query generation from the user needs' specifications, namely components (elements or attributes) selection and filtering.