Repository navigation
Description
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:
- An Iceberg source registered without an R2RML mapping.
fluree iceberg map … --mode direct --table-location …with no--r2rmlsucceeds (the CLI andPOST /iceberg/mapboth allow it),infoshows"mapping": null, and then:fluree query accounts --sparql '…'fails withLedger 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'smap_iceberg), and the docs disagree with each other about whether one is allowed (docs/graph-sources/iceberg.md:139anddocs/api/endpoints.md:3074say yes,docs/cli/iceberg.md:66says--r2rmlis required).
- A mapping that defines no
rr:TriplesMap, e.g.@prefix rr: <http://www.w3.org/ns/r2rml> .(missing the trailing#) ora rr:TripleMap. It registers withmapping_validated: true, triples_map_count: 0, and every query answers 0 rows. - 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"; throughquery_from()with a search pattern it's a misleading "No BM25 snapshot … at t=0". The architecture diagram indocs/graph-sources/README.mdshowsFROM <products-search:main>routed to the BM25 engine, but nothing implements that; the documented form is anf:graphSourcepattern with the source ledger as the dataset. - 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