Querying Order-Incomplete Data

To combine ordered data originating from multiple sources, one needs a framework that can represent uncertainty about the possi- ble orderings or, as we call it, order-incomplete data. Examples of such data are lists of properties (such as hotels and restaurants) ranked by an unknown function reflecting relevance or customer ratings; documents edited concurrently with uncertainty on the or- der of contributions; and the result of integrating event sequences such as sensor readouts or log entries. Our work extends the pos- itive relational algebra to ordered and order-incomplete data, and introduces a set of axioms to guide the design of a bag semantics for the language. We introduce two simple such semantics, one of which is shown to be the most general for our set of axioms. We next design a strong representation system for them, based on partial orders interpreted through a possible worlds semantics. We study the expressiveness of our query language, connecting it to complexity measures on partial orders. We further introduce a top-k operator, and investigate the complexity of query evaluation, stud- ied in the context of certain and possible answers. We last introduce a duplicate elimination operator to return to set semantics, and re- visit our results. To our knowledge, no previously proposed framework or system can be used to evaluate positive relational algebra queries in this sense; see Section 8 for a discussion of the re- lated work. We therefore propose in this paper an extension of the positive relational algebra (PosRA) to ordered and order-incomplete data, and show how to design a bag seman- tics for it. We present which axioms should necessarily be satisfied, guiding the development of semantics in this con- text. We further propose different concrete semantics that re- spect them. We then describe a compact representation sys- tem for order-incomplete data based on partial orders, and study the expressiveness and complexity of the semantics over this representation system. Beyond standard relational algebra, we study semantics for enriched languages includ- ing order-based selection such as top-k, and an explicit oper- ator for duplicate elimination. We next summarize our main contributions in more detail. Order-incomplete databases (Section 3). We focus on the positive relational algebra, and capture ordered and order- incomplete data with the notion of order-incomplete rela- tions (for short, oi-relations), which are sets of possible or- ders over tuples. To guide our definition of a semantics for such queries over such relations, we introduce a set of in- tuitive axioms: the semantics should faithfully generalize standard bag semantics; query evaluation should treat oi- relations as a representation system (16); and existing order within input relations should be preserved. We then propose concrete semantics satisfying the desiderata: GEN, which we prove to be the most general (it imposes the minimal order constraints so that the axioms are satisfied), and LEX, based on a natural interpretation of the relational product as lexi- cographic ordering. We exemplify the usefulness of the se- mantics, and show some equational properties of positive re- lational algebra that continue to hold for them. Partially-ordered databases (Section 4). Our abstraction of order-incomplete relations as sets of possible worlds is useful for defining query semantics, but not practical for rep- resenting query evaluation results. We accordingly define partially-ordered relations (or po-relations) which introduce a partial order (28) over their tuples. Each po-relation repre- sents the oi-relation obtained as the set of linear extensions of its partial order; however, not all oi-relations may be rep- resented as po-relations. We explain how po-relations can be used as a strong representation system (16) for the GEN and LEX semantics, and that query evaluation on po-relations can be performed in polynomial time in the size of the input po- relations.