Add supplement to the ISO doctype TYPES enum (#185)#186
Conversation
metanorma-iso#1562 introduced the Supplement ISO deliverable (PubID `ISO …/Suppl N:YYYY`). relaton-iso's doctype model did not recognise `supplement`, so parsing or citing a Supplement bibliographic item failed validation against `TYPES`. - Add `supplement` to `Doctype::TYPES`. - Map the Open Data `supplementType` code `Suppl` to `supplement` in `DataParser::SUPPLEMENT_DOCTYPES`, matching pubid-iso's canonical abbreviation. - Cover the `Suppl` (and previously-untested `Add`) mappings in the data_parser spec. Fixes #185 Refs metanorma/metanorma-iso#1562 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Fixed in relaton-iso v2.1.3 |
|
@andrew2net the Open Data dataset has no Supplement? Because there are clearly supplements on iso.org...? |
|
@ronaldtse the Open Data has Amd, Cor, Add, but not Suppl or Sup |
|
Then how is a document like this given? https://www.iso.org/standard/25249.html https://www.iso.org/standard/50462.html Anyway, the new PubID supports this. |
|
@ronaldtse yes, the Open Data has 7 Suppl docs. I was misguided by Claude.
The Suppl IDs are parsed correctly, but doctype falls-back to international-standard currently. I'll fix it. |
|
We need to add "Ext" as a new doctype "Extract". Thanks. |
Summary
Fixes #185. metanorma-iso#1562 introduced the Supplement ISO deliverable (PubID
ISO …/Suppl N:YYYY), modelled on Addendum. relaton-iso's doctype model did not recognisesupplement, so parsing or citing a Supplement bibliographic item would fail validation againstDoctype::TYPES.Changes
lib/relaton/iso/model/doctype.rb— addsupplementto theTYPESallow-list.lib/relaton/iso/data_parser.rb— map the Open DatasupplementTypecodeSuppltosupplementinSUPPLEMENT_DOCTYPES, matching pubid-iso's canonical abbreviation (Pubid::Iso::Identifier::Supplement.type→values: %w[Supplement Suppl SUP]).spec/relaton/iso/data_parser_spec.rb— assert theSuppl => supplementmapping, plus the previously-untestedAdd => addendum.Note
The
Supplfeed-code mapping is an educated inference — there's no real Open Data record with a supplement on hand to confirm the exactsupplementTypestring.Supplis consistent with pubid-iso and with howAmd/Cor/Addare keyed. If the feed turns out to emitSup/SUP, only that one map key needs adjusting. The doctype-enum addition is correct regardless.Testing
bundle exec rspec spec/relaton/iso/data_parser_spec.rb— 13 examples, 0 failures.Refs metanorma/metanorma-iso#1562
🤖 Generated with Claude Code