[rules-dev] Reusing query's in accumulate functions