test(search-pipeline): cover registry-sourced extraction against a register-shaped fixture - #710
Merged
Merged
Conversation
…gister-shaped fixture The registry-sourced stages shipped with unit tests over hand-built stubs and nock; nothing exercised them against register-shaped data or a real SPARQL engine. - add a TriG fixture modelled on the NDE Dataset Register: each registration crawled into a graph named after its dataset IRI, the publisher described inside that graph, and a registrations graph holding the schema:Dataset stubs a never-crawled registration leaves behind - run both root types end to end against a local endpoint with no explicit readers, so the generated CONSTRUCT, the graph scoping, the framing and the projection are all proven to agree - point the dataset's own distribution at an unreachable URL, so a stage that ignored sourceFor fails to connect rather than quietly passing - pair every absence assertion with what the pass did produce: with the scoping removed the file endpoint's default graph is empty, so a bare not.toContain would pass vacuously
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.
The registry-sourced stages (#695) shipped with unit tests over hand-built stubs and nock. Nothing exercised them against register-shaped data, or against a real SPARQL engine, so the three properties the design rests on were argued in review rather than pinned by a test.
The fixture
register-sample.trigis modelled on the NDE Dataset Register: each registration is crawled into a named graph called after its dataset IRI, and is self-contained in it – the publisher’sfoaf:nameand itsfoaf:Organizationtype sit inside the dataset’s own graph. Two registrations, so a run scoped to one must not see the other; plus a registrations graph holding theschema:Datasetstubs that a never-crawled registration leaves behind.The test
Both root types run end to end against a local SPARQL endpoint (port 3009) with no explicit readers, so each stage defaults to the generated Extraction CONSTRUCT – proving the generator, the graph scoping, the framing and the projection agree, rather than testing them in isolation.
dcat:Datasetinside the dataset’s own graph structurally excludes theschema:Datasetstubs rather than filtering them out afterwards.Two things that keep it honest
The dataset’s own distribution points at an unreachable URL, so a stage that ignored
sourceForfails to connect rather than quietly passing.Every absence assertion is paired with what the pass did produce. Removing the graph scoping leaves the file endpoint’s default graph empty, so a bare
not.toContainwould pass vacuously – verified by mutatingregistrySourceto drop the scoping: two of four tests initially survived it, and all four fail after the pairing.