Skip to content

Report files that still carry http:// Plazi subjects in the export trailer - #8

Merged
retog merged 1 commit into
mainfrom
https-canonical-iris
Sep 29, 2026
Merged

retog merged 1 commit into
mainfrom
https-canonical-iris

Conversation

@retog

@retog retog commented Sep 19, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #5.

Companion to plazi/gg2rdf#34 (the fix — gg2rdf now mints https:// subjects; closes plazi/gg2rdf#33) and plazi/turtle-hook#13 (the other loader; closes plazi/turtle-hook#12).

What changes

No behaviour of the loader changes. graphUriPrefix was https://treatment.plazi.org/id all along and stays; the n-triples are passed through untouched. Once gg2rdf's change lands, a treatment subject and the graph this service names after the file are the same IRI, which is what the issue asked for.

What did need a home is the transition. Files generated before the switch keep loading — into a graph whose name differs from the subject by scheme only — and there was no way to see how many of them are left. Two additions:

  • The # export complete: trailer of /nquads and /ntriples now counts files that have a http:// subject under a Plazi host (treatment, taxon-name, taxon-concept, publication, tb), e.g. … took 312.4s, 41203 files still with http:// plazi subjects (pre-gg2rdf#33, regenerate). Silent when there are none. One regex test per line, only until the first hit per file.
  • README: a section on the contract between graph name and subject IRI, why the prefix is not a deployment setting, and that the QLever index needs a full rebuild from the export once the files are regenerated.

Verification

deno test --no-check --allow-read --allow-write --allow-env --allow-net --allow-run: 10 passed (two new tests: the count, and its absence). --no-check because main already fails type-checking under Deno 2.9 (setTimeout returning Timeout in endpoints.ts:71 and integration.test.ts:103) — unrelated to this change, not touched here.

🤖 Generated with Claude Code

…ailer

Since plazi/gg2rdf#33 every Plazi resource IRI is https://, so a
treatment subject and the graph this service names after the file are
the same IRI. Nothing in this repo needed to change for that: the graph
prefix was https:// all along, and the n-triples are passed through as
they are.

What did need a home is the transition. Files generated before the
switch keep loading, into a graph whose name differs from the subject
by scheme only, and there was no way to see how many of them are left.
The `# export complete:` trailer of /nquads and /ntriples now counts
files with http:// subjects under a Plazi host, so the operator can
tell when the index is worth rebuilding. The README states the
contract between graph name and subject IRI, and why the prefix is
not a deployment setting.

Closes #5.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation and tests are reviewed; the remaining README feedback is a minor, non-blocking wording nit.

Review effort: Lite
Findings: None

What changed in this PR

Adds reporting for legacy http:// Plazi subjects in export trailers and documents the migration requirements.

Changes:

  • Counts affected files in /nquads and /ntriples exports.
  • Adds tests for reporting and silent behavior.
  • Documents graph/subject IRI alignment and QLever rebuild guidance.
File Reviewed changes
src/​endpoints.ts Detects and reports legacy Plazi subjects per file.
src/​endpoints.test.ts Tests counting and zero-count behavior.
README.md Documents IRI contracts and migration guidance; includes a minor wording nit about the upstream change.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@retog
retog merged commit 56b1faa into main Sep 29, 2026
2 checks passed
@retog
retog deleted the https-canonical-iris branch September 29, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants