construct occurrence set query