   (f/simple-collect
    (fn [_ incoming]
      (let [res (vals (peek incoming))]
+       ;;(info :agg-incoming res)
        (delay
-        (when (every? #(not= #{nil} %) res)
+        (when (every? #(not= [nil] %) res)
           (->> res
                (map #(disj % nil))
                (set)

      {:acc acc :result res}))
  (query-result
    [_ id] (when-let [q (@queries id)] @@(:res q)))
  (add-rule
    [_ id query production]
    (let [qid (keyword (str "inf-" (name id)))
          q   (add-query _ qid query)
          inf (f/add-vertex!
               g {:val #{}
                  ::f/collect-fn (collect-inference _ production)})]

(defn start
  []
  (let [g (triple-graph (f/compute-graph))
        toxi (:result (add-query! g :toxi ['toxi nil nil]))
        types (:result (add-query! g :types [nil 'type nil]))
        projects (:result (add-query! g :projects [nil 'type 'project]))
        all (:result (add-query! g :all [nil nil nil]))
        num-projects (add-counter! g projects)
        num-types (add-counter! g types)
        inf1 (add-rule! g :knows [nil 'knows nil] (fn [[s p o]] [[s 'type 'person] [o 'type 'person] [o 'knows s]]))

        ctx (f/async-context {:graph g :processor f/eager-vertex-processor :timeout nil})]
    (f/execute! ctx)
    (mapv
     #(add-triple! g %)
     '[[toxi author fabric]
       [fabric type project]
       [toxi type person]])
