convert the internal representation of a query to a proplist