Clean up query and results for OWL Sparql queries.