                      "and the two columns to be 'code' and 'name'."))
         (run-etl config-path)))))
 
-(defn import-metadata-categories [corpus]
+(defn import-metadata-categories! [corpus]
   (let [tsv-path    (.getPath (fs/temp-file "metadata-cats"))
         config-path (.getPath (fs/temp-file "metadata_cat_config"))]
     (modify-metadata-categories-tsv! corpus tsv-path)
     (modify-metadata-categories-config! corpus config-path tsv-path)
     (run-etl config-path)))
 
+(defn import-metadata-values! [corpus]
+  (let [tid-tsv-path      (.getPath (fs/temp-file "tids"))
+        other-tsv-path    (.getPath (fs/temp-file "metadata_vals"))
+        tid-config-path   (.getPath (fs/temp-file "tid_config"))
+        other-config-path (.getPath (fs/temp-file "metadata_val_config"))]
+    (println tid-config-path)
+    #_(create-tid-tsv! corpus tid-tsv-path)
+    (modify-tid-config! corpus tid-config-path tid-tsv-path)
+    #_(modify-metadata-values-tsv! corpus tsv-path)
+    #_(run-etl config-path)))

                   :classes [{:name "Corpus", :extends "V"}
                             {:name "MetadataCategory", :extends "V"}
                             {:name "HasMetadataCategory", :extends "E"}],
                   :indexes [{:class "Corpus", :fields ["code:string"], :type "UNIQUE"}]}}})

(defn- run-etl [config-path]
  (let [etl-path (:oetl environ/env)]

      ;; the category combined, which will be used to create edges from
      ;; the category to its values when we import the latter.
      (let [[orig-headers & orig-rows] (read-csv orig-tsv-file)
            headers (cons "corpus_cat" orig-headers)
            rows    (map #(cons (str corpus "_" (first %)) %) orig-rows)]
        (assert (= ["corpus_cat" "code" "name"] headers)
                (str "Format error: Expected first line to contain column headers "
                     "and the two columns to be 'code' and 'name'."))
        (write-csv tsv-file (cons headers rows))))))

(defn- modify-metadata-categories-config! [corpus config-path tsv-path]
  (spit config-path (-> metadata-categories-config-template
