enhance: add :exclude-namespaces export option

Useful for graphs with existing ontologies to avoid noisy
and needless exporting. Also update related scripts and noted
that create script has always been able to also update
This commit is contained in:
Gabriel Horner
2025-03-11 17:15:47 -04:00
parent c85ce5b17c
commit d7721981af
6 changed files with 111 additions and 34 deletions

View File

@@ -32,11 +32,14 @@
"Options spec"
{:help {:alias :h
:desc "Print help"}
:timestamps {:alias :t
:desc "Include timestamps in export"}
:include-timestamps? {:alias :t
:desc "Include timestamps in export"}
:file {:alias :f
:desc "Saves edn to file"}
:export-options {:alias :e
:exclude-namespaces {:alias :e
:coerce #{}
:desc "Namespaces to exclude from properties and classes"}
:export-options {:alias :E
:desc "Raw options map to pass to export"}})
(defn -main [args]
@@ -48,7 +51,7 @@
(js/process.exit 1))
[dir db-name] (get-dir-and-db-name graph-dir)
conn (sqlite-cli/open-db! dir db-name)
export-options (merge {:include-timestamps? (:timestamps options)}
export-options (merge (select-keys options [:include-timestamps? :exclude-namespaces])
(edn/read-string (:export-options options)))
export-map (sqlite-export/build-export @conn {:export-type :graph :graph-options export-options})]
(when (:file options)