 ; ----- Public functions -----
 
 (defn ^Boolean ask-query
-  "Execute SPARQL ASK `query` on RDF `dataset`."
-  [^Dataset dataset
+  "Execute SPARQL ASK `query` on RDF `model`."
+  [^Model model
    ^String query]
-  (with-open [qexec (QueryExecutionFactory/create query dataset)]
+  (with-open [qexec (QueryExecutionFactory/create query model)]
     (.execAsk qexec)))
 
 (defmulti construct-query
   "Execute SPARQL CONSTRUCT `query` on `datasource`."
   (fn [datasource query] (type datasource)))
 
-(defmethod ^Model construct-query Dataset
-  ; Execute SPARQL CONSTRUCT `query` on local RDF `dataset`.
-  [^Dataset dataset
+(defmethod ^Model construct-query Model
+  ; Execute SPARQL CONSTRUCT `query` on local RDF `model`.
+  [^Model model
    ^String query]
-  (with-open [qexec (QueryExecutionFactory/create query dataset)]
+  (with-open [qexec (QueryExecutionFactory/create query model)]
     (.execConstruct qexec)))
 
 (defmethod ^Model construct-query String

  "Execute SPARQL SELECT `query` on `datasource`." 
  (fn [datasource query] (type datasource)))

(defmethod select-query Dataset
  ; Execute SPARQL SELECT `query` on local RDF `dataset`.
  [^Dataset dataset
   ^String query]
  (with-open [qexec (QueryExecutionFactory/create query dataset)]
    (let [results (.execSelect qexec)
          result-vars (.getResultVars results)]
      (mapv (partial process-select-solution result-vars)
            (iterator-seq results)))))

(ns rdf-path-examples.sparql
  (:require [clojure.tools.logging :as log])
  (:import [org.apache.jena.rdf.model Literal Model Resource]
           [org.apache.jena.query QueryExecutionFactory QueryFactory]
           [org.apache.jena.query Dataset]
           [org.apache.jena.update UpdateAction UpdateFactory]))

; ----- Protocols -----

