Now uses the tab file to convert queryid into list of entityIds