enhance: import namespaces to db graph

Working for basic graph but failing on edge case for docs graph.
Part of logseq/db-test#136 and part of LOG-3230
This commit is contained in:
Gabriel Horner
2024-10-17 17:31:17 -04:00
parent 2e3c269375
commit 28457cd02b
6 changed files with 93 additions and 45 deletions

View File

@@ -163,7 +163,7 @@
"Created graph has no validation errors")
(is (= 0 (count @(:ignored-properties import-state))) "No ignored properties")))
(deftest-async export-basic-graph
(deftest-async ^:focus export-basic-graph
;; This graph will contain basic examples of different features to import
(p/let [file-graph-dir "test/resources/exporter-test-graph"
conn (db-test/create-conn)
@@ -179,14 +179,14 @@
;; Counts
;; Includes journals as property values e.g. :logseq.task/deadline
(is (= 19 (count (d/q '[:find ?b :where [?b :block/type "journal"]] @conn))))
(is (= 19 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Journal]] @conn))))
(is (= 20 (count (d/q '[:find ?b :where [?b :block/type "journal"]] @conn))))
(is (= 20 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Journal]] @conn))))
(is (= 4 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Task]] @conn))))
(is (= 3 (count (d/q '[:find ?b :where [?b :block/tags :logseq.class/Query]] @conn))))
;; Don't count pages like url.md that have properties but no content
(is (= 8
(is (= 9
(count (->> (d/q '[:find [(pull ?b [:block/title :block/type]) ...]
:where [?b :block/title] [_ :block/page ?b]] @conn)
(filter ldb/internal-page?))))