Refactored sparql queries.