You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
R2RML RefObjectMap fan-out: duplicate parent join keys should emit one ref per matching parent #1583
When an R2RML RefObjectMap's parent join key is non-unique (two parent rows share the join value but mint different subject IRIs), spec-correct behavior is to emit one referencing triple per matching parent (fan-out). Both the virtual query path (build_parent_lookup in fluree-db-query) and the twin builder (ParentIndexSet in fluree-db-r2rml) instead resolve the key to a single parent subject.
As of #1529's review-response commits this single pick is at least deterministic and self-documenting: both paths share a keep-min tie-break (lexicographically smallest parent subject — previously last-wins, which was run-to-run nondeterministic because the parent index consumes scan_table's buffer_unordered stream and I/O completion order chose the winner), fluree materialize declines such sources by default (--allow-duplicate-parent-keys to override), and an override-built twin records the distinct ambiguous-key count in its completion stamp.
The remaining work this issue tracks is the fan-out itself: a multimap parent index (key → all matching parent subjects) emitting one edge per parent on both paths, with the fused-aggregate admission gate's duplicate-key decline revisited accordingly (it currently declines the shape to avoid under-counting — correct until the fold can represent fan-out). Note the shapes interact: COUNT semantics over a fan-out join change row multiplicity, so corpus members with a non-unique-key fixture and native-oracle differentials should land in the same change. Since twins are rebuildable artifacts, re-materialization heals any override-built twin once this lands.
Context: bplatz's #1529 review (inline on graph.rs:330) + the adjudication record in the repo's audit working set (dup-key adjudication, 2026-07-31).
Cross-reference for whoever implements the fan-out here: the fused R2RML aggregate now admits a RefObjectMap (IRI) GROUP BY key (fluree-db-query/src/r2rml/fused_aggregate.rs, resolve_at_open, PR #1582 / commit 537a186). It folds on the referenced parent-subject IRI resolved once per parent row (deterministic keep-min on a duplicate parent join key, byte-identical to build_parent_lookup), which is correct only while a duplicate parent key resolves to a single ref — exactly the behavior this issue changes.
When RefObjectMap fan-out lands (one ref per matching parent), group multiplicity changes, so the fused group-key admission and the generic path must flip in the same change or the native-oracle differential will catch the divergence. There is a comment at the admission site pointing back here; please revisit it as part of the fan-out work rather than discovering it via a failing differential.
One more data point for this one: the SQL graph-source lane lowers a referencing object map to a real join (fluree-db-query/src/r2rml/sql_lane/lower.rs:2351-2380), so it already fans out one ref per matching parent row. The same mapping over an Iceberg source goes through keep-min (fluree-db-r2rml/src/materialize/graph.rs:241-266, used at fluree-db-query/src/r2rml/operator.rs:2848) and keeps only the smallest parent subject. So today the two lanes return different answers for the same mapping, which may be worth weighing in this issue's priority. The set-semantics side of the same R2RML §11 question is now #2238.
Activity
perf(r2rml): P2a — fuse high-cardinality RefObjectMap (IRI) GROUP BY …
aaj3f commentedon Aug 3, 2026
Cross-reference for whoever implements the fan-out here: the fused R2RML aggregate now admits a RefObjectMap (IRI) GROUP BY key (
fluree-db-query/src/r2rml/fused_aggregate.rs,resolve_at_open, PR #1582 / commit 537a186). It folds on the referenced parent-subject IRI resolved once per parent row (deterministic keep-min on a duplicate parent join key, byte-identical tobuild_parent_lookup), which is correct only while a duplicate parent key resolves to a single ref — exactly the behavior this issue changes.When RefObjectMap fan-out lands (one ref per matching parent), group multiplicity changes, so the fused group-key admission and the generic path must flip in the same change or the native-oracle differential will catch the divergence. There is a comment at the admission site pointing back here; please revisit it as part of the fan-out work rather than discovering it via a failing differential.
perf(r2rml): P3 soundness core — fused multi-fact branching-star join…
fix(r2rml): decline same-key/same-subject SCD-2 semi-join collision (…
perf(r2rml): S1 — generalize fused branching-star join to K≥2 semi-jo…
aaj3f commentedon Nov 2, 2026
One more data point for this one: the SQL graph-source lane lowers a referencing object map to a real join (
fluree-db-query/src/r2rml/sql_lane/lower.rs:2351-2380), so it already fans out one ref per matching parent row. The same mapping over an Iceberg source goes through keep-min (fluree-db-r2rml/src/materialize/graph.rs:241-266, used atfluree-db-query/src/r2rml/operator.rs:2848) and keeps only the smallest parent subject. So today the two lanes return different answers for the same mapping, which may be worth weighing in this issue's priority. The set-semantics side of the same R2RML §11 question is now #2238.