         relation (->Iyye_Relation action-atom Predicate Types Function PredicateFunction [])]
     relation))
 
+(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)})))
+
 (defn create-iyye-instance [values])
 
 (defn load-iyye-atom-from-db [uname])

; Iyye - AI agent
; Copyright (C) 2016-2017  Sasha Yumzya

; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as

          (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)
