diff --git a/src/zd/datalog.clj b/src/zd/datalog.clj index f047d36..370102b 100644 --- a/src/zd/datalog.clj +++ b/src/zd/datalog.clj @@ -82,6 +82,7 @@ (defn parse-query [q] (let [xs (->> (str/split q #"\n") + (mapv str/trim) (remove (fn [s] (or (str/blank? s) (str/starts-with? s "\\"))))) columns (->> xs (filterv #(re-matches #"^\s?>.*" %)) @@ -158,7 +159,7 @@ (defn sugar-query [ztx q] (let [q (parse-query q) - _ (println :q q) + _ (def q q) idx (:index q) res (->> (query ztx (dissoc q :columns :index)) diff --git a/test/zd/datalog_test.clj b/test/zd/datalog_test.clj index 416f2ec..505f403 100644 --- a/test/zd/datalog_test.clj +++ b/test/zd/datalog_test.clj @@ -169,7 +169,10 @@ e :title t (datalog/parse-query q) - (datalog/sugar-query ztx q) + + (datalog/sugar-query ztx " +e :parent #people +> e:* ") )