Skip to content

Follow gg2rdf to https:// subject IRIs and document the store migration - #13

Merged
retog merged 2 commits into
mainfrom
https-canonical-iris
Sep 29, 2026
Merged

retog merged 2 commits into
mainfrom
https-canonical-iris

Conversation

@retog

@retog retog commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Closes #12.

Companion to plazi/gg2rdf#34 (the fix — gg2rdf mints https:// subjects) and plazi/turtle-hook-nq#8 (the other loader).

What changes

gg2rdf now writes every Plazi resource IRI as https://, the scheme this loader has always named its graphs with. The subject namespaces that have to match gg2rdf's output follow:

  • config/config.ts: treatmentUriPrefix and materialCitationUriPrefix, which the single-graph delete is scoped by.
  • src/sparql.ts: TAXON_NAME_NAMESPACE and the taxon-concept namespace in SWEEPABLE_NAMESPACES, which the sweep and the taxomplete index are limited to.
  • graphUriPrefix is untouched, as the comment on it demands; the doc comments that explained the two prefixes by their scheme now explain them by their role.
  • test-data/000040332F2853C295734E7BD4190F05.ttl is regenerated gg2rdf output from the branch in Mint Plazi resource IRIs with https:// as the canonical scheme gg2rdf#34 (byte-identical to flipping the scheme in the old fixture); the inline test data, col_test.ts's CoL→taxon-name link and the README's sweep query follow suit.

Store migration

A store loaded before the switch holds http:// subjects that this loader can no longer find — in single-graph mode the delete follows links from the stored treatment IRI, so an update to an old-style treatment would insert the new one next to the old rather than replace it. The README gains a section "Migrating a store to https:// IRIs": the DELETE/INSERT WHERE that renames every affected IRI in subject and object position, scoped to our graph and nothing else; the graph-per-file variant; why predicates need no renaming; and the order of operations (stop loader → rename → deploy → start). This is the text from the discussion in plazi/gg2rdf#33, placed where an operator will look for it.

Test engine

src/test_deps.ts moves oxigraph from 0.4.11 to 0.5.11 (test-only dependency, not in the image). Reason, and worth knowing: with 0.4.11, the owned-subject DELETE leaves the material citations behind once the filter prefixes are https:// — while a SELECT with the identical WHERE clause returns them. Narrowed down to the STRSTARTS(STR(?owned), "https://treatment.plazi.org/id/<id>/") clause; replacing its literal, or dropping it, makes 0.4.11 delete correctly, so this is an optimiser fault in the update path of the old version, not a property of the statement. 0.5.11 evaluates it correctly. The production endpoints (GraphDB on LINDAS, Blazegraph) are not oxigraph.

Verification

deno test --allow-read --allow-env --allow-net src/: 27 passed, 0 failed (same count as main).

🤖 Generated with Claude Code

gg2rdf now mints every Plazi resource IRI as https:// (plazi/gg2rdf#33),
the scheme this loader has always named its graphs with. The subject
namespaces that have to match gg2rdf's output follow: the treatment and
material-citation prefixes the single-graph delete is scoped by, and
the taxon-name and taxon-concept namespaces the sweep and the
taxomplete index are limited to. graphUriPrefix is untouched, as the
comment on it demands. The fixture is regenerated gg2rdf output; the
inline test data and the README's sweep query follow suit.

A store loaded before the switch holds http:// subjects that this
loader can no longer find, so it has to be renamed in place before the
loader is deployed. The README gains the rename update, scoped to our
graph and nothing else, and the order of operations.

The test engine moves to oxigraph 0.5: 0.4.11 evaluates the
owned-subject DELETE wrongly once the filter prefixes are https:// and
leaves the material citations behind, while a SELECT with the same
WHERE clause is correct. Test-only dependency.

Closes #12.

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

🔵 Needs a closer look

The graph-per-file migration omits COL_GRAPH, and the documented issue references need correction.

Review effort: Lite
Findings: None

What changed in this PR

Updates Turtle-Hook to consume gg2rdf’s canonical https:// resource IRIs and documents store migration.

Changes:

  • Updates namespaces, fixtures, tests, and Catalogue of Life links.
  • Adds migration guidance for both store graph modes.
  • Upgrades the test-only Oxigraph dependency.
File Summary
test-data/​000040332F2853C295734E7BD4190F05.ttl Regenerated fixture with HTTPS IRIs.
src/​test_deps.ts Upgrades test-only Oxigraph.
src/​sparql.ts Updates taxon namespaces and documentation; nit (1 vote) to reference #34 for the subject-IRI change.
src/​sparql_test.ts Adjusts SPARQL fixtures and assertions for HTTPS IRIs.
src/​col_test.ts Updates Catalogue of Life test links.
README.md Documents HTTPS migration; moderate issue (1 vote): graph-per-file migration omits COL_GRAPH; nit (1 vote) to correct issue references.
config/​config.ts Updates subject prefixes; nit (1 vote) to reference #34 for the subject-IRI change.

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

The subject-IRI change is implemented in plazi/gg2rdf#34; #33 is the
issue it closes, so cite both. The graph-per-file migration filter
leaves COL_GRAPH out, which review flagged as an omission. It is on
purpose: the Catalogue of Life data (plazi/catologueoflife-to-rdf)
holds only catalogueoflife.org IRIs and no Plazi resource, so there is
nothing in it to rename. The README now says so.

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

retog commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the Copilot review in eafcdcc:

  • References: README.md, config/config.ts and src/sparql.ts now cite Mint Plazi resource IRIs with https:// as the canonical scheme gg2rdf#34 (merged) with #33 as the issue.
  • COL_GRAPH in the graph-per-file migration: left out on purpose, now stated in the README. The Catalogue of Life data built by plazi/catologueoflife-to-rdf contains only catalogueoflife.org IRIs and no Plazi resource, so the rename has nothing to do there. The owl:sameAs to a taxon-name.plazi.org IRI in src/col_test.ts is a synthetic fixture line, not something the real CoL graph holds.

@retog
retog merged commit 48c2e94 into main Sep 29, 2026
1 check passed
@retog
retog deleted the https-canonical-iris branch September 29, 2026 14:11
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.

Named graph IRI and treatment subject IRI differ by scheme (https:// vs http://)

2 participants