Updates to SPARQL query API

Implements issue #7