Kleinrat/frictionless/src/core does not have a README file

    BooleanTokens

    pub(all) struct BooleanTokens {
    truthy : Array[String]
    falsy : Array[String]
    } derive(
    Debug
    )

    Cell

    pub(all) enum Cell {
    Missing
    TextValue(String)
    IntegerValue(Int64)
    BigIntegerValue(
    BigInt
    )
    NumberValue(Double)
    ExactNumberValue(ExactDecimal)
    SpecialNumber(String)
    BooleanValue(Bool)
    StructuredValue(String)
    TemporalValue(String)
    } derive(Eq, Hash,
    Debug
    )

    CsvChangedRow

    pub(all) struct CsvChangedRow {
    key : Array[String]
    old_lines : (Int, Int)
    new_lines : (Int, Int)
    fields : Array[CsvFieldChange]
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    CsvDialect

    pub(all) struct CsvDialect {
    delimiter : Char
    quote_char : Char
    } derive(Eq,
    Debug
    )

    CsvDialect::supported

    fn CsvDialect::supported(self : CsvDialect) -> Bool

    CsvFieldChange

    pub(all) struct CsvFieldChange {
    field : String
    before : String
    after : String
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    CsvKeyConflict

    pub(all) struct CsvKeyConflict {
    key : Array[String]
    reason : String
    old_lines : Array[(Int, Int)]
    new_lines : Array[(Int, Int)]
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    CsvSnapshotRow

    pub(all) struct CsvSnapshotRow {
    key : Array[String]
    lines : (Int, Int)
    values : Map[String, String]
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    CsvVersionDiff

    pub(all) struct CsvVersionDiff {
    old_rows : Int
    new_rows : Int
    columns_added : Array[String]
    columns_removed : Array[String]
    added : Array[CsvSnapshotRow]
    removed : Array[CsvSnapshotRow]
    changed : Array[CsvChangedRow]
    unchanged : Int
    conflicts : Array[CsvKeyConflict]
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    CsvVersionDiff::is_clean

    fn CsvVersionDiff::is_clean(self : CsvVersionDiff) -> Bool

    DataPackage

    pub(all) struct DataPackage {
    original :
    Json

    resources : Array[DataResource]
    } derive(
    Debug
    )

    General Data Package descriptor, independent of the tabular validation API. Original descriptors retain extension properties and exact JSON number literals.

    DataPackage::custom_profiles

    fn DataPackage::custom_profiles(self : DataPackage) -> Array[String]

    Return the custom profiles declared by this Data Package and its resources. The strings are profile identifiers or fully qualified schema URLs.

    DataPackage::validate_profiles

    fn DataPackage::validate_profiles(self : DataPackage, schemas : Map[String,
    Json
    ]) -> Array[Diagnostic]

    Validate the original package and resource descriptors against supplied custom JSON Schema documents. Keys are registry identifiers or schema URLs. External references resolve only from the supplied documents. Unavailable profile schemas and invalid descriptors produce scoped diagnostics.

    DataResource

    pub(all) struct DataResource {
    name : String
    location : ResourceLocation
    metadata :
    Json

    } derive(
    Debug
    )

    DataResource::read

    fn DataResource::read(self : DataResource, read_local : (String) -> Result[Bytes, String], read_remote : (String) -> Result[Bytes, String], max_bytes? : Int) -> Result[ResourceContent, String]

    Resolve a resource with caller-supplied I/O. The host provides the package root for local paths and decides which URLs it trusts. File parts are read in descriptor order and returned as one byte sequence.

    DataResource::resolve_schema

    fn DataResource::resolve_schema(self : DataResource, read_local : (String) -> Result[Bytes, String], read_remote : (String) -> Result[Bytes, String]) -> Result[
    Json
    ?, String]

    Resolve the optional schema using the same host-controlled I/O as resources.

    Descriptor

    pub(all) struct Descriptor {
    original :
    Json

    resources : Array[Resource]
    } derive(
    Debug
    )

    Descriptor::csv_dialect

    fn Descriptor::csv_dialect(self : Descriptor, name : String) -> Result[CsvDialect, String]

    Look up the resource's delimiter and quote character. For extended dialects use csv_settings, which also retains escape and record-processing options.

    Descriptor::csv_settings

    fn Descriptor::csv_settings(self : Descriptor, name : String) -> Result[TabularCsvSettings, String]

    Read all resolved dialect settings for a resource, including quote escaping.

    Diagnostic

    pub(all) struct Diagnostic {
    code : String
    resource : String
    row : Int
    field : String
    message : String
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    ErrorSample

    type ErrorSample

    ExactDecimal

    pub(all) struct ExactDecimal {
    negative : Bool
    digits : String
    exponent :
    BigInt

    } derive(Eq, Hash,
    Debug
    )

    ExternalKeyCursor

    pub struct ExternalKeyCursor {
    // private fields
    }

    ExternalKeyCursor::feed

    fn ExternalKeyCursor::feed(self : ExternalKeyCursor, line : String, report : (Int, ExternalLocation, ExternalLocation?) -> Unit) -> Unit

    All references sort before probes for one key. Even a hot key needs one previous location. The callback receives rule id, location and first duplicate location.

    ExternalKeyCursor::new

    ExternalLocation

    pub(all) struct ExternalLocation {
    row : Int
    file : Int
    start_line : Int
    end_line : Int
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    The row is one-based across shards; line numbers are one-based within file.

    ExternalPlan

    pub struct ExternalPlan {
    resources : Array[Resource]
    rules : Array[ExternalRule]
    // private fields
    }

    ExternalPlan::feed

    fn ExternalPlan::feed(self : ExternalPlan, table : Int, values : Array[String], missing : Array[String], location : ExternalLocation, emit : (String) -> Unit, diagnose : (Int, Diagnostic) -> Unit) -> Unit

    Feed one physical row. A host sorts emitted lines, merges its disk runs and supplies them to ExternalKeyCursor. Emitters must preserve each line verbatim.

    ExternalPlan::new

    Compile typed projections once, sharing target events across incoming keys.

    ExternalRule

    pub(all) struct ExternalRule {
    code : String
    resource : String
    target : String
    field : String
    } derive(
    ToJson
    )

    One diagnostic class. A foreign key depends on two field-valid resources.

    ExternalRun

    pub struct ExternalRun {
    // private fields
    }

    ExternalRun::add

    fn ExternalRun::add(self : ExternalRun, line : String) -> Unit

    ExternalRun::flush

    fn ExternalRun::flush(self : ExternalRun, write : (String) -> Unit) -> Unit

    ExternalRun::new

    Field

    pub(all) struct Field {
    name : String
    kind : FieldType
    format : String
    boolean_tokens : BooleanTokens?
    numeric_format : NumericFormat?
    required : Bool
    enum_values : Array[Cell]?
    unique : Bool
    minimum : Double?
    maximum : Double?
    min_length : Int?
    max_length : Int?
    pattern : FieldPattern?
    decimal_minimum : ExactDecimal?
    decimal_maximum : ExactDecimal?
    exact_minimum :
    BigInt
    ?
    exact_maximum :
    BigInt
    ?
    temporal_minimum : String?
    temporal_maximum : String?
    } derive(
    Debug
    )

    FieldPattern

    pub struct FieldPattern {
    source : String
    matcher :
    Regex

    } derive(
    Debug
    )

    FieldType

    pub(all) enum FieldType {
    Text
    Integer
    Number
    Boolean
    ObjectValueType
    ArrayValueType
    Any
    Date
    Time
    DateTime
    Year
    YearMonth
    Duration
    GeoPoint
    GeoJson
    } derive(Eq,
    Debug
    )

    ForeignKey

    pub(all) struct ForeignKey {
    fields : Array[String]
    resource : String
    reference_fields : Array[String]
    } derive(
    Debug
    )

    ForeignKeyIndex

    pub struct ForeignKeyIndex {
    // private fields
    }

    A snapshot of a validated reference table, keyed by ordered, typed cells. Build again after changing reference rows. Source tables can be checked in batches.

    ForeignKeyIndex::new

    fn ForeignKeyIndex::new(reference : Table, fields : Array[String]) -> Result[ForeignKeyIndex, Diagnostic]

    ForeignKeyIndex::validate

    fn ForeignKeyIndex::validate(self : ForeignKeyIndex, table : Table, fields : Array[String]) -> Array[Diagnostic]

    GroupCountAccumulator

    pub struct GroupCountAccumulator {
    // private fields
    }

    One pass over a snapshot. Only exact text keys and their counts survive a feed.

    GroupCountAccumulator::feed

    fn GroupCountAccumulator::feed(self : GroupCountAccumulator, row : Array[String], start_line? : Int, end_line? : Int) -> Result[Unit, String]

    Feed one decoded data record. A failure invalidates the snapshot, even if a caller ignores the return value. Optional physical lines include the header.

    GroupCountAccumulator::new

    fn GroupCountAccumulator::new(resource : String, header : Array[String], group_by : Array[String]) -> Result[GroupCountAccumulator, String]

    GroupCountChange

    pub(all) struct GroupCountChange {
    key : Array[String]
    kind : String
    old_count : Int
    new_count : Int
    delta : Int
    alert : Bool
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    GroupCountReport

    pub(all) struct GroupCountReport {
    group_by : Array[String]
    min_loss : Int
    min_percent : Int
    old_rows : Int
    new_rows : Int
    old_groups : Int
    new_groups : Int
    unchanged_groups : Int
    alert_count : Int
    changes : Array[GroupCountChange]
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    GroupCountReport::is_clean

    fn GroupCountReport::is_clean(self : GroupCountReport) -> Bool

    ImpactExample

    pub(all) struct ImpactExample {
    diagnostic : Diagnostic
    lines : (Int, Int)?
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    ImpactSummary

    pub(all) struct ImpactSummary {
    rows : Int
    accepted_by_both : Int
    invalid_in_both : Int
    newly_invalid : Int
    newly_valid : Int
    regressions : Array[ImpactExample]
    recoveries : Array[ImpactExample]
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    Counts classify distinct records. Each sample contains a diagnostic from the rejecting schema.

    InferenceHint

    pub(all) struct InferenceHint {
    field : String
    message : String
    } derive(
    Debug
    ,
    ToJson
    )

    InputTable

    pub(all) struct InputTable {
    name : String
    header : Array[String]
    rows : Array[Array[String]]
    } derive(
    Debug
    )

    JsonInputTable

    pub(all) struct JsonInputTable {
    name : String
    mode : JsonRowMode
    rows : Array[
    Json
    ]
    } derive(
    Debug
    )

    Batch JSON input for one table.

    The top-level JSON value is an array. Every element must be either an array of values in schema field order, or an object keyed by field name. Mixed arrays and objects are rejected at input parsing time.

    JsonRowMode

    pub(all) enum JsonRowMode {
    ArrayRows
    ObjectRows
    } derive(
    Debug
    )

    LookupExample

    pub(all) struct LookupExample {
    key : Array[String]
    lines : (Int, Int)
    master_lines : Array[(Int, Int)]
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    LookupGroup

    pub(all) struct LookupGroup {
    count : Int
    examples : Array[LookupExample]
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    LookupPreview

    pub(all) struct LookupPreview {
    examples : Array[Array[String]]
    whitespace_rows : Int
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    LookupReport

    pub(all) struct LookupReport {
    master_rows : Int
    detail_rows : Int
    matched : Int
    missing_reference : LookupGroup
    ambiguous_reference : LookupGroup
    empty_reference : LookupGroup
    duplicate_master : LookupGroup
    empty_master : LookupGroup
    unused_master_keys : LookupGroup
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    LookupReport::is_clean

    fn LookupReport::is_clean(self : LookupReport) -> Bool

    LookupTable

    pub struct LookupTable {
    // private fields
    }

    In-memory CSV with positions of data records. Header access returns a copy.

    LookupTable::columns

    fn LookupTable::columns(self : LookupTable) -> Array[String]

    LookupTable::from_csv

    fn LookupTable::from_csv(name : String, csv : String) -> Result[LookupTable, String]

    LookupTable::preview_keys

    fn LookupTable::preview_keys(self : LookupTable, columns : Array[String]) -> Result[LookupPreview, String]

    Inspect original identifiers before choosing how to compare them.

    NumericFormat

    pub(all) struct NumericFormat {
    bare : Bool
    decimal : String
    group : String?
    } derive(
    Debug
    )

    PackageReport

    pub(all) struct PackageReport {
    tables : Array[Table]
    errors : Array[Diagnostic]
    } derive(
    Debug
    )

    PackageReport::valid

    fn PackageReport::valid(self : PackageReport) -> Bool

    Projection

    type Projection

    ReferenceChange

    pub(all) struct ReferenceChange {
    key : Array[String]
    reason : String
    old_reference : Array[String]?
    new_reference : Array[String]?
    old_child_lines : (Int, Int)?
    new_child_lines : (Int, Int)?
    old_parent_lines : Array[(Int, Int)]
    new_parent_lines : Array[(Int, Int)]
    old_status : String
    new_status : String
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    ReferenceImpact

    pub(all) struct ReferenceImpact {
    findings : Array[ReferenceChange]
    child_conflicts : Array[CsvKeyConflict]
    parent_conflicts : Array[CsvKeyConflict]
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    ReferenceImpact::is_clean

    fn ReferenceImpact::is_clean(self : ReferenceImpact) -> Bool

    Empty foreign keys carry no reference. Ambiguous or missing current references and ambiguous/incomplete source identities require review.

    RelationshipReport

    pub(all) struct RelationshipReport {
    errors : Array[Diagnostic]
    work : RelationshipWork
    }

    RelationshipWork

    pub(all) struct RelationshipWork {
    indexes_built : Int
    index_rows : Int64
    source_rows : Int64
    probe_rows : Int64
    checked_rules : Int
    skipped_rules : Int
    } derive(Eq,
    Debug
    ,
    ToJson
    )

    Resource

    pub(all) struct Resource {
    name : String
    path : String
    fields : Array[Field]
    missing_values : Array[String]
    primary_key : Array[String]
    foreign_keys : Array[ForeignKey]
    row_rules : Array[RowRule]
    } derive(
    Debug
    )

    ResourceContent

    pub(all) enum ResourceContent {
    FileBytes(Bytes)
    InlineValue(
    Json
    )
    } derive(
    Debug
    )

    ResourceLocation

    pub(all) enum ResourceLocation {
    LocalPaths(Array[String])
    RemoteUrls(Array[String])
    InlineData(
    Json
    )
    } derive(
    Debug
    )

    RowRule

    pub(all) struct RowRule {
    left : String
    op : RowRuleOp
    right : String
    } derive(Eq,
    Debug
    )

    A comparison of two numeric fields on the same logical row.

    RowRuleOp

    pub(all) enum RowRuleOp {
    Less
    LessEqual
    Equal
    } derive(Eq,
    Debug
    )

    RowSummary

    pub(all) struct RowSummary {
    rows : Int
    error_count : Int64
    errors : Array[Diagnostic]
    }

    RowValidator

    pub struct RowValidator {
    // private fields
    }

    RowValidator::current_row_sampled

    fn RowValidator::current_row_sampled(self : RowValidator) -> Bool

    True when a retained diagnostic refers to the most recently fed row. Hosts can retain metadata for sampled rows without indexing the whole stream.

    RowValidator::feed

    fn RowValidator::feed(self : RowValidator, row : Array[String]) -> Unit

    RowValidator::feed_json

    fn RowValidator::feed_json(self : RowValidator, row :
    Json
    ) -> Unit

    RowValidator::finish

    fn RowValidator::finish(self : RowValidator) -> RowSummary

    A detached snapshot. Repeated calls do not consume or reset validation state.

    RowValidator::new

    fn RowValidator::new(name : String, schema : TableSchema, header : Array[String], max_errors? : Int) -> Result[RowValidator, Array[Diagnostic]]

    Accepts decoded records. All foreign keys require batch validation.

    SchemaChange

    pub(all) struct SchemaChange {
    field : String
    rule : String
    impact : String
    before :
    Json

    after :
    Json

    members : Array[
    Json
    ]?
    } derive(
    Debug
    ,
    ToJson
    )

    SchemaImpact

    pub struct SchemaImpact {
    // private fields
    }

    SchemaImpact::feed

    fn SchemaImpact::feed(self : SchemaImpact, row : Array[String], lines? : (Int, Int)) -> Unit

    Feed a decoded record once. Optional physical lines come from the caller's CSV decoder.

    SchemaImpact::finish

    Return an independent snapshot with the same key-error precedence as batch validation.

    SchemaImpact::first_occurrence_lines

    fn SchemaImpact::first_occurrence_lines(self : SchemaImpact, row : Int) -> (Int, Int)?

    First physical CSV lines for a sampled duplicate record in the current impact report. Absent for other diagnostics and when the caller supplied no first span.

    SchemaImpact::new

    fn SchemaImpact::new(name : String, before : TableSchema, after : TableSchema, header : Array[String], max_examples? : Int) -> Result[SchemaImpact, Array[Diagnostic]]

    SchemaInference

    pub(all) struct SchemaInference {
    schema : TableSchema
    sampled_rows : Int
    total_rows : Int
    hints : Array[InferenceHint]
    } derive(
    Debug
    )

    Result of a conservative CSV sample inference. The schema is only a draft: it never contains required/unique/primary-key guesses and never rewrites the source data.

    SnapshotPlan

    pub struct SnapshotPlan {
    resources : Array[Resource]
    target : Int
    sources : Array[Int]
    // private fields
    }

    A reusable contract for one ordered reference key and its incoming foreign keys. Hosts persist the opaque keys. The storage format must version their encoding.

    SnapshotPlan::new

    fn SnapshotPlan::new(descriptor : Descriptor, target : String, fields : Array[String]) -> Result[SnapshotPlan, Array[Diagnostic]]

    SnapshotPlan::project

    fn SnapshotPlan::project(self : SnapshotPlan, table : Int, reference : Bool, values : Array[String], missing : Array[String], row : Int, emit : (String, String) -> Unit, diagnose : (Diagnostic) -> Unit) -> Unit

    Emit an opaque typed key for a target row or each applicable incoming rule. Missing components do not participate. The storage host receives no raw cells.

    Table

    pub(all) struct Table {
    name : String
    fields : Array[Field]
    rows : Array[Array[Cell]]
    } derive(
    Debug
    )

    TableReport

    pub(all) struct TableReport {
    table : Table
    errors : Array[Diagnostic]
    } derive(
    Debug
    )

    TableReport::valid

    fn TableReport::valid(self : TableReport) -> Bool

    TableSchema

    pub(all) struct TableSchema {
    fields : Array[Field]
    missing_values : Array[String]
    primary_key : Array[String]
    foreign_keys : Array[ForeignKey]
    row_rules : Array[RowRule]
    } derive(
    Debug
    )

    A parsed Table Schema that can be used without wrapping it in a Data Package. The field, constraint, primary-key and diagnostics semantics are shared with the package reader: parse_descriptor stores the same values on Resource.

    TableSchema::validate

    fn TableSchema::validate(self : TableSchema, name : String, header : Array[String], rows : Array[Array[String]], missing_values? : Array[String]?) -> TableReport

    Convenience method form for embedding consumers.

    TableSchema::validate_json

    fn TableSchema::validate_json(self : TableSchema, name : String, input : JsonInputTable) -> TableReport

    Validate a parsed JSON batch against this standalone Table Schema, including primary-key and self-reference rules. Cross-table foreign keys still report foreign-key-scope.

    TabularCsvSettings

    pub struct TabularCsvSettings {
    dialect : CsvDialect
    escape : Char?
    double_quote : Bool
    header : Bool
    null_sequence : String?
    comment : Char?
    skip_space : Bool
    case_sensitive : Bool
    }

    TabularCsvSettings::decode

    fn TabularCsvSettings::decode(self : TabularCsvSettings, name : String, text : String) -> Result[InputTable, String]

    Decode physical CSV records, exposing the first record as InputTable.header. Package validation applies schema headers and headerless-resource policy.

    TabularCsvSettings::matches_header

    fn TabularCsvSettings::matches_header(self : TabularCsvSettings, header : Array[String], names : Array[String]) -> Bool

    TabularCsvSettings::missing_values

    fn TabularCsvSettings::missing_values(self : TabularCsvSettings, values : Array[String]) -> Array[String]

    TabularResourceInput

    pub(all) struct TabularResourceInput {
    name : String
    parts : Array[String]
    } derive(
    Debug
    ,
    FromJson
    )

    Text chunks for one CSV or JSON table. Inline data is already in the descriptor.

    ValidationPlan

    pub struct ValidationPlan {
    // private fields
    }

    A schema-only relationship schedule. It can be reused for new batches. All target indexes are scoped to one execution.

    ValidationPlan::estimate

    fn ValidationPlan::estimate(self : ValidationPlan, row_counts : Map[String, Int]) -> Result[RelationshipWork, String]

    Predict target row visits and per-rule source row visits, given valid tables. Counts are logical work units independent of data distribution and hardware.

    ValidationPlan::explain

    Dependency-first components and the declared pairings served by each index.

    ValidationPlan::new

    ValidationPlan::validate

    fn ValidationPlan::validate(self : ValidationPlan, tables : Array[Table]) -> RelationshipReport

    Run on already field-validated logical tables, in any input order. Key definitions are frozen in the plan; each call uses the current table rows.

    cast_cell

    fn cast_cell(raw : String, kind : FieldType, missing_values : Array[String]) -> Result[Cell, String]

    Convert text using the default format for the declared field type. Missing markers are matched exactly, before casting; whitespace is preserved.

    cast_json_cell

    fn cast_json_cell(value :
    Json
    , kind : FieldType, missing_values : Array[String]) -> Result[Cell, String]

    Convert a JSON value using the default format for the declared type. Native structures are accepted for object, array and GeoJSON fields. Numbers retain their exact source literals when the JSON parser provides them. Null and configured string markers are matched before type conversion.

    compare_csv_versions

    fn compare_csv_versions(old : LookupTable, current : LookupTable, keys : Array[String]) -> Result[CsvVersionDiff, String]

    Compare two UTF-8 CSV snapshots by exact textual key components. Non-key cells are aligned by column name. Added and removed columns are reported separately.

    compare_group_counts

    fn compare_group_counts(before : GroupCountAccumulator, after : GroupCountAccumulator, min_loss? : Int, min_percent? : Int) -> Result[GroupCountReport, String]

    Compare two complete group-count snapshots. Percentage thresholds are inclusive and relative to the old count. Losses under either threshold remain in changes.

    compare_reference_impact

    fn compare_reference_impact(old_parent : LookupTable, new_parent : LookupTable, old_child : LookupTable, new_child : LookupTable, parent_key : Array[String], child_key : Array[String], references : Array[String]) -> Result[ReferenceImpact, String]

    Compare one foreign-key relationship across two snapshots. Each child record needs a stable unique identity separate from the foreign key. Attribute a new failure to a target deletion only when the same child kept the same reference and a previously unique target disappeared.

    compare_temporal

    fn compare_temporal(type_name : String, left : String, right : String) -> Int

    Compare two values that were already returned by normalize_temporal. Dates use chronological lexicographic order. Years compare as signed magnitudes and clocks compare the second prefix before the fraction. For incomparable periods this legacy sort function breaks ties lexically. Use temporal_order for constraints or comparisons that must expose incomparability.

    compile_field_pattern

    fn compile_field_pattern(source : String) -> Result[FieldPattern, String]

    diff_table_schemas

    fn diff_table_schemas(old : TableSchema, current : TableSchema) -> Array[SchemaChange]

    Compare parsed standalone schemas. Direction is local to an individual rule.

    encode_csv_record

    fn encode_csv_record(fields : Array[String]) -> String

    Encode one record using commas, doubled quotes, and a CRLF terminator. An empty field list emits no record. A singleton empty field emits a quoted empty string, distinct from an empty file or a skipped blank line.

    field

    fn field(name : String, kind : FieldType) -> Field

    infer_table_schema

    fn infer_table_schema(header : Array[String], rows : Array[Array[String]], sample_limit? : Int, missing_values? : Array[String]) -> SchemaInference

    Infer a draft Table Schema from the first sample_limit rows.

    The inference is deliberately conservative:
    • an empty sample, or a column whose non-missing values conflict, falls back to string;
    • integer-looking identifiers with leading zeroes fall back to string;
    • only the default true/false words become boolean; 0/1 stays integer with a hint because the intent is ambiguous;
    • no required/unique/primary-key constraint is guessed.

    input_from_csv

    fn input_from_csv(name : String, text : String, dialect? : CsvDialect) -> Result[InputTable, String]

    Strict quote framing in front of the reusable CSV parser, which otherwise accepts malformed quotes. UTF-8 decoding is the host's responsibility.

    input_from_json

    fn input_from_json(name : String, text : String) -> Result[JsonInputTable, String]

    Parse a JSON array of rows without converting values to strings.

    kind_label

    fn kind_label(kind : FieldType) -> String

    merge_external_runs

    fn merge_external_runs(count : Int, read : (Int) -> String, write : (String) -> Unit) -> Unit

    Merge a bounded number of sorted inputs; the empty string marks end of a run.

    normalize_temporal

    fn normalize_temporal(type_name : String, raw : String) -> Result[String, String]

    Normalize one Table Schema v1 default-format temporal value. Returns Err for unsupported type names, malformed formats, impossible calendar dates/clocks and out-of-range results of offset normalization.

    normalize_temporal_format

    fn normalize_temporal_format(type_name : String, raw : String, format : String) -> Result[String, String]

    Normalize one Table Schema v1 temporal value with a supported format.

    Supports calendar, ordinal, week-date, 12/24-hour and timezone patterns. Formats use the C locale and %Z accepts UTC or GMT. Unknown directives, duplicate components and non-ASCII literal text are rejected. %y uses the POSIX 69/68 pivot; %f accepts one to six fractional digits and trims trailing zeroes. %z accepts seconds and fractional seconds. A datetime pattern without a zone is interpreted as UTC. any accepts only a small documented unambiguous set, never a guessed day/month order.

    parse_data_package

    fn parse_data_package(text : String) -> Result[DataPackage, Array[Diagnostic]]

    Parse the general v1 descriptor and classify each locator without loading it.

    parse_descriptor

    fn parse_descriptor(text : String) -> Result[Descriptor, Array[Diagnostic]]

    Parse the documented local tabular subset, preserving original metadata for export.

    parse_mixed_descriptor

    fn parse_mixed_descriptor(text : String) -> Result[Descriptor, Array[Diagnostic]]

    Parse CSV/JSON tabular rules over a general v1 manifest.

    parse_profiled_mixed_descriptor

    fn parse_profiled_mixed_descriptor(text : String, profile_schemas : Map[String,
    Json
    ], resolved_documents : Map[String,
    Json
    ]) -> Result[Descriptor, Array[Diagnostic]]

    Validate profile schemas against the original manifest before evaluating Table Schemas and dialects supplied by the host under their locator keys.

    parse_table_schema

    fn parse_table_schema(text : String) -> Result[TableSchema, Array[Diagnostic]]

    Parse a standalone Table Schema descriptor.

    This is deliberately the same supported subset as an inline resource schema. Unknown top-level metadata is preserved by the caller if needed, but is not interpreted here. Cross-table foreign keys are accepted structurally; a single-table validation reports them explicitly instead of resolving them.

    parse_tabular_csv_settings

    fn parse_tabular_csv_settings(value :
    Json
    ) -> Result[TabularCsvSettings, String]

    reconcile_issue_csv

    fn reconcile_issue_csv(master : LookupTable, master_columns : Array[String], detail : LookupTable, detail_columns : Array[String], trim_keys? : Bool) -> Result[(String, Bool), String]

    Excel-readable UTF-8 CSV and the reconciliation verdict. Raw identifiers are JSON tuples inside quoted CSV cells, retaining leading zeros and component boundaries.

    reconcile_issue_sarif

    fn reconcile_issue_sarif(master : LookupTable, master_columns : Array[String], detail : LookupTable, detail_columns : Array[String], master_uri~ : String, detail_uri~ : String, trim_keys? : Bool) -> Result[(
    Json
    , Bool), String]

    Build a SARIF 2.1.0 log and the reconciliation verdict. Each finding retains its physical line spans without including the original key values or CSV text. Pass encoded artifact URIs. Relative references use the caller's source root.

    reconcile_tables

    fn reconcile_tables(master : LookupTable, master_columns : Array[String], detail : LookupTable, detail_columns : Array[String], max_examples? : Int, trim_keys? : Bool) -> Result[LookupReport, String]

    Reconcile textual identifiers, including tuple keys. Empty components never match; leading zeros and case are significant. trim_keys opts into boundary whitespace removal. Examples are capped per category.

    safe_resource_path

    fn safe_resource_path(path : String) -> Bool

    Only portable local relative paths. The I/O adapter must also enforce realpath containment.

    supports_temporal_format

    fn supports_temporal_format(type_name : String, format : String) -> Bool

    Whether a Table Schema temporal type supports a format in this module. default is supported for all five types; any and strptime patterns are supported only for date/time/datetime. year/yearmonth have no format options in Table Schema v1.

    temporal_order

    fn temporal_order(kind : String, left : String, right : String) -> Int?

    Compare normalized values. None denotes a local and zoned period whose order depends on the unknown local offset (XML Schema Part 2 §3.2.7.4).

    validate_foreign_key

    fn validate_foreign_key(table : Table, fields : Array[String], reference : Table, reference_fields : Array[String]) -> Array[Diagnostic]

    validate_json_package

    fn validate_json_package(descriptor : Descriptor, inputs : Array[JsonInputTable]) -> PackageReport

    Validate named, in-memory JSON tables using the descriptor's schemas and keys.

    validate_json_table

    fn validate_json_table(name : String, fields : Array[Field], input : JsonInputTable, missing_values? : Array[String], row_rules? : Array[RowRule]) -> TableReport

    Validate a batch JSON table against the same fields and constraints used by CSV input. Input is fully materialized; this API makes no streaming or fixed memory promise.

    validate_mixed_package

    fn validate_mixed_package(descriptor : Descriptor, inputs : Array[TabularResourceInput], on_source? : (String, Int, String, Int, Int) -> Unit, on_duplicate? : (String, Int, Int) -> Unit, on_relationships? : (ValidationPlan, RelationshipWork) -> Unit) -> PackageReport

    Validate CSV and JSON resources together, ensuring every constraint and foreign key sees the complete logical table across all parts.

    validate_package

    fn validate_package(descriptor : Descriptor, inputs : Array[InputTable]) -> PackageReport

    No I/O: a host may load local files or supply rows from any trusted source.

    validate_primary_key

    fn validate_primary_key(table : Table, fields : Array[String], on_duplicate? : (String, Int, Int) -> Unit) -> Array[Diagnostic]

    Only call on a table whose TableReport is valid. Composite keys compare typed cells.

    validate_table

    fn validate_table(name : String, fields : Array[Field], header : Array[String], rows : Array[Array[String]], missing_values? : Array[String], row_rules? : Array[RowRule]) -> TableReport

    Validate caller-provided rows. row=0 denotes schema/header errors; data rows are 1-based. Cells are returned for inspection, but callers must require valid() before using them.

    validate_table_schema

    fn validate_table_schema(name : String, schema : TableSchema, header : Array[String], rows : Array[Array[String]], missing_values? : Array[String]?) -> TableReport

    Validate one table against a parsed Table Schema.

    Missing values come from the schema unless the caller explicitly overrides them. Self-referencing foreign keys are checked against this table. Any foreign key that names another resource is reported as foreign-key-scope, because a single table alone cannot resolve it.

    write_reconcile_issue_sarif

    fn write_reconcile_issue_sarif(master : LookupTable, master_columns : Array[String], detail : LookupTable, detail_columns : Array[String], write_chunk : (String) -> Unit, master_uri~ : String, detail_uri~ : String, trim_keys? : Bool) -> Result[Bool, String]

    Write one complete SARIF log in order, without accumulating the result array or a single report string. The synchronous sink receives no chunks for invalid input.