Controlled Query Evaluation for Datalog and OWL 2 Profile Ontologies