IF Commons GitHub

spec-terms

The rule that a specification names only terms the ontology defines (commons 0018-standards-first FR-001, 0003-mizan FR-019): every prefixed name in code font whose prefix is one of the ontologies given (mz:Rung, pm:PackageManager) must be a term of that ontology, a class, a property or an individual of a code list. A prefix that is not given (schema:, skos:, a standard's own) is not read: the standard defines it, and an import that holds it makes its use compile.

A second rule goes the other way (0003-mizan FR-044): a requirement that names a term of the ontology in code font must be cited back by that term's mz:definedBy, so that the requirement and the term are two ends of one link (the requirement-to-term stage of the trace chain, 0020-ifccm FR-014).

Pure over text. Prefixed names are read only inside backticks, so that a sentence's colon, a URL or a **Status:** is not one.

import { specTermFindings } from "./spec-terms.ts";
specTermFindings([{ slug: "0001-x", spec: "Uses `mz:Rung` and `mz:Nothing`." }], { mz: new Set(["Rung"]) }).map((f) => f.key);
// ["mizan/spec-term-unknown specs/0001-x/spec.md mz:Nothing"]

Source: commons/mizan/src/spec-terms.ts

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

definitionsOffunction
function definitionsOf(records: readonly TermRecord[], prefixes: Readonly<Record<string, string>>): TermDefinitions

The definitions of the terms of audit records, by CURIE: the IRI of each record is written with the first of prefixes (a prefix and its namespace) that begins it, and carries what its definedBy says. A term of no given namespace is left out.

Imported by 11 tests of the run (11 passed, 0 failed): the library's results

KnownTermstypeno test imports it
type KnownTerms = Readonly<Record<string, ReadonlySet<string>>>;

The local names an ontology defines, by its prefix.

specTermFindingsfunction
function specTermFindings(specs: readonly SpecText[], known: Readonly<Record<string, ReadonlySet<string>>>, deprecated?: ReadonlyMap<string, string>): readonly MizanFinding[]

The findings: a prefixed name of a given ontology that the ontology does not define, once for each name in each specification.

Imported by 19 tests of the run (19 passed, 0 failed): the library's results

termDefinedByFindingsfunction
function termDefinedByFindings(specs: readonly SpecText[], known: Readonly<Record<string, ReadonlySet<string>>>, definitions: TermDefinitions): readonly MizanFinding[]

The requirement-to-term stage of the trace (0003-mizan FR-044): for each requirement that names a term of a given ontology in code font (mz:Rung), the term must say, in mz:definedBy, that the requirement defines it. One finding for each requirement and term: where the term states no definedBy, and where it states others and not this requirement. A requirement that names a term the ontology does not define is mizan/spec-term-unknown's, and a prefix not given is not read. The findings are warnings a baseline holds.

Imported by 11 tests of the run (11 passed, 0 failed): the library's results

TermDefinitionstypeno test imports it
type TermDefinitions = ReadonlyMap<string, readonly string[]>;

What the ontologies say of the specifications that define each term: the values of mz:definedBy by the term's CURIE (mz:Rung).

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