 (defn- entity-id-from-uri
   "retrieve an entity id from a Wikidata entity URI"
   [uri]
-  (let [slash (clojure.string/last-index-of uri "/")]
+  (let [slash (str/last-index-of uri "/")]
     (subs uri (+ 1 slash))))
 
 (defn- label-query-for-entities
-  ""
+  "construct a query that retrieves labels for a list of entities, in a given language (default english)"
   [entities & {:keys [lang] :or {lang "en"}}]
   (str "SELECT ?entity ?label WHERE { VALUES ?entity {"
-       (clojure.string/join " "
+       (str/join " "
                             (map entity-add-sparql-prefix entities))
        "} ?entity rdfs:label ?label FILTER(LANG(?label)=\""
        lang

  [label]
  (subs label
        (+ 1
           (clojure.string/last-index-of label "("))
        (clojure.string/last-index-of label ")")))

(defn- unlabel-implication
  "turn an implication on labels into an implication on ids"

                         property
                         " []"))]
    (str "?entity "
         (str/join
          ";\n    "
          (map to-clause premise))
         " .")))
