toString representation for Query and its implementations