Skip to content

Add supplement to the ISO doctype TYPES enum (#185)#186

Merged
andrew2net merged 1 commit into
lutaml-integrationfrom
fix-185-supplement-doctype
Jun 16, 2026
Merged

Add supplement to the ISO doctype TYPES enum (#185)#186
andrew2net merged 1 commit into
lutaml-integrationfrom
fix-185-supplement-doctype

Conversation

@andrew2net

Copy link
Copy Markdown
Contributor

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 recognise supplement, so parsing or citing a Supplement bibliographic item would fail validation against Doctype::TYPES.

Changes

  • lib/relaton/iso/model/doctype.rb — add supplement to the TYPES allow-list.
  • lib/relaton/iso/data_parser.rb — map the Open Data supplementType code Suppl to supplement in SUPPLEMENT_DOCTYPES, matching pubid-iso's canonical abbreviation (Pubid::Iso::Identifier::Supplement.typevalues: %w[Supplement Suppl SUP]).
  • spec/relaton/iso/data_parser_spec.rb — assert the Suppl => supplement mapping, plus the previously-untested Add => addendum.

Note

The Suppl feed-code mapping is an educated inference — there's no real Open Data record with a supplement on hand to confirm the exact supplementType string. Suppl is consistent with pubid-iso and with how Amd/Cor/Add are keyed. If the feed turns out to emit Sup/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

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>
@andrew2net andrew2net merged commit 93a1bfe into lutaml-integration Jun 16, 2026
11 checks passed
@andrew2net andrew2net deleted the fix-185-supplement-doctype branch June 16, 2026 16:42
@andrew2net

Copy link
Copy Markdown
Contributor Author

Fixed in relaton-iso v2.1.3

@ronaldtse

Copy link
Copy Markdown
Contributor

@andrew2net the Open Data dataset has no Supplement? Because there are clearly supplements on iso.org...?

@andrew2net

Copy link
Copy Markdown
Contributor Author

@ronaldtse the Open Data has Amd, Cor, Add, but not Suppl or Sup

@ronaldtse

ronaldtse commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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.

@andrew2net

Copy link
Copy Markdown
Contributor Author

@ronaldtse yes, the Open Data has 7 Suppl docs. I was misguided by Claude.

supplementType count mapped doctype
Amd 5062 amendment
Cor 2413 technical-corrigendum
Add 216 addendum
Suppl 7 supplement
Ext 1 unmapped

The Suppl IDs are parsed correctly, but doctype falls-back to international-standard currently. I'll fix it.
The "ISO 1101:1983/Ext 1:1983" doc has Ext supplementType and falls back to international-standard. I don't see any suitable doctype we currently have in the grammar. Should add appropriate doctype to the grammar or international-standard is ok for Ext?

international-standard
technical-specification
technical-report
publicly-available-specification
international-workshop-agreement
guide recommendation
amendment
technical-corrigendum
directive
committee-document
addendum
supplement

@ronaldtse

Copy link
Copy Markdown
Contributor

We need to add "Ext" as a new doctype "Extract". Thanks.

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.

2 participants