Query translator