Skip to content

Mint Plazi resource IRIs with https:// as the canonical scheme - #34

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 #33.

What changes

Every IRI gg2rdf mints for a Plazi resource is now https://:

Resource Before After
treatment (src/gg2rdf.ts L236) http://treatment.plazi.org/id/<id> https://…
material citation (L780) http://tb.plazi.org/GgServer/dwcaRecords/<id>.mc.<n> https://…
material citation fallback (L784) http://treatment.plazi.org/id/<id>/<specimenCode> https://…
taxon name base (L1250) http://taxon-name.plazi.org/id/<kingdom> https://…
taxon concept base (L1377) http://taxon-concept.plazi.org/id/<kingdom> https://…
publication without DOI (L1426) http://publication.plazi.org/id/<masterDocId> https://…

trt:httpUri (L830) was already https:// and is unchanged.

One step beyond the issue's list, flagged for review: a httpUri attribute that TreatmentBank supplies on a material citation is passed through as its IRI when there is neither an id nor a GBIF occurrence. TreatmentBank still hands out http:// for its own resources, so that value is now rewritten to https:// when — and only when — it points at a *.plazi.org host. Without this the scheme of a subject would depend on upstream data. Identifiers of other publishers (DOIs, GBIF) are left as they are.

The vocabulary namespace trt: (http://plazi.org/vocab/treatment#) stays http://, as the issue scopes: changing it breaks every consumer's prefix declarations and belongs to a redesign of the ontologies.

The README gains a "Resource IRIs" section stating the canonical scheme.

Verification

  • deno check src/gg2rdf.ts passes.
  • deno run src/gg2rdf.ts -i example-data/000040332F2853C295734E7BD4190F05.xml produces no http:// IRI under any Plazi host; the output is byte-identical to the fixture turtle-hook uses (test-data/000040332F2853C295734E7BD4190F05.ttl after the same flip), so the two repos agree on the shape.

What this does not do, and what has to follow

🤖 Generated with Claude Code

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

🟡 Changes recommended

The material-citation rewrite misses valid URI variants, allowing some Plazi IRIs to remain http://.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates gg2rdf to mint Plazi resource IRIs with canonical https:// schemes.

Changes:

  • Converts treatment, citation, taxon, and publication IRIs to HTTPS.
  • Normalizes Plazi material-citation httpUri values.
  • Documents the canonical scheme and migration context.
File Description
src/​gg2rdf.ts Updates IRI generation and normalization.
README.md Documents resource IRI conventions.

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

Comment thread src/gg2rdf.ts
@retog

retog commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator Author

Rebased onto #35, which fixes the Docker build (the Java install via apt failed; this PR never touched the Dockerfile). Until #35 is merged, its Dockerfile commit also appears in this diff; once it lands, rebasing onto main drops it.

@retog
retog force-pushed the https-canonical-iris branch from f72b568 to af692c6 Compare September 25, 2026 15:32
Treatment, material citation, taxon name, taxon concept and DOI-less
publication IRIs were written as http://, while the loaders name the
graph a treatment lands in https://treatment.plazi.org/id/<id>. A
treatment therefore never shared an IRI with its own graph, and
`GRAPH ?g { ?g ?p ?o }` returned nothing, silently.

https:// resolves on every Plazi host and is already what trt:httpUri
used, so it becomes the scheme for every instance IRI. A `httpUri`
attribute TreatmentBank supplies with http:// is rewritten to https://
when it points at a Plazi host, so that the scheme of a subject never
depends on upstream data. The vocabulary namespace trt: stays http://
on purpose: changing it breaks every consumer's prefix declarations and
belongs to a redesign of the ontologies.

Closes #33.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@retog
retog force-pushed the https-canonical-iris branch from af692c6 to 62a5030 Compare September 29, 2026 13:07
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@retog
retog merged commit e946064 into main Sep 29, 2026
1 check passed
@retog
retog deleted the https-canonical-iris branch September 29, 2026 13:31
retog added a commit to plazi/turtle-hook that referenced this pull request Sep 29, 2026
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 added a commit to plazi/turtle-hook that referenced this pull request Sep 29, 2026
…on (#13)

* Follow gg2rdf to https:// subject IRIs and document the store migration

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>

* Cite gg2rdf#34 for the https switch and say why COL_GRAPH is not renamed

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>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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