Parse the result of queries