                    (format "(%s)"))]
     (apply vector query params)))
 
+;; Join a set of predicates together with a 'not' relationship,
+;; performing a set difference. This will reject resources matching
+;; _any_ child predicate.
 (defmethod compile-query->sql "not"
-  "Join a set of predicates together with a 'not' relationship, performing a
-set difference. This will reject resources matching _any_ child predicate."
   [db [op & terms]]
   {:pre [(every? vector? terms)]
    :post [(string? (first %))

  (let [ids (range (count queries))]
    (map #(format "%s resources_%d" %1 %2) queries ids)))

(defmethod compile-query->sql "and"
  "Join a set of predicates together with an 'and' relationship, performing an
intersection (via natural join)."
  [db [op & terms]]
  {:pre [(every? vector? terms)]
   :post [(string? (first %))

                   (format "(%s)"))]
    (apply vector query params)))

;; Join a set of predicates together with an 'or' relationship,
;; performing a union operation.
(defmethod compile-query->sql "or"
  [db [op & terms]]
  {:pre [(every? vector? terms)]
   :post [(string? (first %))
