Refactored query and update to rely on abstract functions rather than specific fuseki calls.