Skip to content

Interface: DiscoveredFeatureDto

@kortexya/reasoninglayer


@kortexya/reasoninglayer / DiscoveredFeatureDto

Defined in: src/types/sources.ts:101

A feature/field discovered from a data source.

optional constraints?: DiscoveredConstraintDto[]

Defined in: src/types/sources.ts:103

Constraints discovered, each a typed value tagged by type.


optional description?: string | null

Defined in: src/types/sources.ts:105

Human-readable description.


featureName: string

Defined in: src/types/sources.ts:141

The OSF feature name — the engine’s own OSFQL-readable spelling.

Identical to name, and the unambiguous spelling of it. It is the counterpart of DiscoveredSortDto.sortName, so a client walking sorts and their features reads one convention for both.

Prefer it to deriving the name client-side: the derivation has to agree with an engine that refuses a name its parser cannot read bare.


optional identifierProvenance?: KeyProvenanceDto | null

Defined in: src/types/sources.ts:160

Which authority made this field the identifier, and what that key therefore guarantees. Present exactly when isIdentifier.

⚠️ Read this before you pre-tick a “key” box for an operator. isIdentifier alone does not separate a DECLARED primary key from a GUESS: source: 'sampled_uniqueness' with guaranteedUnique: false means every value in the SAMPLED rows was distinct and nothing beyond the sample was checked.

The distinction is not cosmetic. A projected fact derives its term identity from the key, so a key that turns out not to be unique makes a re-ingest DUPLICATE facts instead of updating them. Without the provenance there is no way to present the guess as a guess — KeyProvenanceDto.explanation is the engine’s own sentence for it, written for an operator who does not know the vocabulary.


isIdentifier: boolean

Defined in: src/types/sources.ts:117

Whether the field is a primary key/identifier.

For a CSV type at most one column is nominated, by sampled uniqueness (identifierProvenance.source === 'sampled_uniqueness'), and none when fewer than 10 rows were sampled. A candidate must be key-shaped: an integer, or a string of at most 64 characters without whitespace. Ties go to id/_id, then <table>_id, then any *_id, then the leftmost column; the other sampled-distinct columns keep a unique constraint.


isRelation: boolean

Defined in: src/types/sources.ts:119

Whether the field is a relation.


name: string

Defined in: src/types/sources.ts:121

Feature name.


optional relationTarget?: string | null

Defined in: src/types/sources.ts:123

Target sort if this is a relation.


required: boolean

Defined in: src/types/sources.ts:125

Whether the field is required.


sourceName: string

Defined in: src/types/sources.ts:127

Original source field name.


optional typeHint?: string | null

Defined in: src/types/sources.ts:129

Type hint (e.g., “VARCHAR(255)”, “integer”, “boolean”).