A simple API for building abstract queries