 
 (defn qb [binding model uri] ;; TODO come up with a nice URI aliasing thing
   (let [children (concat
-                  (relate-right model (prop (:haschild db)) binding)
-                  (relate-right model (prop (:projects db)) binding))
-
-        projector (first (relate-left model (prop (:projects db)) binding))
-        ppath (if projector (first (relate-left model (prop (:path db)) projector)))
+                  (relate-right model (prop (bind :child)) binding)
+                  (relate-right model (prop (bind :projection)) binding))
+
+        projector (first (relate-left model (prop (bind :projection)) binding))
+        ppath (if projector (first (relate-left model (prop (bind :path)) projector)))
 
         types (set (map #(.toString %) (relate-right model (prop "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") binding)))
 
-        path (first (relate-right model (prop (:path db)) binding))
+        path (first (relate-right model (prop (bind :path)) binding))
         onpath (if path (get uri (.getString (.asLiteral path))))
 
         subs


(defn uuid [] (str "urn:uuid:" (java.util.UUID/randomUUID)))

(def db (uris "http://logangilmour.com/data-binder#" :rank :root :binds :bindo  :haschild :container :relator :contains :projects :path))

(def funcs
  {:projector

(defn s-rec [binding model url-parts]

  (let [children (sort-by (fn [resource]
                            (let [p (.getProperty model resource (prop (bind :rank)))]
                              (if p
                                (.getString (.asLiteral (.getObject p)))
                                "")))
                          (concat
                           (relate-right model (prop (bind :contains)) binding)
                           (relate-right model (prop (bind :child)) binding)))

        projector (first (relate-left model (prop (bind :projection)) binding)) ;;TODO only works for container pointed at by projector for now.
        path (if projector (first (relate-right model (prop (bind :path)) projector)))

        bindable (first (relate-right model (prop "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") binding))

