Repository navigation
Conversation
A PropertyPath (transitive +/*) or Subquery inside a GRAPH scope over an R2RML source is not lowered to R2RML leaves and evaluates against the source's empty native index, silently returning zero rows as success (corpus q034: 0 vs native 4,514; q051: 0 vs 247). The whole-scope guard counted only unconverted top-level triples, so sub-scopes escaped it. Track non-lowered sub-scope kinds (property path, shortest path, subquery) through the rewrite recursion and fail the GRAPH scope with InvalidQuery, matching the unconverted-triple guard. Patterns that only transform bound solutions (FILTER/BIND/VALUES/UNWIND) and search patterns that route by their own graph_source_id are deliberately not flagged. No lowering is attempted here; this converts silent-wrong into loud-refuse only. Corpus: q034/q051 expected_status flips to virtual=error.
<iri> ?p ?o over a virtual dataset returned the POM data predicates but omitted the rr:class-derived rdf:type triple (corpus q042: 21 vs native 24 rows; the UI subject inspector showed no @type for virtual subjects). The subject-var wildcard path already binds the class; the bound-subject prefix-prune branch skipped class emission. Emit ?p=rdf:type / ?o=<class> per matching TriplesMap class in the bound-subject true-wildcard materialization, gated to a variable predicate with no predicate filter and no fused type-var, and only for a matched subject row (dangling IRIs still produce nothing).
This was referenced Jul 11, 2026
aaj3f
added a commit
that referenced
this pull request
Jul 13, 2026
… single-scan crawl, tracked-terminal interception Query-path response to bplatz's #1450 review comments 1-5. 1. True wildcards emit the rr:class rdf:type triple (native parity). The POM loop materialized only data predicates, so `<iri> ?p ?o` (the subject inspector) and `?s ?p ?o` never returned the subject's type. The operator now emits one rdf:type row per declared class for any true wildcard (predicate_var set, no predicate_filter, no projected type_var — a fused type-var pattern already carries the class, no double emission). Supersedes the bound-subject-only version staged in #1476, whose operator.rs hunk should be dropped on restack (its test remains valid). 2. Templated/column (non-constant) predicates bind ?p per-row. Previously a non-constant predicate left ?p unbound while still pushing ?o — a malformed solution. New materialize_predicate_from_batch (mirrors the subject/object batch helpers) expands the predicate from the row; a NULL referenced column means the triple does not exist, so the POM is skipped — never a half-bound row. Constant predicates keep the zero-cost as_constant() fast path. 3. The browse crawl is ONE budgeted scan. The injected `?s a ?type` was a REQUIRED join — inner-joining out subjects whose TriplesMap declares no rr:class — and the type-var merge only fired when the WHERE bound a class, so a plain unfiltered crawl kept a standalone type-var scan sitting topmost on the LIMIT budget (the exact starvation 6fdcedb fixed, but only for class-bound crawls). The Wildcard crawl no longer injects the type pattern: the wildcard's own rdf:type rows (1) carry the classes and the regroup folds `?p == rdf:type` into @type. Class-less subjects survive; multi-class cost becomes +1 row per class per subject instead of x-classes per (p,o) row. The Predicates+@type shape keeps its star-collapsed type member. The rewrite-side merge machinery is left in place (now unreachable from crawls). 4. Crawl OFFSET hardening: MAX_CRAWL_OFFSET_SUBJECTS (10k) errors with guidance past browse depth instead of quietly launching an O(offset) remote scan, and the ordering comment is rewritten as best-effort (first-seen scan order is not enforced across separately-executed requests; keyset/cursor is the real answer for a first-class pagination surface). 5. The alias-path execute_tracked now intercepts crawls. d4d9930 wired the three FromQueryBuilder terminals but GraphQueryBuilder::execute_tracked still fell through to native hydration and returned [] under tracking headers. It now expands identically (200 + empty tracking). The snapshot builder is deliberately not wired: graph sources are not loadable into materialized snapshots. Also: bound_subject_variable_predicate_binds_predicate_var becomes a #[tokio::test] — it builds a Fluree, and main's builder (merged in 2581847) now spawns the cache-event listener, which panics without a runtime. This was the single CI `test` failure on the merged head (9,576/9,577). Tests: bound/var-subject wildcard type-row units, templated-predicate bind-or-skip unit, engine_e2e_wildcard_binds_predicate_var updated 9 -> 12 rows (3 subjects x (3 POMs + 1 type)), offset-ceiling e2e, and the 19 crawl unit/e2e tests (multi-class, vertical-partition, subject parity, scan count, offset, LIMIT) all passing through the single-scan plan.
…ctness # Conflicts: # fluree-db-query/src/r2rml/operator.rs
The #1475 review response added error_boundary_queries_match_observed_behavior asserting NO corpus query declares virtual=error — true at #1475, but this PR's manifest deliberately flips q034 (transitive property path) and q051 (subquery) to loud-refuse on virtual (findings F1/F2). After the restack the base test failed at this branch's HEAD; neither the earlier validation (which ran fluree-db-query only) nor the review caught it. Pin the declared-error set to exactly [q034, q051] and assert both stay ok on native, where the same shapes evaluate fine against the ledger index. The q043/q044 error-boundary assertions are unchanged.
…kind dedup Review items on #1476: - Extract the two copy-identical GRAPH-scope InvalidQuery blocks (the seeded and batched paths in graph.rs) into rewrite::unsupported_subscope_error, next to the R2rmlRewriteResult::unsupported field it serves, so the loud-refuse message cannot drift between the paths. - Dedup repeated pattern-kind names in that message (two property paths in one scope read "property path", not "property path, property path"); first-seen order preserved, unit-tested. Message text is otherwise unchanged, and nothing pins it (the corpus harness gates on error status only). - Document the single-[Pattern::R2rml] shape gate in fused_aggregate.rs that keeps the third rewrite_patterns_for_r2rml caller decline-safe against non-lowered sub-scopes without consuming the new field. - rustfmt: reflow the VALUES negative-case test assert — the one cargo fmt --all --check violation in the workspace at this HEAD (the operator.rs drift the review flagged left this PR's delta with the restack; it is byte-identical to origin/main here). Gates at this HEAD: cargo fmt --all --check clean; scoped clippy clean; fluree-db-query 1254/1254; fluree-bench-virtual 33/33.
aaj3f
added a commit
that referenced
this pull request
Jul 13, 2026
cargo fmt --all --check fails on three hunks of this PR's own delta (fluree-db-api/src/graph_source/r2rml.rs, fused_aggregate.rs import + manifest-shortcut block) with rustfmt from stable 1.97.0 — what CI's dtolnay/rust-toolchain@stable resolves. CI never ran here (ci.yml triggers only on base=main), flagged by the #1476 review stack-wide note.
aaj3f
added a commit
that referenced
this pull request
Jul 13, 2026
cargo fmt --all --check fails on four hunks of this PR's own delta in fluree-db-iceberg/src/io/send_parquet.rs with rustfmt from stable 1.97.0 — what CI's dtolnay/rust-toolchain@stable resolves. CI never ran here (ci.yml triggers only on base=main), flagged by the #1476 review stack-wide note.
aaj3f
added a commit
that referenced
this pull request
Jul 13, 2026
cargo fmt --all --check fails on four hunks of this PR's own delta (operator.rs star-fanout block, rewrite.rs disjoint-class-hint + tests) with rustfmt from stable 1.97.0 — what CI's dtolnay/rust-toolchain@stable resolves. CI never ran here (ci.yml triggers only on base=main), flagged by the #1476 review stack-wide note.
Contributor
Author
|
Consolidating at maintainer request. #1476 (PR-0 — loud-refuse of silently-empty virtual sub-scopes, a breaking correctness fix) is carried forward in #1507 (the R2RML/Iceberg virtual-dataset performance program), which brings the #1475–#1507 lineage forward as a single reviewable unit. Its verification of record is the program's corpus benchmark, published as C2-bench-wave1.md (native == virtual, 0 hash mismatches). The pre-consolidation branch tip is preserved at tag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First PR of the virtual-dataset perf roadmap (
docs/audit/2026-07-virtual-dataset-perf/ROADMAP.md, PR-0). Correctness before performance: converts silently-wrong empty results into loud, actionable errors.Fixes
0a — Silent-empty guard (findings F1/F2). Transitive property paths (
+/*) and subqueries inside a GRAPH scope over an R2RML source aren't lowered to R2RML and silently evaluated against the source's empty native index — returning 0 rows as success (q034: 0 vs native 4,514; q051: 0 vs 247). The whole-scope guard counted only top-level unconverted triples; sub-scopes escaped it. Now the scope fails with the sameInvalidQueryshape. Patterns that only transform bound solutions (FILTER/BIND/VALUES/UNWIND) and self-routing search patterns are deliberately not flagged; sequence paths (a/b) are unaffected (decomposed upstream). No lowering attempted — that's a later capability PR.0b — Bound-subject wildcard
rdf:type(finding F3) — landed onmainahead of this PR. Originally part of this batch; during the #1450 review response it was generalized to both wildcard shapes (1c0064f,operator.rs, with unit testbound_subject_wildcard_emits_rdf_type) and reachedmainwhen #1450 merged. After the restack this PR's diff no longer carries it (operator.rshere is byte-identical tomain); the corpus q042 hash-parity blessing rides in #1475. Recorded here for the roadmap paper-trail:<iri> ?p ?oemits therr:class-derived type triple (q042: 24 rows, hash-parity with native).Review response (2026-07-13)
cargo fmt --all -- --checkis clean workspace-wide at HEAD (rustfmt from stable 1.97.0, what CI resolves). The flaggedoperator.rsdrift left this PR's delta with the restack; the remaining violation (VALUES negative-case test) is fixed.InvalidQueryblocks (seeded + batched paths) are now a sharedrewrite::unsupported_subscope_error, placed next to theR2rmlRewriteResult::unsupportedfield whose contract it implements.[Pattern::R2rml]shape gate documenting why the thirdrewrite_patterns_for_r2rmlcaller is decline-safe against non-lowered sub-scopes (falls back to the normal GRAPH path, which raises the loud error).breaking-changelabel (the repo's.github/release.ymlcategorizes by label).[q034, q051](both stillokon native).Validation (per the roadmap DoD)
At current HEAD (724d255):
cargo fmt --all -- --checkclean; scoped clippy clean (fluree-db-query,fluree-bench-virtual);fluree-db-query1254/1254;fluree-bench-virtual33/33.From the pre-restack validation (details in commit history, unchanged by the review response):
fluree-db-apifull suite (all grp_* bins) 0 failed; W3C SPARQL suite unregressed (3 pre-existing syntax-bin failures proven pre-existing by stash-and-rerun); corpus native 54/54 with 0 hash mismatches vs blessed oracles; virtual-SF01 targeted: q034/q051 fail loudly (expected_statusenforced by the harness), q042 24 rows hash-parity with native; 3 native micro-query perf "violations" (1.1–1.2×, 1–27ms absolute) exonerated by base-binary A/B.Notes / follow-ups (non-blocking)
<iri> ?p <class-iri>(bound-object) shape still misses the type row — noted in ROADMAP residuals.ci.ymltriggers only on PRs whose base ismain, so the gates above are local until the stack retargets.fluree-bench-virtualhas one remaining clippy warning (too_many_arguments, bench: virtual-dataset performance corpus, harness, baselines + audit (pre-work for the perf PR series) #1475-scope, non-gating today).Stacks on #1475 (harness/baselines/audit). Roadmap PR-1 (#1478, COUNT(*) manifest shortcut) follows.