IF Commons GitHub

generate-ontology

Generate the Mizan ontology's Turtle from its TypeScript (commons 0012-ontology FR-011, 0016-ladder).

bun commons/libraries/src/generate-ontology.ts write commons/generated/mizan.auto.ttl bun commons/libraries/src/generate-ontology.ts --check exit 1, writing nothing, where the file is not what the ontology makes

The ontology (commons/ontology/src/mizan/*.ts) is the source, read as the typed values it is; the Turtle is never edited by hand. The ontology is checked first: a rule it breaks stops the run (exit 2) with every finding named.

Spec: 0001-libraries FR-008

Source: commons/libraries/src/generate-ontology.ts

0 of 16 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

digestOfconstno test imports it
const digestOf: (of: readonly OntologyFile[]) => Promise<string>

The SHA-256 of the ontology's canonical N-Triples (0012-ontology FR-012): it changes with a fact, never with the layout of a module.

findingsOffunctionno test imports it
function findingsOf(of: readonly OntologyFile[]): readonly string[]

The findings a rule of the kernel finds in the ontology, one sentence each; none where it is sound.

RUNconstno test imports it
const RUN: "bun commons/libraries/src/generate-ontology.ts"

The command that writes the file again.

TURTLE_PATHconstno test imports it
const TURTLE_PATH: "generated/mizan.auto.ttl"

Where the Turtle is written, from commons' folder.

turtleOffunctionno test imports it
function turtleOf(of: readonly OntologyFile[], digest: string, source?: string): string

The ontology as canonical Turtle: every file's individuals, with every file's prefixes.

MIZANconstno test imports it
const MIZAN: OntologyPublication

Mizan's own ontology, as it is published (0019-mizan-integrations FR-010 to FR-019).

IFCCMconstno test imports it
const IFCCM: OntologyPublication

The ontology of Intellectual Frontiers Capabilities Configuration Management (commons 0020-ifccm), as it is published.

IFQSconstno test imports it
const IFQS: OntologyPublication

The ontology of the Intellectual Frontiers Quality System (commons 0021-ifqs, 0022-trust), as it is published.

OTOconstno test imports it
const OTO: OntologyPublication

The Operational Truth Ontology (commons ontology 0002-oto), as it is published.

PLANNINGconstno test imports it
const PLANNING: OntologyPublication

The ontology of Planning (commons 0037-planning), as it is published.

IFRconstno test imports it
const IFR: OntologyPublication

The ontology of Intellectual Frontiers Releases (commons 0026-works-versioning), as it is published.

KANONconstno test imports it
const KANON: OntologyPublication

The ontology of Kanon (commons 0033-kanon), as it is published.

publicationsconstno test imports it
const publications: readonly OntologyPublication[]

The ontologies of commons that are published, each from its own typed modules: Mizan's, then the ones its specifications define.

exportsOffunctionno test imports it
function exportsOf(auditDigest: string): Promise<ReadonlyMap<string, string>>

The exports of the ontology (0019-mizan-integrations FR-010): everything but its Turtle, by its path from commons' folder.

wantedfunctionno test imports it
function wanted(): Promise<ReadonlyMap<string, string>>

Every file the ontologies make, by its path from commons' folder, in the order they are written.

textOffunctionno test imports it
function textOf(r: { readonly kind: "ok"; readonly value: string; } | { readonly kind: "err"; readonly error: readonly string[]; }, what: string): string

The text of an exporter's result, or a thrown sentence naming what the ontology states that the form cannot hold (main turns it into exit 2).

Titles, headings, exports, tables, columns and requirements. Esc closes.