 (defn iyye_is_type_create_function [p1-name p2-type]
   (let [p1-type (words/create-iyye-type p1-name)]
     (when (and p1-type p2-type)
-      (let [new-p1-type (assoc p1-type :Relations (conj (:Relations p1-type) ))])
+      (let [new-p1-type (assoc p1-type :Relations (conj (:Relations p1-type)))
+            p2-subtypes (assoc @iyye_is_type :Data {:sub (:Name (:atom p1-type))})
+            new-p2-type (assoc p2-type :Relations p2-subtypes)]
       (do
-        ()
-        ()
-        ()))))
+        (words/set-iyye-type! new-p1-type)
+        (words/set-iyye-type! new-p2-type))))))
 
 (defn iyye_consists_function [p1 p2]
   (let [])

    (dosync (ref-set iyye_is_type t_is))
    (dosync (ref-set iyye_consists_type consistsof))
    (dosync (ref-set iyye_create_instance instof))
    (dosync (alter words/action-words conj t_is t_is2 consistsof instof))))


(defn- apply-builtin-relations []
  (do


(defn- init-db-kb []
  (let []
    (dosync (alter words/action-words #(apply conj %1 %2) (persistence/read-knowledge-from-db "relations" {}))) ; {:When :ALWAYS}
    (dosync (alter words/noun-words #(apply conj %1 %2) (persistence/read-knowledge-from-db "types" {} ; {:When :ALWAYS}
    )))
      ; others
    ))

