# types/ontology.types.ts

> 188 lines of code and 25 definitions.

Tree: Site tree
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/tree#file-types-ontology-types-ts
Source text: https://banes-lab.com/assets/sources/source.4a30d02e05a648f25402168dbfb42c2d073d56cb346b1dc4ee41e384d11981c9.generated.txt

## Definitions

- `ExemplarView` (interface_declaration, line 4, exported)
- `PrincipleView` (interface_declaration, line 11, exported)
- `PrincipleCategoryView` (interface_declaration, line 33, exported)
- `TermView` (interface_declaration, line 39, exported)
- `TermCategoryView` (interface_declaration, line 52, exported)
- `ProductionView` (interface_declaration, line 58, exported)
- `DerivationStepView` (interface_declaration, line 63, exported)
- `ContractView` (interface_declaration, line 68, exported)
- `ContractDomainView` (interface_declaration, line 94, exported)
- `LayerNodeView` (interface_declaration, line 100, exported)
- `LayerEdgeView` (interface_declaration, line 107, exported)
- `MembershipView` (interface_declaration, line 113, exported)
- `TensionView` (interface_declaration, line 118, exported)
- `LayerView` (interface_declaration, line 129, exported)
- `KindView` (interface_declaration, line 136, exported)
- `RelationRangeView` (interface_declaration, line 145, exported)
- `ForceView` (interface_declaration, line 150, exported)
- `KeywordView` (interface_declaration, line 158, exported)
- `KeywordCategoryView` (interface_declaration, line 165, exported)
- `GrammarProductionView` (interface_declaration, line 170, exported)
- `ProductionGroupView` (interface_declaration, line 176, exported)
- `DocumentTypeView` (interface_declaration, line 181, exported)
- `TemplateView` (interface_declaration, line 188, exported)
- `GrammarView` (interface_declaration, line 195, exported)
- `OntologySnapshot` (interface_declaration, line 202, exported)

## Source

```typescript
import type { EdgeRef, EdgeRelation } from "#types/link.types";
import type { ReasonView } from "#types/reason.types";

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

export interface PrincipleView {
    readonly aliases: readonly string[];
    readonly category: EdgeRef;
    readonly contracts: readonly EdgeRef[];
    readonly detectedBy: readonly EdgeRef[];
    readonly edges: Readonly<Record<EdgeRelation, readonly EdgeRef[]>>;
    readonly enforcedBy: readonly EdgeRef[];
    readonly exemplar: ExemplarView | null;
    readonly id: string;
    readonly kind: EdgeRef;
    readonly layer: EdgeRef | null;
    readonly measuredBy: readonly EdgeRef[];
    readonly name: string;
    readonly refactoredBy: readonly EdgeRef[];
    readonly referencedBy: readonly EdgeRef[];
    readonly scope: readonly EdgeRef[];
    readonly severity: string;
    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 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 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 composedBy: readonly EdgeRef[];
    readonly composes: readonly EdgeRef[];
    readonly derivationMap: readonly DerivationStepView[];
    readonly derivedBy: readonly EdgeRef[];
    readonly detects: readonly EdgeRef[];
    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 title: string;
    readonly yields: string | null;
}

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

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

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

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: string;
    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 KeywordView {
    readonly example: string;
    readonly grounds: readonly string[];
    readonly meaning: string;
    readonly name: string;
}

export interface KeywordCategoryView {
    readonly category: string;
    readonly keywords: readonly KeywordView[];
}

export interface GrammarProductionView {
    readonly grounds: readonly string[];
    readonly lhs: string;
    readonly rhs: string;
}

export interface ProductionGroupView {
    readonly group: string;
    readonly productions: readonly GrammarProductionView[];
}

export interface DocumentTypeView {
    readonly defaultVerb: string;
    readonly purpose: string;
    readonly type: string;
    readonly verbs: readonly string[];
}

export interface TemplateView {
    readonly body: string;
    readonly constraints: readonly string[];
    readonly title: string;
    readonly type: string;
}

export interface GrammarView {
    readonly categories: readonly KeywordCategoryView[];
    readonly documentTypes: readonly DocumentTypeView[];
    readonly groups: readonly ProductionGroupView[];
    readonly templates: readonly TemplateView[];
}

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 resolves: boolean;
    readonly terms: readonly TermCategoryView[];
}
```
