One function to convert query result to a book.