     (exclusive :pattern :data :pattern/any :pattern/bind :pattern/vector :pattern/map)]
 
    [(exclusive :step? :data :call :match)]
+
+   [(rule [?notebook :notebook/pages ?pages] (:in ?page ?pages) :return [page :notebook/page notebook])]
 
    [(rule [?page :page/args ?args] (:in ?arg ?args) :return [arg :arg page])
     (rule [?page :page/steps ?steps] (:in ?step ?steps) :return [step :step page])]

(q* (datalog/knowledge (clojure.set/union stdlib example-a) rules) [?id :page true] :return id)

(def example-b
  #{[:root :page/args [:arg_x]]
    [:root :page/steps [:result]]
    [:result :match/arg :arg_x]
    [:result :match/branches [:branch_map :branch_nested]]


(errors (datalog/knowledge (clojure.set/union stdlib example-b) rules))

(q* (datalog/knowledge (clojure.set/union stdlib example-b) rules) [:vec :notebook/page ?id] :return id)
