 
 (defn s-rec [binding model]
 
-  (let [context (build-context model {} binding)
+  (let [context (build-context model binding)
 
         params (named-params model context)
-        children (sort-by (fn [resource]
-                            (let [p (.getProperty model resource (prop (bind :rank)))]
-                              (if p
-                                (.getString (.asLiteral (.getObject p)))
-                                "")))
-                          (relate-right model (prop (bind :child)) binding))
-        bindings (clojure.string/join ", "
-                                      (map #(.getURI %)
-                                           (get-subs model binding)))
+        children (get context (bind :children))
+        bindings (clojure.string/join
+                  ", "
+                  (map #(.getURI %)
+                       (filter #(not (contains? (types model %) (bind :container))) children)))
 
         from (get context (bind :from))
 

  :js \"emit(listItem(this));\" .

w:list-item rdfs:subClassOf :view ;
  :param w:item-url ;
  :end w:item-end ;
  :base [a w:list-item- ;
         :path w:item-url ;
         :child [a w:active ;
                 w:check-path w:item-url ;
                 :rank 1 ],
                w:item-end] .

w:item-end a w:projector ;
  :rank 2 .

w:link-list rdfs:subClassOf :view ;
  :param w:list-path, w:list-binding, w:list-title;
  :end w:list-end ;
  :base
    [a w:list ;
     dc:title w:list-title ;
     :child w:list-binding].

w:list-binding :child w:list-end .

w:list-end a w:list-item;
  w:item-url w:list-path.



tm:type-manager rdfs:subClassOf :view ;
:param tm:type, tm:title, tm:item , tm:path;
:end tm:ending;
:base
  [a w:row ;
  :root tm:type ;
  :child
    [a w:column4 ;
     :rank 1 ;
     :child
      [a w:link-list ;
       :rank 1 ;
       w:list-title tm:title ;
       w:list-binding [:object rdf:type ] ;
       :child tm:item ;
       w:list-path tm:path] ,
      [a w:creator ;
       :rank 2;
       :child [:object rdf:type]]] ,
      tm:ending].

tm:ending a w:column4;
:from tm:path ;
:rank 2.





cb:relator rdfs:subClassOf :view ;
  :param cb:binding , cb:path ;
  :base [a w:checkbox ;
         :child cb:binding ,
                [a w:value ; :from cb:path ; :rank 2 ]] .

cb:binding
  :from cb:path ;
  :rank 1 ;

  :child [a w:value] .



w:item :rank 2 .


w:activating-list-item rdfs:subClassOf :view .

w:deleter
  rdfs:subClassOf :container ;


(defn uris [base & resources]
  (apply assoc {} (flatten (map (fn [resource] [resource (str base (name resource))]) resources))))

(defn write-out [model]
  (with-open [out (io/output-stream "/Users/logangilmour/test.rdf")]
    (.write model out "TURTLE"))

  nil)

(defn literalize [res]
  (if res
