 (def time-start (persistence/current-time-to-string))
 (defn get-supertypes [atype]
   "gets types: self, type, immidiate parents"               ; FIXME Yumzia:0 get all parents
-  (let [rels (:Relations atype)]
-    (conj (for [supertype rels :when (:super (:Data supertype))]
-            {:Name (:super (:Data supertype)) :Predicate (:Predicate supertype)})
-          {:Name "type" :Predicate (->Iyye_ModalPredicate :IYE :AXIOM time-start :ALWAYS)}
-          {:Name (:Name (:atom atype)) :Predicate (->Iyye_ModalPredicate :IYE :AXIOM time-start :ALWAYS)})))
+  (when (not (= :UNKNOWN atype))
+    (let [rels (:Relations atype)]
+      (conj (for [supertype rels :when (:super (:Data supertype))]
+              {:Name (:super (:Data supertype)) :Predicate (:Predicate supertype)})
+              {:Name "type" :Predicate (->Iyye_ModalPredicate :IYE :AXIOM time-start :ALWAYS)}
+              {:Name (:Name (:atom atype)) :Predicate (->Iyye_ModalPredicate :IYE :AXIOM time-start :ALWAYS)}))))
 
 (defn create-iyye-instance [values])
 

          (save-iyye-type-to-db type)))))

(defn check-params [action params]
  (let [act-params (:Types action)
        params-types (map #(get-supertypes %) params)
        ;   vec-params (vec (map #(:Name (:atom %)) params))
        pairs (map vector act-params params-types)
        ok (every? true? (for [cur pairs]
                  (if (= :UNKNOWN (first cur))
                    (empty? (second cur))
                    (some true? (map #(= (first cur) %) (map :Name (second cur)))))))]
    ;   (future (Thread/sleep 1000) (ioframes/process-output IO (str "okok " ok)))
    ok)
    ;(compare act-params vec-params)
    )  ; FIXME Yumzya context aware compare

(defn apply-relation [relation params]
  (when (check-params relation params)

;(persistence/write-noun-to-db (into {} type))

(defn get-iyye-atoms [name builtins]
  "returns a list of found atoms with supplied name"
  (let [builtin-types
        (for [word (vals @builtins) :when (= (:Name (:atom word)) name)] word)]
    (if (empty? builtin-types) (list :UNKNOWN) builtin-types)))

(defn get-iyye-types [name]
  (get-iyye-atoms name noun-words))
