IF Commons GitHub

changes/terms-file

The ontology's citations of requirements as a harness states them for the offline trace (commons 0020-ifccm FR-036): a JSON file, or a TypeScript or JavaScript module, that gives each term and the requirements its mz:definedBy names.

Host layer: a module is loaded with a dynamic import() of its file: URL (never of a bare path, which Windows reads as a drive and a scheme), so the same call works on Bun, on Node 26 and on Windows. A module gives its terms as export const terms (or as its default export); an element is either { term, cites, file? } or a record of an audit of terms ({ values: { termIri, definedBy } }, the shape the audits of commons' ontologies and of a harness's own have). A JSON file is an array of the first shape, or an object with it as terms.

import { readTermsFile } from "./terms-file.ts";
const r = await readTermsFile("ontology/terms.json");
if (r.kind === "ok") r.value.map((t) => t.term);

Source: commons/mizan/src/changes/terms-file.ts

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

changes.readTermsFilefunctionno test imports it
function readTermsFile(path: string): Promise<Result<readonly OntologyCitation[], string>>

The citations of the file at path: JSON (by its .json name) or a module that exports terms.

readTermsFilefunctionno test imports it
function readTermsFile(path: string): Promise<Result<readonly OntologyCitation[], string>>

The citations of the file at path: JSON (by its .json name) or a module that exports terms.

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