A Three-Valued Semantics for Querying and Repairing Inconsistent Databases