Similar Items: The Data Complexity of Ontology-Mediated Queries with Closed Predicates