   [label]
   (subs label
         (+ 1
-           (clojure.string/last-index-of label "("))
-        (clojure.string/last-index-of label ")")))
+           (str/last-index-of label "("))
+        (str/last-index-of label ")")))
 
 (defn- unlabel-implication
   "turn an implication on labels into an implication on ids"

(defn- entity-id-from-uri
  "retrieve an entity id from a Wikidata entity URI"
  [uri]
  (let [slash (clojure.string/last-index-of uri "/")]
    (subs uri (+ 1 slash))))

(defn- label-query-for-entities
  ""
  [entities & {:keys [lang] :or {lang "en"}}]
  (str "SELECT ?entity ?label WHERE { VALUES ?entity {"
       (clojure.string/join " "
                            (map entity-add-sparql-prefix entities))
       "} ?entity rdfs:label ?label FILTER(LANG(?label)=\""
       lang

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