Encode some query sets to lists