Skip to content

Type Alias: VocabularySourceItem

@kortexya/reasoninglayer


@kortexya/reasoninglayer / VocabularySourceItem

VocabularySourceItem = { coordinates: VocabularyImportCoordinates; item: "statement"; object: VocabularySourceTerm; predicate: string; subject: VocabularySourceTerm; } | { cells: Record<string, string>; coordinates: VocabularyImportCoordinates; formulas: string[]; item: "row"; } | { coordinates: VocabularyImportCoordinates; item: "record"; record: JsonValue; } | { coordinates: VocabularyImportCoordinates; item: "rejected"; message: string; reason: string; }

Defined in: src/types/vocabulary.ts:5737

One item of an import as read, before any interpretation.

{ coordinates: VocabularyImportCoordinates; item: "statement"; object: VocabularySourceTerm; predicate: string; subject: VocabularySourceTerm; }

coordinates: VocabularyImportCoordinates

Where it is.

item: "statement"

Discriminator: one RDF statement.

object: VocabularySourceTerm

The object.

predicate: string

The predicate IRI.

subject: VocabularySourceTerm

The subject (an IRI or a blank node).


{ cells: Record<string, string>; coordinates: VocabularyImportCoordinates; formulas: string[]; item: "row"; }

cells: Record<string, string>

The non-empty cells, by column letter (A, B, …).

coordinates: VocabularyImportCoordinates

Where it is.

formulas: string[]

The columns whose value is a formula’s cached value (never evaluated).

item: "row"

Discriminator: one table row.


{ coordinates: VocabularyImportCoordinates; item: "record"; record: JsonValue; }

coordinates: VocabularyImportCoordinates

Where it is.

item: "record"

Discriminator: one record of a kos-json/v1 document.

record: JsonValue

The record, exactly as exported.


{ coordinates: VocabularyImportCoordinates; item: "rejected"; message: string; reason: string; }

coordinates: VocabularyImportCoordinates

Where it is.

item: "rejected"

Discriminator: a part the parser could not read, or chose not to.

message: string

The explanation.

reason: string

The reason code (syntax_error, invalid_utf8, macro_content_ignored, …).

Wire format: internally tagged by item. A row’s cells are keyed by column letter (data, kept verbatim). A record is one kos-json/v1 record exactly as the artefact holds it, so it stays an arbitrary JSON value.