Skip to content

Stop the missing-token check reporting a header's own Number=. - #22

Merged
ecrum19 merged 1 commit into
mainfrom
fix/missing-token-header-number
Sep 24, 2026
Merged

ecrum19 merged 1 commit into
mainfrom
fix/missing-token-header-number

Conversation

@ecrum19

@ecrum19 ecrum19 commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Problem

preflight_missing_token_conformance flags bare "." literals that should have been typed vcfc:Null. It already excluded vcfc:fieldNumber and vcfc:genotypeString, where the vocabulary requires a dot.

The same token reaches the graph a third way. The structured-header layer carries every declaration's attributes verbatim as vcfc:HeaderAttribute resources, so Number=. becomes a vcfc:attributeValue of "." on the attribute keyed Number. The core shapes require that value to be exactly xsd:string, so it can never be vcfc:Null.

On the v3.1.0 benchmark (vcf-bench-1, 13_query_cost, 100,000-record HG005_GRCh38 slice) the check still returned ten rows, one per Number=. INFO declaration in the header. It reported them as EXPECTED_CONFORMANCE_FAILURE on all nine validations of that input.

Change

  • Both the sample query and its _count form now exclude only the Number attribute's value. A bare dot on any other attribute or field is still reported.
  • The filter uses OPTIONAL + BOUND rather than NOT EXISTS. OPTIONAL and BOUND are already used by queries (q05, q07) that pass on all four validation engines; NOT EXISTS appears nowhere in the suite.
  • docs/conversion.md §7 documents the three places a bare dot is conformant.

Tests

test/test_missing_token_scope_unit.py (new, 5 tests) runs both queries with rdflib over a graph produced by the real header emitter:

  • Number=. declarations are not reported, and the count is 0.
  • A bare dot on a record field and on a non-Number header attribute are both still reported, and the count is 2.
  • A premise guard checks that the emitter really writes the "." the test is about.
  • The three behavioural tests fail against the previous queries.

Full suite: 865 tests, 864 pass. The one failure, test_shacl_default_unit (the vendored vocabulary vs a sibling vocabulary checkout), also fails on an untouched checkout of main: the local vcf-rdfizer-vocabulary checkout is at d46fbdf, ahead of the vendored snapshot 5bfd19d. It is unrelated to this change.

Not yet checked on a live QLever/Comunica/HDT/COTTAS run; the next benchmark validation of the HG005 slice should show PASS for this preflight.

🤖 Generated with Claude Code

preflight_missing_token_conformance looks for bare "." literals that should
have been typed vcfc:Null. It already excluded vcfc:fieldNumber and
vcfc:genotypeString, where the vocabulary requires a dot. The same token
reaches the graph a third way: the structured-header layer carries every
declaration's attributes verbatim as vcfc:HeaderAttribute resources, so
Number=. becomes an attributeValue of "." on the attribute keyed "Number",
and the core shapes require that value to be exactly xsd:string.

On the v3.1.0 benchmark the narrowed check still returned ten rows on the
100,000-record HG005 cell, one per Number=. INFO declaration in its header,
and reported them as EXPECTED_CONFORMANCE_FAILURE on every validation of
that input.

Exclude only the Number attribute's value, in both the sample query and its
count, so a bare dot on any other attribute or field is still reported. It
is written with OPTIONAL and BOUND rather than NOT EXISTS because those are
already used by queries that pass on all four validation engines.

test_missing_token_scope_unit.py runs both queries with rdflib over a graph
from the real header emitter: Number=. declarations are not reported, while
a bare dot on a record field and on a non-Number attribute still are. The
behavioural tests fail against the previous queries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 98.30508% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
test/test_missing_token_scope_unit.py 98.30% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@ecrum19
ecrum19 merged commit 01ac6e3 into main Sep 24, 2026
24 checks passed
@ecrum19
ecrum19 deleted the fix/missing-token-header-number branch September 25, 2026 11:51
@ecrum19 ecrum19 mentioned this pull request Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants