                            (relate-right model (prop (:haschild db)) binding)))
 
         projector (first (relate-left model (prop (:projects db)) binding)) ;;TODO only works for container pointed at by projector for now.
-        path (and projector (first (relate-right model (prop (:path db)) projector)))
-
-        bindable (bound-func binding model)
-
-        type (:type bindable)
+        path (if projector (first (relate-right model (prop (:path db)) projector)))
+
+        bindable (first (relate-right model (prop "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") binding))
+
+        types (set (map #(.toString %) (relate-right model (prop "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") binding)))
+
+        func (reduce (fn [accum val] (or accum (get functions val))) nil types)
 
         new-url-parts (if path
                   (conj url-parts (.getString (.asLiteral path)))
                   url-parts)
 
         sub-calls (map (fn [child] (s-rec child model url-parts)) children) ;; make the next part of the tree
-        meta-data (get-meta-data binding model)]
+        meta-data (get-meta-data binding model)
+        myp (first (relate-right model (prop (:path db)) binding))
+        mypath (if myp (.getString (.asLiteral myp)))]
 
     (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)
-                myp (first (relate-right model (prop (:path db)) binding))
-                mypath (and myp (.getString (.asLiteral myp)))
-                ]
-            (fn [data child resource url built-url]
-
-              (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 active url meta vals]
-                             (let [val (first vals)]
-                               (child-func
-                                uri (:uri val) bind meta (:html val))))
-                           (fn [uri bind active url meta vals]
-                             (parent-func
-                              uri bind active url meta
-                              (map (fn [val] (child-func
-                                             uri (:uri val) bind meta (:html val))) vals))))
-                    current (and mypath (get (parse-uri url) mypath))
-                    active (and mypath (= current (.getURI resource)))
-                    myurl (and mypath (str built-url mypath "/" (.getURI resource) "/")) ]
-                (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)
-                      active
-                      (or myurl built-url)
-                      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
-                                                                     (fn [val] (sub-call data nil val url built-url))
-                                                                     related))
-                                                                  sub-calls))))))))))
-          (= type :container)
+     (contains? types (db :relator))
+
+     (let [statement (get-bound binding model) ;; fuckery for binding
+           relation-getter (fn [data resource] (relator statement data resource))]
+       (fn [data child resource url built-url]
+
+         (let [related (if child   ;; get sub-resources (a single one if partial rendering)
+                         (seq [child])
+                         (relation-getter data resource))
+               current (if mypath (get (parse-uri url) mypath))
+               active (if mypath (= current (.getURI resource)))
+               myurl (if mypath (str built-url mypath "/" (.getURI resource) "/"))
+               vals (if (empty? sub-calls)
+                   (map literalize related)
+                   (map seq (apply map vector (map (fn [sub-call]
+                                                     (map
+                                                      (fn [val] (sub-call data nil val url built-url))
+                                                      related))
+                                                   sub-calls))))]
+           (if child
+             (hic/html vals) ;;TODO extract this business... maybe?
+             (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)
+                   active
+                   (or myurl built-url)
+                   meta-data
+                   vals)))))
+     (contains? types (db :container)) ;;TODO make it so we can project from a container.
           (fn [data child resource url built-url]
-            (let [func (:display bindable)
-                  ppath (and path (.getString (.asLiteral path)))
+            (let [ppath (if path (.getString (.asLiteral path)))
                   p (get (parse-uri url) ppath)
                   projected (if (and p (res p))
                               (if (.containsResource data (res p))

    (.add qm "root" (res "http://logangilmour.com/example-ontology#person"))  ;; TODO DIRTY DIRTY HACKS

    (let [done (.toString (new ParameterizedSparqlString s qm))]
      ;;(println (render-query query false) "\n\n\n" (render-graph query) "\n\n\n" done)
      (.execConstruct
       (. QueryExecutionFactory sparqlService
          "http://localhost:8000/sparql/"

        (fn [data resource uri]
          ((s-rec root inf []) data nil resource uri "/view/"))
        ))
  ([view-data widget-data binding]

     (let [inf (. ModelFactory createRDFSModel (.union view-data widget-data))]
        (fn [data child resource uri] ((s-rec binding inf []) data child resource uri "/view/"))
        )))

(defn syncer [inf widget-data]
  (fn [command url]

    (let [predicate (res (:predicate command))
          binders (get-all-bindings inf predicate)
          bindings (map #(.getSubject %) binders)
          views (map (partial serializer inf widget-data) bindings)]

      (map (fn [binder]

