types/ontology.types.ts

types/ontology.types.ts is a file in Bane's Lab Site. 197 lines of code and 23 definitions.

import type { DistinctView, EdgeRef, EdgeRelation } from "#types/link.types";
import type { CheckView } from "#types/reference.types";
import type { CoverageView } from "#types/coverage.types";
import type { GrammarView } from "#types/grammar.types";
import type { ReasonView } from "#types/reason.types";

export interface RowIdentity {
    readonly context: string;
    readonly id: string;
    readonly title: string;
}

export interface ExemplarView {
    readonly after: string;
    readonly before: string;
    readonly lang: string;
    readonly medium: string;
}

export interface PrincipleView {
    readonly aliases: readonly string[];
    readonly canon: readonly string[];
    readonly category: EdgeRef;
    readonly contracts: readonly EdgeRef[];
    readonly definition: string;
    readonly detectedBy: readonly EdgeRef[];
    readonly distinctFrom: readonly DistinctView[];
    readonly edges: Readonly<Record<EdgeRelation, readonly EdgeRef[]>>;
    readonly enforcedBy: readonly EdgeRef[];
    readonly exemplar: ExemplarView | null;
    readonly expressedBy: readonly EdgeRef[];
    readonly formedBy: string | null;
    readonly id: string;
    readonly kind: EdgeRef;
    readonly layer: EdgeRef | null;
    readonly mandatoryFor: string | null;
    readonly measuredBy: readonly EdgeRef[];
    readonly name: string;
    readonly refactoredBy: readonly EdgeRef[];
    readonly referencedBy: readonly EdgeRef[];
    readonly scope: readonly EdgeRef[];
    readonly severity: EdgeRef;
    readonly tensions: readonly EdgeRef[];
    readonly term: EdgeRef | null;
    readonly violatedBy: readonly EdgeRef[];
}

export interface PrincipleCategoryView {
    readonly category: string;
    readonly id: string;
    readonly principles: readonly PrincipleView[];
}

export interface TermView {
    readonly aliases: readonly string[];
    readonly category: EdgeRef;
    readonly contract: EdgeRef | null;
    readonly definition: string;
    readonly distinctFrom: readonly DistinctView[];
    readonly example: string | null;
    readonly exemplar: ExemplarView | null;
    readonly id: string;
    readonly kind: EdgeRef;
    readonly layer: EdgeRef | null;
    readonly name: string;
    readonly principle: EdgeRef | null;
    readonly referencedBy: readonly EdgeRef[];
}

export interface TermCategoryView {
    readonly category: string;
    readonly exampleShape: EdgeRef | null;
    readonly id: string;
    readonly terms: readonly TermView[];
}

export interface ProductionView {
    readonly lhs: string;
    readonly rhs: string;
}

export interface DerivationStepView {
    readonly record: EdgeRef;
    readonly stage: EdgeRef;
}

export interface ContractView {
    readonly axis: EdgeRef | null;
    readonly canon: readonly string[];
    readonly composedBy: readonly EdgeRef[];
    readonly composes: readonly EdgeRef[];
    readonly derivationMap: readonly DerivationStepView[];
    readonly derivedBy: readonly EdgeRef[];
    readonly detects: readonly EdgeRef[];
    readonly distinctFrom: readonly DistinctView[];
    readonly domain: EdgeRef;
    readonly exemplar: ExemplarView | null;
    readonly flow: readonly string[];
    readonly force: readonly EdgeRef[];
    readonly groundedBy: readonly EdgeRef[];
    readonly grounds: readonly EdgeRef[];
    readonly id: string;
    readonly intent: string;
    readonly invariant: string;
    readonly layer: EdgeRef | null;
    readonly mathType: EdgeRef | null;
    readonly meta: boolean;
    readonly principle: EdgeRef | null;
    readonly productions: readonly ProductionView[];
    readonly stage: EdgeRef | null;
    readonly tier: EdgeRef;
    readonly title: string;
    readonly yields: string | null;
}

export interface ContractDomainView {
    readonly contracts: readonly ContractView[];
    readonly domain: string;
    readonly id: string;
}

export interface LayerEdgeView {
    readonly from: EdgeRef;
    readonly kind: EdgeRef;
    readonly to: EdgeRef;
}

export interface LayerNodeView {
    readonly contract: EdgeRef;
    readonly id: string;
    readonly incoming: readonly LayerEdgeView[];
    readonly label: string;
    readonly members: readonly EdgeRef[];
    readonly outgoing: readonly LayerEdgeView[];
}

export interface MembershipView {
    readonly category: EdgeRef;
    readonly layer: EdgeRef | null;
}

export interface TensionView {
    readonly a: EdgeRef;
    readonly b: EdgeRef;
    readonly explicit: boolean;
    readonly id: string;
    readonly mechanism: EdgeRef;
    readonly rule: string;
    readonly scopeA: EdgeRef;
    readonly scopeB: EdgeRef;
}

export interface LayerView {
    readonly membership: readonly MembershipView[];
    readonly nodes: readonly LayerNodeView[];
    readonly resolutions: readonly TensionView[];
    readonly topology: readonly LayerEdgeView[];
}

export interface KindView {
    readonly definitionSignatures: readonly string[];
    readonly discriminator: string;
    readonly distinguishesFrom: string;
    readonly kind: string;
    readonly principles: number;
    readonly terms: number;
}

export interface RelationRangeView {
    readonly kinds: readonly EdgeRef[];
    readonly relation: string;
}

export interface ForceView {
    readonly concerns: readonly string[];
    readonly contracts: readonly EdgeRef[];
    readonly force: string;
    readonly id: string;
    readonly principles: readonly EdgeRef[];
}

export interface VocabularyEntryView {
    readonly definition: string;
    readonly records: readonly EdgeRef[];
    readonly value: string;
}

export interface VocabularyView {
    readonly entries: readonly VocabularyEntryView[];
    readonly id: string;
}

export interface RecordCheckEntryView {
    readonly answers: number;
    readonly by: readonly EdgeRef[];
    readonly dependsOn: readonly EdgeRef[];
    readonly shape: readonly EdgeRef[];
}

export interface ResolutionView {
    readonly answers: readonly CheckView[];
    readonly byRecord: Readonly<Record<string, RecordCheckEntryView>>;
    readonly coverage: readonly CoverageView[];
    readonly defects: number;
    readonly records: number;
}

export interface OntologySnapshot {
    readonly contracts: readonly ContractDomainView[];
    readonly forces: readonly ForceView[];
    readonly grammar: GrammarView;
    readonly kinds: readonly KindView[];
    readonly layers: LayerView;
    readonly principles: readonly PrincipleCategoryView[];
    readonly ranges: readonly RelationRangeView[];
    readonly reason: ReasonView;
    readonly resolution: ResolutionView;
    readonly terms: readonly TermCategoryView[];
    readonly vocabularies: readonly VocabularyView[];
}