                                 "")))
                           (relate-right model (prop (:haschild db)) binding))
 
-        statement (get-bound binding model) ;; fuckery for binding
-
-        parent-func (:resource (bound-func binding model)) ;; extraneous function getting
-        child-func (:value (bound-func binding model))
-
-        relation-getter (fn [data resource] (relator statement data resource)) ;; get the function that gets the children for this node, will be used to bulid the next value of tree-builder.
+        bindable (bound-func binding model)
+
+        type (:type bindable)
 
         sub-calls (map (fn [child] (s-rec child model)) children) ;; make the next part of the tree
         meta-data (get-meta-data binding model)]
 
-    (fn [data child resource]
-
-      (let [related (if child   ;; get sub-resources (a single one if partial rendering)
-                      (seq [child])
-                      (relation-getter data resource))
-            func (if child ;; get the bound function
-                   (fn [uri bind meta vals]
-                     (let [val (first vals)]
-                       (child-func
-                        uri (:uri val) bind meta (:html val))))
-                   (fn [uri bind meta vals]
-                     (parent-func
-                      uri bind meta
-                      (map (fn [val] (child-func
-                                     uri (:uri val) bind meta (:html val))) vals))))]
-        (func (.getURI resource) ;; apply the bound function to the thing, the binding that points at the funtion, meta-data, and the finished children (should be ordered by now).
-              (.getURI binding)
-              meta-data
-              (map (fn [val] {:uri (first val) :html (second val)})
-                   (map vector
-                        (map #(.toString %) related) ;; TODO this is a little sketchy
-                        (if (empty? sub-calls)
-                          (map literalize related)
-                          (map seq (apply map vector (map (fn [sub-call]
-                                                            (map
-                                                             (partial sub-call data nil)
-                                                             related))
-                                                          sub-calls)))))))))))
+    (cond (= type :relator)
+          (let [statement (get-bound binding model) ;; fuckery for binding
+                relation-getter (fn [data resource] (relator statement data resource))
+                child-func (:value bindable)
+                parent-func (:resource bindable)] ;; extraneous function getting]
+            (fn [data child resource]
+
+              (let [related (if child   ;; get sub-resources (a single one if partial rendering)
+                              (seq [child])
+                              (relation-getter data resource))
+                    func (if child ;; get the bound function
+                           (fn [uri bind meta vals]
+                             (let [val (first vals)]
+                               (child-func
+                                uri (:uri val) bind meta (:html val))))
+                           (fn [uri bind meta vals]
+                             (parent-func
+                              uri bind meta
+                              (map (fn [val] (child-func
+                                             uri (:uri val) bind meta (:html val))) vals))))]
+                (func (.getURI resource) ;; apply the bound function to the thing, the binding that points at the funtion, meta-data, and the finished children (should be ordered by now).
+                      (.getURI binding)
+                      meta-data
+                      (map (fn [val] {:uri (first val) :html (second val)})
+                           (map vector
+                                (map #(.toString %) related) ;; TODO this is a little sketchy
+                                (if (empty? sub-calls)
+                                  (map literalize related)
+                                  (map seq (apply map vector (map (fn [sub-call]
+                                                                    (map
+                                                                     (partial sub-call data nil)
+                                                                     related))
+                                                                  sub-calls))))))))))
+          (= type :container)
+          (fn [data child resource]
+            (let [func (:display bindable)]
+              (func
+                  meta-data
+                  (map (fn [sub-call] (sub-call data nil resource)) sub-calls)))))))
 
 (defn select [model subject predicate object]
   (iterator-seq (.listStatements (new SimpleSelector subject predicate object))))

                   (:title meta) ": " vals]))
    :value (fn [parent uri binding meta val]
             (hic/html val))
    :update nil}

   (db :text-field)
   {:resource (fn [uri binding meta vals]
                (hic/html [:label (str (:title meta) " ")
                   [:input {:type "text"

    :value (fn [parent uri binding meta val]
             (hic/html val))
    :update (fn [uri pred data]
              {:type "update" :uri uri :predicate pred :value data})
    :type :relator}
   :h1
   {:display (fn [meta vals]
               (hic/html [:h1 vals]))
    :type :container}})

(def functions (apply assoc {} (flatten (map (fn [key] [(str "http://logangilmour.com/data-binder#" (name key)) (get funcs key)]) (keys funcs)))))

(merge db (apply uris "http://logangilmour.com/data-binder#" (keys funcs)))


(defn relator [statement model resource]
