Handle errors with sparql update queries that reference non-existent resources

- Fix empty query error handling

Resolves: https://www.pivotaltracker.com/story/show/71903492