Pure is a query rewriter: given a set of rules R and a conjunctive query q, it rewrites q using the rules in R such that, for any data set D, the answers to q over the knowledge base (R,D) can be computed by evaluating the rewritten query directly over D.

Pure comes in two versions.

A pivotal UCQ computed by PureC can be evaluated in different ways.

Associated publications

See SWJ 2015 for Pure (basic query rewriting), IJCAI 2015 and RuleML 2015 for PureC (compilation-based query rewriting).

Getting started

The following program (Pure-rewriter) includes both the basic and the compilation-based versions of Pure.

There are three options for compilation:

Rewrite with compilation

Rewriting a query is decomposed into two steps.

  1. Compiled rules are transformed into a set of compiled rules (file.idc). This step needs to be performed only once independently from any query.
  2. Rewriting a query embbeds file.idc to compute a pivotal UCQ.
  3. Finally, the pivotal UCQ can be unfolded into a classical UCQ rewriting if needed.

Without compilation

Other useful options