Reducing global consistency to local consistency in ontology-based data access