Skip to content

Graph sources: a registered source that can't serve a query answers "Ledger not found" or silently returns no rows #2188

Closed

Description

@aaj3f

I hit the first of these while validating a GCS table, and it turned out to be a small family. In each case the source is registered and visible to fluree iceberg info / list, but a query of it either names the wrong cause or, worse, answers 0 rows with exit 0:

  1. An Iceberg source registered without an R2RML mapping. fluree iceberg map … --mode direct --table-location … with no --r2rml succeeds (the CLI and POST /iceberg/map both allow it), info shows "mapping": null, and then:
    • fluree query accounts --sparql '…' fails with Ledger error: Ledger not found: accounts:main;
    • SELECT * FROM <accounts:main> … returns 0 rows, exit 0.
      Nothing reads a mapping-less Iceberg record (SQL and Delta already require a mapping at the type level, and so does Python's map_iceberg), and the docs disagree with each other about whether one is allowed (docs/graph-sources/iceberg.md:139 and docs/api/endpoints.md:3074 say yes, docs/cli/iceberg.md:66 says --r2rml is required).
  2. A mapping that defines no rr:TriplesMap, e.g. @prefix rr: <http://www.w3.org/ns/r2rml> . (missing the trailing #) or a rr:TripleMap. It registers with mapping_validated: true, triples_map_count: 0, and every query answers 0 rows.
  3. A BM25 / vector / geo index named where a graph is read (FROM, FROM NAMED, GRAPH, or as the query target). Triple patterns over it answer 0 rows; as a target it's "Ledger not found"; through query_from() with a search pattern it's a misleading "No BM25 snapshot … at t=0". The architecture diagram in docs/graph-sources/README.md shows FROM <products-search:main> routed to the BM25 engine, but nothing implements that; the documented form is an f:graphSource pattern with the source ledger as the dataset.
  4. A mapped source this build can't read (compiled without iceberg / sql / delta), or a graph-source type this version doesn't recognize: again "Ledger not found" or 0 rows.

Claude traced the mechanism: a stored record is resolved at two independent points (the R2RML probe has_r2rml_mapping and the view resolver resolve_graph_source_address), and each of these shapes reads as "not a mapped source" at one of them and falls through to the ledger lookup or to an empty genesis graph. Same class as #1398, fwiw.

What I think we want: a registered source that can't serve a query fails with a typed error naming the cause, on every route and both surfaces, and registration refuses the shapes that can never be queried (no mapping, or an empty one). Fix in the PR linked below.

Activity

  1. added
    bug
    P2
    area:query
    on Oct 27, 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:querybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions