Skip to content

R2RML graph sources: verify each snapshot's table keys before trusting them #2320

Open

Description

@aaj3f

Problem

Since #2317, an R2RML graph source skips deduplication for a map whose subject a table key proves unique. Keys come from f:key on the logical table, from an Iceberg table's identifier-field-ids (format versions 1 to 3), or from a SQL source's registration probe (verified_subject_keys). They are trusted, not verified. Iceberg does not enforce identifier fields, an f:key is only a declaration, and the SQL probe sees a table only as it was when it ran.

Over a table that breaks its key (two rows with the same key values), the answer is wrong:

  • queries return the repeated solutions the key ruled out, so the graph source answers as a bag rather than as the set of triples its mapping defines;
  • a class or property count that /info reads from table metadata is presented as exact when it is not.

Expected

  • A key is checked against the data of the snapshot that uses it, once per snapshot and table, with the verdict kept by snapshot id. Snapshots are immutable, so a verdict never goes stale.
  • When a check finds a violation, the source falls back to the deduplicating lanes for the affected maps and reports a non-exact count (null, with an upper bound where one is provable), and says why in a warning.
  • The cost stays off the hot path: a check that would read the whole table runs in the background or on demand (fluree iceberg check-style), and until it has run the source behaves as today.

Notes

  • Manifest column statistics can't prove uniqueness, but they can sometimes disprove it cheaply (for example a single-file table whose key column has fewer distinct values than rows, where distinct counts are written).
  • The SQL lane has the same gap between fluree sql check runs. Re-probing on a schedule or per connection is the analogue.

Follow-up from #2317.

Activity

  1. added
    bug
    P2
    area:iceberg
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area:icebergbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions