From 62a50307b58b2ab8d82c48a9f0a6d21154c6a98c Mon Sep 17 00:00:00 2001 From: retog Date: Sat, 19 Sep 2026 17:36:14 +0000 Subject: [PATCH 1/2] Mint Plazi resource IRIs with https:// as the canonical scheme 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/. 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 --- README.md | 29 +++++++++++++++++++++++++++++ src/gg2rdf.ts | 19 ++++++++++++------- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e431246..b04a340 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,35 @@ This webserver also exposes the follwing paths: - `/full_update`: send a `POST` here to run the full_update script. Note that this will not delete any files (yet). +## Resource IRIs + +Every IRI gg2rdf mints for a Plazi resource uses the `https://` scheme: + +| Resource | IRI | +| ------------------------------- | ------------------------------------------------------- | +| treatment | `https://treatment.plazi.org/id/` | +| material citation | `https://tb.plazi.org/GgServer/dwcaRecords/.mc.` | +| taxon name | `https://taxon-name.plazi.org/id//` | +| taxon concept | `https://taxon-concept.plazi.org/id//` | +| publication without a DOI | `https://publication.plazi.org/id/` | + +`https://` is canonical: it is the scheme that resolves on every Plazi host, and +it is the scheme the loaders (`turtle-hook`, `turtle-hook-nq`) name their graphs +with, so a treatment and the graph it lands in share one IRI. A `httpUri` +attribute TreatmentBank supplies with `http://` is rewritten to `https://` when +it points at a Plazi host; identifiers of other publishers (DOIs, GBIF) are +taken as they are. + +Vocabulary namespaces are a different matter and stay as they are — +`trt:` is `http://plazi.org/vocab/treatment#`, alongside `dwc:`, `cito:` and +`fabio:`, which are `http://` by convention. Changing a vocabulary namespace +breaks every consumer's prefix declarations and belongs to a redesign of the +ontologies, not to this pipeline. + +Output produced before this change (plazi/gg2rdf#33) carries `http://` +subjects. Rewriting a store that holds such data in place, without replaying +every file, is described in turtle-hook's README. + ## Usage Build as a docker container. diff --git a/src/gg2rdf.ts b/src/gg2rdf.ts index e5c5ad8..d459fd6 100644 --- a/src/gg2rdf.ts +++ b/src/gg2rdf.ts @@ -233,7 +233,7 @@ export function gg2rdf( * * replaces and */ function makeTreatment() { - const t = new Subject(URI(`http://treatment.plazi.org/id/${id}`)); + const t = new Subject(URI(`https://treatment.plazi.org/id/${id}`)); if (treatmentTaxon) { const taxon = treatmentTaxon.el; @@ -772,16 +772,21 @@ export function gg2rdf( /** replaces */ function makeCitedMaterial(c: Element): string { const mcId = c.getAttribute("id"); - const httpUri = c.getAttribute("httpUri"); + // TreatmentBank still hands out http:// for its own resources; https:// is + // the canonical scheme for everything under plazi.org (see issue #33) + const httpUri = c.getAttribute("httpUri")?.replace( + /^http:\/\/(?=[a-z0-9-]+\.plazi\.org\/)/, + "https://", + ); const gbifOccurrenceId = c.getAttribute("ID-GBIF-Occurrence"); const specimenCode = c.getAttribute("specimenCode"); const uri = mcId - ? URI(`http://tb.plazi.org/GgServer/dwcaRecords/${id}.mc.${mcId}`) + ? URI(`https://tb.plazi.org/GgServer/dwcaRecords/${id}.mc.${mcId}`) : (gbifOccurrenceId ? URI(`https://www.gbif.org/occurrence/${gbifOccurrenceId}`) : (httpUri ? URI(httpUri) : URI( - `http://treatment.plazi.org/id/${id}/${partialURI(specimenCode)}`, + `https://treatment.plazi.org/id/${id}/${partialURI(specimenCode)}`, "_", ))); @@ -1247,7 +1252,7 @@ export function gg2rdf( /** replaces */ function taxonNameBaseURI({ kingdom }: { kingdom: string }) { - return `http://taxon-name.plazi.org/id/${ + return `https://taxon-name.plazi.org/id/${ kingdom ? partialURI(kingdom) : "INVALID" }`; } @@ -1374,7 +1379,7 @@ export function gg2rdf( * * replaces */ function taxonConceptBaseURI({ kingdom }: { kingdom: string }) { - return `http://taxon-concept.plazi.org/id/${kingdom}`; + return `https://taxon-concept.plazi.org/id/${kingdom}`; } /** returns valid turtle uri @@ -1423,7 +1428,7 @@ export function gg2rdf( const doiID: string | undefined = doc.getAttribute("ID-DOI"); if (!doiID) { return URI( - `http://publication.plazi.org/id/${ + `https://publication.plazi.org/id/${ partialURI(doc.getAttribute("masterDocId")) }`, ); From 90a6aae1e2fe890ed54c9b7af8644e73dde211a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reto=20Gm=C3=BCr?= Date: Tue, 29 Sep 2026 13:21:26 +0000 Subject: [PATCH 2/2] Format the Resource IRIs section of the README with deno fmt Co-Authored-By: Claude Opus 5.5 --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b04a340..7d290d0 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,13 @@ This webserver also exposes the follwing paths: Every IRI gg2rdf mints for a Plazi resource uses the `https://` scheme: -| Resource | IRI | -| ------------------------------- | ------------------------------------------------------- | -| treatment | `https://treatment.plazi.org/id/` | -| material citation | `https://tb.plazi.org/GgServer/dwcaRecords/.mc.` | -| taxon name | `https://taxon-name.plazi.org/id//` | -| taxon concept | `https://taxon-concept.plazi.org/id//` | -| publication without a DOI | `https://publication.plazi.org/id/` | +| Resource | IRI | +| ------------------------- | ------------------------------------------------------- | +| treatment | `https://treatment.plazi.org/id/` | +| material citation | `https://tb.plazi.org/GgServer/dwcaRecords/.mc.` | +| taxon name | `https://taxon-name.plazi.org/id//` | +| taxon concept | `https://taxon-concept.plazi.org/id//` | +| publication without a DOI | `https://publication.plazi.org/id/` | `https://` is canonical: it is the scheme that resolves on every Plazi host, and it is the scheme the loaders (`turtle-hook`, `turtle-hook-nq`) name their graphs @@ -40,15 +40,15 @@ attribute TreatmentBank supplies with `http://` is rewritten to `https://` when it points at a Plazi host; identifiers of other publishers (DOIs, GBIF) are taken as they are. -Vocabulary namespaces are a different matter and stay as they are — -`trt:` is `http://plazi.org/vocab/treatment#`, alongside `dwc:`, `cito:` and -`fabio:`, which are `http://` by convention. Changing a vocabulary namespace -breaks every consumer's prefix declarations and belongs to a redesign of the -ontologies, not to this pipeline. +Vocabulary namespaces are a different matter and stay as they are — `trt:` is +`http://plazi.org/vocab/treatment#`, alongside `dwc:`, `cito:` and `fabio:`, +which are `http://` by convention. Changing a vocabulary namespace breaks every +consumer's prefix declarations and belongs to a redesign of the ontologies, not +to this pipeline. -Output produced before this change (plazi/gg2rdf#33) carries `http://` -subjects. Rewriting a store that holds such data in place, without replaying -every file, is described in turtle-hook's README. +Output produced before this change (plazi/gg2rdf#33) carries `http://` subjects. +Rewriting a store that holds such data in place, without replaying every file, +is described in turtle-hook's README. ## Usage