Declarative rule discovery for detecting and correcting inconsistencies in noisy data