Written to: 6 requirements: 6 proved, 0 partly, 0 failing, 0 with no test recorded. 0061-meaning-registers FR-006, 0061-meaning-registers FR-007, 0061-meaning-registers FR-008, 0061-meaning-registers FR-009, 0061-meaning-registers FR-010, 0061-meaning-registers FR-011
The meaning registers at work (commons data 0061-meaning-registers): the code that reads the tables of the meaning model (models/meaning) and the checks that are made of data without one. A source value is translated by the mappings that are approved and hold at a time, and the coverage of a mapping says which observed values nothing maps; a null rule is applied to say what a missing value is; the variances that have expired are found; a column is profiled with counts only; and a seeded generator makes synthetic rows, with a rate of absence and of duplicates, that are the same for the same seed.
Source: commons/data/sql/meaning/mod.ts
6 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.
Translationtypeno test imports ittype Translation =
| { readonly kind: "mapped"; readonly mappingId: string; readonly targetField: string; readonly targetValue: string | null; readonly relationshipType: string }
| { readonly kind: "unmapped" }
| { readonly kind: "ambiguous"; readonly mappingIds: readonly string[] };
What translating one source value found.
function translate(on: Runner, source: Source): Promise<Translation>
Translates one source value: by the approved mapping that holds at the time. Where two hold, it is ambiguous and nothing is chosen for the caller; where none does, it is unmapped.
Imported by 6 tests of the run (6 passed, 0 failed): the library's results
Coverageinterfaceno test imports itinterface Coverage
How much of what was observed a field's mappings cover.
| Member | Type | What it is |
|---|
observed | number | How many observations there were, with repeats. |
mapped | number | How many of them a mapping covers. |
share | number | The share covered, 1 where nothing was observed. |
unmapped | readonly { readonly value: string; readonly seen: number; }[] | The values nothing maps, with how many times each was seen, the most seen first. |
function coverage(on: Runner, system: string, field: string, observed: Iterable<string | null | undefined>, asOf?: string | Date): Promise<Coverage>
Says which of the values observed in a field a mapping does not cover, as the mapping of the book's mapping-coverage check.
Imported by 6 tests of the run (6 passed, 0 failed): the library's results
Resolvedtypeno test imports ittype Resolved =
| { readonly kind: "present"; readonly value: string }
| { readonly kind: "absent"; readonly absence: string }
| { readonly kind: "defaulted"; readonly value: string; readonly absence: string | null }
| { readonly kind: "rejected"; readonly why: string };
What a rule says of one value.
NullRuleRowinterfaceno test imports itinterface NullRuleRow
A null rule as a row of the table gives it.
| Member | Type | What it is |
|---|
policy | "allow_absent" | "default_to" | "reject" | |
absence? | string | null | |
defaultValue? | string | null | |
isMissingconstno test imports itconst isMissing: (v: unknown) => boolean
Whether a value is missing: null, undefined or only spaces.
function ruleOf(on: Runner, subject: string): Promise<NullRuleRow | undefined>
Reads the rule of a table and column, none where it has none.
Imported by 6 tests of the run (6 passed, 0 failed): the library's results
DueVarianceinterfaceno test imports itinterface DueVariance
A variance that is still accepted past its date, or that was never decided.
| Member | Type | What it is |
|---|
varianceId | string | |
subject | string | |
status | string | |
expiresAt | string | null | |
why | "expired" | "undecided" | |
function dueVariances(on: Runner, asOf?: string | Date): Promise<readonly DueVariance[]>
Finds the variances that need a decision: accepted and past their date, and open ones, which nobody has decided.
Imported by 6 tests of the run (6 passed, 0 failed): the library's results
ColumnProfileinterfaceno test imports itinterface ColumnProfile
What profiling one column found: counts only, never the values it holds beyond the lowest and highest.
| Member | Type | What it is |
|---|
column | string | |
rows | number | |
nulls | number | |
distinct | number | |
min | unknown | |
max | unknown | |
function profile(on: Runner, table: Table<never, never, string>, columns: readonly string[]): Promise<readonly ColumnProfile[]>
Profiles columns of a table with counts, as one query for each: how many rows, how many null, how many distinct, and the lowest and highest.
Imported by 6 tests of the run (6 passed, 0 failed): the library's results
randomfunctionno test imports itfunction random(seed: number): () => number
The seeded pseudo-random source: the same seed makes the same numbers, on every engine.
SyntheticColumninterfaceno test imports itinterface SyntheticColumn
A column of synthetic rows.
| Member | Type | What it is |
|---|
make | Generator | |
absent? | number | The share of rows where it is missing, 0 where not given. |
SyntheticSpecinterfaceno test imports itinterface SyntheticSpec
What is asked of the generator.
| Member | Type | What it is |
|---|
seed | number | |
rows | number | |
columns | Readonly<Record<string, SyntheticColumn>> | |
duplicates? | number | The share of rows that repeat an earlier row, to make duplicates on purpose. |
function synthetic(spec: SyntheticSpec): Record<string, string | number | null>[]
Makes synthetic rows: they hold no real person's data, and the same spec makes the same rows.
Imported by 6 tests of the run (6 passed, 0 failed): the library's results