Liking cljdoc? Tell your friends :D

vaelii.host.starter

A starter common-sense KB: a documented, schema-only upper + middle ontology. It loads the upper ontology into CxUniverse (vaelii.host.core-context), then the middle contexts, each a KB file on the classpath under resources/kb/:

  • upper (kb/upper/, every file in CxUniverse): what things are, always true, like genl. Split by domain, one file each:
    • core.txt — the vocabulary the engine interprets and the top of the ontology.
    • abstract.txt — the abstract type skeleton (physical/intangible and their kinds) + the structural relations tangiblePartOf/locatedIn.
    • organism.txt — the biological taxonomy + its disjointness.
    • life.txt — the organism relations (parentOf, siblingOf, flies, mortal, birthYearOf, olderThan, …) with arg + metadata.
    • society.txt — the social relations (marriedTo, likes, owns).
    • measure.txt — the theory of measurement: the two measure terms, the dimensionOf/conversionFactor table with the units that fill it, the comparisons, weightOf / heightOf, and the sign vocabulary for the quantities nobody has a figure for (signOf / trendOf / the qualitative* arithmetic).
    • reflection.txt — the expression lattice (atomic and non-atomic, open and closed, well-formed and ill-formed expressions) and the use/mention vocabulary (proposition, means, denotes, expresses).
    • space.txt — qualitative space, four independent calculi: RCC-8 topology (eight base + six derived), cardinal direction (nine + four), relative direction over a frame's own axes (nine + four, the frame being the context), and qualitative distance (seven + three).
    • time.txt — qualitative time: Allen's interval relations (thirteen base + seven derived), the point algebra over instants, the three calendar constructors and the InstantFn moment a calendar term's startOf and endOf are computed as, plus the length / totalDuration / overlapDuration vocabulary the arithmetic computes over.
  • middle (kb/middle/, one context per file, between CxUniverse and CxWell): how the definitional things interrelate, where several overlapping theories can coexist.
    • CxAnatomy.txt — what kinds of thing have what kinds of part.
    • CxBiology.txt — birds fly by default except penguins; organisms are mortal; flight enables travel; sleep is what the theory is willing to assume.
    • CxChange.txt — a simple event calculus: a state persists until an event ends it, so holdsAt is inertia over what initiates and terminates say.
    • CxKinship.txt — grandparentOf, ancestorOf, olderThan, and parenthood from maternity and paternity.
    • CxMereology.txt — a part is located where its whole is; owning a whole entails owning its parts.
    • CxNormalPhysicalConditions.txt — the states of matter at room temperature and pressure: stone, wood and glass are solid, mercury is liquid, metal_stuff is solid by default. Opt-in: it sees CxUniverse and CxWell does not see it.
    • CxSize.txt — comparative size: stated between kinds, computed between objects from their measures.
    • CxSocial.txt — what acquaintance follows from; employment as one way of belonging; the general relationship and dwelling vocabulary over two persons.
    • CxTra.txt — vocabulary that is generally useful but specific to one domain: relations over software tools, their invocations and receipts and the capabilities they confer, media resources and DNS names, the kinds the relations are typed over, computers and what runs on them, access to a resource and to the files a path names, pull requests on a forge and who may merge them, and the perception relations perceives, sees, seeImage and watchVideo, and relationship and plural- identity vocabulary narrower than CxSocial's. Opt-in: it sees CxUniverse and CxSocial, and CxWell does not see it.

The topology, most general (top) to most specific (bottom): CxUniverse holds the upper ontology; each of the seven theories sees CxUniverse and not the other middle contexts, and an opt-in theory sees the middle context its vocabulary builds on (CxTra sees CxSocial); and CxWell sees every middle context but the opt-in ones. Each middle file wires itself in with its own genlCx edges, so the topology is data. No cast and no contingent facts ship: the starter is a schema, and contingent data (a cast, worked examples, the Aesop fables) belongs below CxWell and lives in the tests that need it.

The unit table is the one place individuals ship, and it applies that rule rather than excepting itself from it: a minute is sixty seconds by stipulation, so the factor is vocabulary and not a measurement anybody took. measure.txt states the test it holds a unit to.

What stays in code here is the order the layers load in — loading order is logic, the definitional layer must precede the theories that reason over it — and the one computed batch (every type is also a unary_predicate). Within a layer, every file present is loaded (discovered from the classpath), so adding a domain or a theory is dropping a file in kb/upper/ or kb/middle/, no code change.

A starter common-sense KB: a documented, **schema-only** upper + middle ontology.
It loads the upper ontology into CxUniverse (vaelii.host.core-context), then the
middle contexts, each a KB file on the classpath under resources/kb/:

  * upper (`kb/upper/`, every file in CxUniverse): what things *are*, always true, like
    `genl`.  Split by domain, one file each:
      - core.txt       — the vocabulary the engine interprets and the top of the
                              ontology.
      - abstract.txt   — the abstract type skeleton (physical/intangible and
                              their kinds) + the structural relations tangiblePartOf/locatedIn.
      - organism.txt   — the biological taxonomy + its disjointness.
      - life.txt       — the organism relations (parentOf, siblingOf, flies,
                              mortal, birthYearOf, olderThan, …) with arg + metadata.
      - society.txt    — the social relations (marriedTo, likes, owns).
      - measure.txt    — the theory of measurement: the two measure terms, the
                              dimensionOf/conversionFactor table with the units that
                              fill it, the comparisons, weightOf / heightOf, and the
                              sign vocabulary for the quantities nobody has a figure
                              for (signOf / trendOf / the qualitative* arithmetic).
      - reflection.txt — the expression lattice (atomic and non-atomic, open and
                              closed, well-formed and ill-formed expressions) and the
                              use/mention vocabulary (proposition, means, denotes,
                              expresses).
      - space.txt      — qualitative space, four independent calculi: RCC-8
                              topology (eight base + six derived), cardinal direction
                              (nine + four), relative direction over a frame's own axes
                              (nine + four, the frame being the context), and
                              qualitative distance (seven + three).
      - time.txt       — qualitative time: Allen's interval relations (thirteen
                              base + seven derived), the point algebra over instants,
                              the three calendar constructors and the InstantFn moment
                              a calendar term's startOf and endOf are computed as, plus
                              the length / totalDuration / overlapDuration vocabulary
                              the arithmetic computes over.
  * middle (`kb/middle/`, one context per file, between CxUniverse and CxWell): how the
    definitional things *interrelate*, where several overlapping theories can coexist.
      - CxAnatomy.txt   — what kinds of thing have what kinds of part.
      - CxBiology.txt   — birds fly by default except penguins; organisms
                               are mortal; flight enables travel; sleep is what the
                               theory is willing to assume.
      - CxChange.txt    — a simple event calculus: a state persists until an
                               event ends it, so holdsAt is inertia over what
                               initiates and terminates say.
      - CxKinship.txt   — grandparentOf, ancestorOf, olderThan, and parenthood
                               from maternity and paternity.
      - CxMereology.txt — a part is located where its whole is; owning a whole
                               entails owning its parts.
      - CxNormalPhysicalConditions.txt — the states of matter at room temperature
                               and pressure: stone, wood and glass are solid,
                               mercury is liquid, metal_stuff is solid by default.
                               Opt-in: it sees CxUniverse and CxWell does not
                               see it.
      - CxSize.txt      — comparative size: stated between kinds, computed
                               between objects from their measures.
      - CxSocial.txt    — what acquaintance follows from; employment as one way
                               of belonging; the general relationship and
                               dwelling vocabulary over two persons.
      - CxTra.txt       — vocabulary that is generally useful but specific to
                               one domain: relations over software tools, their
                               invocations and receipts and the capabilities they
                               confer, media resources and DNS names, the kinds
                               the relations are typed over, computers and what
                               runs on them, access to a resource and to the
                               files a path names, pull requests on a forge
                               and who may merge them, and
                               the perception relations perceives, sees, seeImage
                               and watchVideo, and relationship and plural-
                               identity vocabulary narrower than CxSocial's.
                               Opt-in: it sees CxUniverse and CxSocial, and
                               CxWell does not see it.

The topology, most general (top) to most specific (bottom): CxUniverse holds the upper
ontology; each of the seven theories sees CxUniverse and not the other middle
contexts, and an opt-in theory sees the middle context its vocabulary builds on (CxTra
sees CxSocial); and CxWell sees every middle context but the opt-in ones.  Each middle file wires itself in
with its own `genlCx` edges, so the topology is data.  **No cast and no contingent facts
ship**: the starter is a schema, and
contingent data (a cast, worked examples, the Aesop fables) belongs below CxWell
and lives in the tests that need it.

The unit table is the one place individuals ship, and it applies that rule rather
than excepting itself from it: a minute is sixty seconds by stipulation, so the
factor is vocabulary and not a measurement anybody took.  measure.txt states
the test it holds a unit to.

What stays in code here is the *order the layers* load in — loading order is logic,
the definitional layer must precede the theories that reason over it — and the one
computed batch (every type is also a unary_predicate).  Within a layer, every file
present is loaded (discovered from the classpath), so adding a domain or a theory is
dropping a file in kb/upper/ or kb/middle/, no code change.
raw docstring

load-intoclj

(load-into kb)
(load-into kb loaded)

Populate kb with the starter schema — every file under resources/kb/upper/ and resources/kb/middle/, loaded on kb start by default, then warn-retired over every release's :retired set (seed/release-renames). Returns kb.

loaded, when given, is called with each load's context right after it is asserted — CxUniverse after the upper ontology, then each middle context in load order — and with :unary-predicates after the closing batch, which no file states. vaelii.host.sync reads it to learn which load each premise came from.

Populate `kb` with the starter schema — every file under resources/kb/upper/ and
resources/kb/middle/, loaded on kb start by default, then `warn-retired` over every
release's `:retired` set (`seed/release-renames`). Returns kb.

`loaded`, when given, is called with each load's context right after it is asserted —
`CxUniverse` after the upper ontology, then each middle context in load order — and
with `:unary-predicates` after the closing batch, which no file states.
`vaelii.host.sync` reads it to learn which load each premise came from.
sourceraw docstring

load-sourcesclj

(load-sources kb sources)

Load sources into kb in order, each :starter (load-into) or a text KB path (v/load-text!), and return kb. Over a store with a directory whose records answer p/belief-fingerprint, it records the load key (dfiles/write-load-key!) and the handles each source states (dfiles/write-load-stated!). Under an unchanged key, the sources before the first whose hash differs from the recorded one are skipped, and the premises the recorded sources from there stated are trimmed to what sources state (trim-stated!) before the rest load. See docs/operations.md, "Restarting over a built store".

Load `sources` into `kb` in order, each `:starter` (`load-into`) or a text KB path
(`v/load-text!`), and return kb.  Over a store with a directory whose records answer
`p/belief-fingerprint`, it records the load key (`dfiles/write-load-key!`) and the
handles each source states (`dfiles/write-load-stated!`).  Under an unchanged key, the
sources before the first whose hash differs from the recorded one are skipped, and the
premises the recorded sources from there stated are trimmed to what `sources` state
(`trim-stated!`) before the rest load.  See docs/operations.md, "Restarting over a
built store".
sourceraw docstring

load-starter-and-layersclj

(load-starter-and-layers kb opts)

load-sources of the starter, then of each path in opts' :layers: the entry point vaelii.starter/load-into is. A key other than :layers is refused (:unknown-option).

`load-sources` of the starter, then of each path in `opts`' `:layers`: the entry point
`vaelii.starter/load-into` is.  A key other than `:layers` is refused
(`:unknown-option`).
sourceraw docstring

load-through-dumpclj

(load-through-dump open root)

Answer a KB holding the starter, restored from the export dump dump-name names under the directory root. open answers an empty KB. With no such dump, or one the import refuses, load-into runs on a KB open answers, and that KB replaces every dump under root. See docs/web.md, "The starter dump".

Answer a KB holding the starter, restored from the export dump `dump-name` names under
the directory `root`.  `open` answers an empty KB.  With no such dump, or one the import
refuses, `load-into` runs on a KB `open` answers, and that KB replaces every dump under
`root`.  See docs/web.md, "The starter dump".
sourceraw docstring

warn-retiredclj

(warn-retired kb retired)

Log at :warn each symbol of retired that a stored sentex of kb names, with how many name it, and return those counts as a sorted map. One term-index read per symbol (v/find-sentexes), so an empty retired reads nothing.

Log at `:warn` each symbol of `retired` that a stored sentex of `kb` names, with how
many name it, and return those counts as a sorted map.  One term-index read per symbol
(`v/find-sentexes`), so an empty `retired` reads nothing.
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