Liking cljdoc? Tell your friends :D

vaelii.impl.io.export

Write a KB out as a portable export dump: a directory holding the record store's streams in a format that survives a backend change, an index-representation change and a record class rename. A frame never carries a class name; it is the record's field map. meta.edn is written last and is the completion marker. The index is optional and always discardable. See docs/storage.md, "Exporting and importing a dump".

Write a KB out as a portable export dump: a directory holding the record store's streams
in a format that survives a backend change, an index-representation change and a record
class rename. A frame never carries a class name; it is the record's field map. `meta.edn`
is written last and is the completion marker. The index is optional and always
discardable. See docs/storage.md, "Exporting and importing a dump".
raw docstring

ensure-empty-dir!clj

(ensure-empty-dir! dir what noun)

dir as an empty directory, created when it does not exist. A directory that already holds anything is refused with :not-empty, a file with :not-a-directory. what names the destination and noun the thing written, in the messages.

`dir` as an empty directory, created when it does not exist. A directory that already
holds anything is refused with `:not-empty`, a file with `:not-a-directory`. `what`
names the destination and `noun` the thing written, in the messages.
sourceraw docstring

export!clj

(export! kb dir)
(export! kb
         dir
         {:keys [variant compression chunk-size on-progress provenance? belief?]
          :or {variant :records
               compression :gzip
               chunk-size 10000
               on-progress no-progress
               provenance? true
               belief? true}
          :as opts})

Export kb's records to dir as a portable dump, and return a summary {:variant :records :sentexes n :justifications n :provenance n :index-entries n :bytes n :elapsed-ms n :dir "…"}.

opts: {:variant :records|:records+index :compression :gzip|:xz|:none :chunk-size n :provenance? bool :belief? bool :on-progress f}, defaults :records, :gzip, 10000, true and true. :on-progress is called with {:phase :done :total} at every chunk boundary, in phase order :sentexes, :justifications, :provenance, :index-entries, :belief, :meta; a callback that throws cancels the export and leaves a directory with no meta.edn. Handles are exported as they stand. :records+index also writes index/, with its fingerprint computed on the same walk as the sentex frames. :belief? true also writes reasoning/ for a KB on the dense network with the default provers and solver; the summary's :reasoning-image is :written, :not-writable (also when the change clock moved during the export) or :omitted. :provenance? false omits the provenance stream, which is also omitted when no handle carries one. dir must not exist or must be empty (:type :not-empty). See docs/storage.md, "Exporting and importing a dump".

Export `kb`'s records to `dir` as a portable dump, and return a summary `{:variant :records
:sentexes n :justifications n :provenance n :index-entries n :bytes n :elapsed-ms n :dir
"…"}`.

`opts`: `{:variant :records|:records+index :compression :gzip|:xz|:none :chunk-size n
:provenance? bool :belief? bool :on-progress f}`, defaults `:records`, `:gzip`, 10000, true
and true. `:on-progress` is called with `{:phase :done :total}` at every chunk boundary, in
phase order `:sentexes`, `:justifications`, `:provenance`, `:index-entries`, `:belief`,
`:meta`; a callback that throws cancels the export and leaves a directory with no
`meta.edn`. Handles are exported as they stand. `:records+index` also writes `index/`,
with its fingerprint computed on the same walk as the sentex frames. `:belief? true` also
writes `reasoning/` for a KB on the dense network with the default provers and solver; the
summary's `:reasoning-image` is `:written`, `:not-writable` (also when the change clock
moved during the export) or `:omitted`. `:provenance? false` omits the provenance stream,
which is also omitted when no handle carries one. `dir` must not exist or must be empty
(`:type :not-empty`). See docs/storage.md, "Exporting and importing a dump".
sourceraw docstring

format-markerclj

The dump's own marker. The engine's dumps carry no :format and number their format on a line of their own, so ours announces whose it is rather than colliding with a foreign version space.

The dump's own marker.  The engine's dumps carry no `:format` and number their
format on a line of their own, so ours announces whose it is rather than colliding
with a foreign version space.
sourceraw docstring

format-versionclj

Version 1: field-map frames, chunked framing, handles preserved.

Version 1: field-map frames, chunked framing, handles preserved.
sourceraw docstring

variantsclj

What a dump can hold. :records is the whole KB — everything else is derived from the records and rebuilt on the way in. :records+index adds the index as a cache the reader may or may not use; it never adds knowledge, only speed.

What a dump can hold.  `:records` is the whole KB — everything else is derived from
the records and rebuilt on the way in.  `:records+index` adds the index as a cache the
reader may or may not use; it never adds knowledge, only speed.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close