When mining frequent Datalog queries, many queries will be equivalent in the light of an implicit or explicit background knowledge. To alleviate the problem, we introduce various types of condensed representations: clauses that are semantically free or closed w.r.t. a user specified background theory, as well as δ-free and closed clauses. A novel algorithm that employs these representations is also presented and experimentally evaluated.