 
 (use '[clojure.contrib.io :only (with-in-reader)]
      '[clojure.walk :only (walk)]
-     '[clojure.contrib.def :only (defnk)]
      '[conexp.base :only (set-of)])
 
 ;;;
 
-(defn line-to-pair
+(defn- line-to-pair
   "Converts RDF line to a pair [role [First Second]]."
   [line]
   (let [[A to B] (rest (re-find #"<(.*)> <(.*)> <(.*)>" line))]
     [to [A B]]))
 
-(defn map-count
+(defn- map-count
   "Counts overall entries in a map."
   [hash-map]
   (reduce + (map #(count (get hash-map %)) (keys hash-map))))
 
-(defn read-lines-from-file [file interesting-role? interesting-A? interesting-B?]
+(defn- read-lines-from-file [file interesting-role? interesting-A? interesting-B?]
   (with-in-reader file
     (binding [*in* (clojure.lang.LineNumberingPushbackReader. *in*)]
       (loop [map {},


;;;

(defn read-wiki [roles]
  "Reads model from wikipedia entries. roles can be any quoted
  sequence of child, father, mother, influenced, influencedBy, relation,
  relative, spouse, partner, opponent, ..."
  (let [relations (read-lines-from-file "/users/lat/borch/wikiprops.nt"
                                        (set-of (str "http://dbpedia.org/ontology/" role)
                                                [role roles])
                                        (constantly true)
                                        (constantly true)),
        instances (set (flatten (vals relations))),
        concepts (role-map->concept-map
                  (read-lines-from-file "/users/lat/borch/wikiinstances.nt"
                                        (constantly true)
                                        #(contains? instances %)
                                        #(not (re-find #"owl#Thing" %))))]

            (println line-count)
            map))))))

(defn- capitalize
  "Capitalizes word."
  [word]
  (if (empty? word)
    word
    (apply str (Character/toUpperCase (first word)) (rest word))))

(defn- symbolify
  "Transforms every string in coll to a symbol, walking through
  sequential collectiones recursively."
  [coll]
  ((fn transform [thing]
     (cond
      (string? thing) (symbol (capitalize thing)),
