Actually the query to use was `dl_class.has_types'.