Skip to content

Restore @id and dropped ISOSTS attributes on IsoSts models#42

Draft
HassanAkbar wants to merge 3 commits into
mainfrom
feat/isosts-element-id
Draft

Restore @id and dropped ISOSTS attributes on IsoSts models#42
HassanAkbar wants to merge 3 commits into
mainfrom
feat/isosts-element-id

Conversation

@HassanAkbar

Copy link
Copy Markdown
Member

Metanorma PR checklist

Restores the @id on 23 IsoSts element classes (the 86948b9 convention) and adds 39 ISOSTS attributes that 15 models silently dropped — real data loss, e.g. sub/sup arrange+specific-use, ext-link/mixed-citation/uri/named-content xlink:*, graphic xlink:*+originator, copyright-*, edition, title, label, underline, body. Also fixes sec/standard/term-sec, which mapped ISOSTS xml:lang under the wrong XML name (lang), losing it on parse.

Breaking change: IsoSts::Standard#lang is renamed to #xml_lang (to match its Sec/TermSec siblings and correct the xml:lang mapping). Callers using standard.lang must switch to standard.xml_lang.

Deferred to a follow-up: 7 spurious attributes on 5 models, and the 6 classes left without @id in 86948b9.

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.

Pull request overview

This PR updates the Sts::IsoSts model layer to prevent silent data loss by restoring the conventional @id attribute on selected elements and adding missing ISOSTS-defined attributes/mappings (notably xlink:* and xml:lang fixes). It also includes spec updates to assert exact attribute sets and to guard against unmapped-but-declared attributes.

Changes:

  • Restored conventional @id support on additional IsoSts elements (including xs:string-typed elements) and added/verified attribute mappings.
  • Restored previously dropped ISOSTS attributes across multiple IsoSts models (e.g., xlink:*, arrange, specific-use, content-type, alt, underline-style).
  • Corrected xml:lang mapping for standard, sec, and term-sec (and renamed IsoSts::Standard#lang to #xml_lang), with expanded specs to cover round-trips and attribute sets.

Reviewed changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
TODO.sts-refactor/03-namespace-coupling.md Updates ADR notes to clarify ISOSTS.xsd vs conventional @id authority and verification expectations.
TODO.sts-refactor/00-overview.md Updates project overview notes to reflect restored ISOSTS attributes and the intentional conventional @id.
spec/iso_sts/iso_sts_element_spec.rb Strengthens attribute-set assertions and adds round-trip tests for @id, xlink:type, and corrected xml:lang.
lib/sts/iso_sts/year.rb Adds conventional @id attribute + XML mapping to year.
lib/sts/iso_sts/volume.rb Adds conventional @id attribute + XML mapping to volume.
lib/sts/iso_sts/version.rb Adds conventional @id attribute + XML mapping to version.
lib/sts/iso_sts/urn.rb Adds conventional @id attribute + XML mapping to urn.
lib/sts/iso_sts/uri.rb Adds missing xlink:type attribute + XML mapping to uri.
lib/sts/iso_sts/underline.rb Adds missing underline-style attribute + XML mapping to underline.
lib/sts/iso_sts/title.rb Adds missing content-type / specific-use attributes + XML mappings to title.
lib/sts/iso_sts/term_sec.rb Fixes xml:lang mapping name (from lang to xml:lang) in term-sec.
lib/sts/iso_sts/suppl_version.rb Adds conventional @id attribute + XML mapping to suppl-version.
lib/sts/iso_sts/suppl_type.rb Adds conventional @id attribute + XML mapping to suppl-type.
lib/sts/iso_sts/suppl_number.rb Adds conventional @id attribute + XML mapping to suppl-number.
lib/sts/iso_sts/sup.rb Restores ISOSTS attributes (arrange, specific-use) and maps them for sup.
lib/sts/iso_sts/sub.rb Restores ISOSTS attributes (arrange, specific-use) and maps them for sub.
lib/sts/iso_sts/standard.rb Renames lang to xml_lang and fixes mapping to xml:lang for standard.
lib/sts/iso_sts/secretariat.rb Adds conventional @id attribute + XML mapping to secretariat.
lib/sts/iso_sts/sec.rb Fixes xml:lang mapping name (from lang to xml:lang) in sec.
lib/sts/iso_sts/sdo.rb Adds conventional @id attribute + XML mapping to sdo.
lib/sts/iso_sts/release_version.rb Adds conventional @id attribute + XML mapping to release-version.
lib/sts/iso_sts/pub_id.rb Adds conventional @id attribute + XML mapping to pub-id.
lib/sts/iso_sts/pub_date.rb Adds conventional @id attribute + XML mapping to pub-date.
lib/sts/iso_sts/proj_id.rb Adds conventional @id attribute + XML mapping to proj-id.
lib/sts/iso_sts/part_number.rb Adds conventional @id attribute + XML mapping to part-number.
lib/sts/iso_sts/page_range.rb Adds conventional @id attribute + XML mapping to page-range.
lib/sts/iso_sts/originator.rb Adds conventional @id attribute + XML mapping to originator.
lib/sts/iso_sts/named_content.rb Adds missing xlink:type attribute + XML mapping to named-content.
lib/sts/iso_sts/mixed_citation.rb Restores missing xlink:* attributes and maps them on mixed-citation.
lib/sts/iso_sts/lpage.rb Adds conventional @id attribute + XML mapping to lpage.
lib/sts/iso_sts/label.rb Restores missing alt and xml:lang attributes + XML mappings to label.
lib/sts/iso_sts/issue.rb Adds conventional @id attribute + XML mapping to issue.
lib/sts/iso_sts/is_proof.rb Adds conventional @id attribute + XML mapping to empty is-proof.
lib/sts/iso_sts/ics.rb Adds conventional @id attribute + XML mapping to ics.
lib/sts/iso_sts/graphic.rb Restores missing xlink:* and originator attributes + XML mappings to graphic.
lib/sts/iso_sts/fpage.rb Adds conventional @id attribute + XML mapping to fpage.
lib/sts/iso_sts/ext_link.rb Restores missing xlink:* attributes + XML mappings to ext-link.
lib/sts/iso_sts/edition.rb Restores missing content-type / specific-use / xml:lang attributes + XML mappings to edition.
lib/sts/iso_sts/doc_type.rb Adds conventional @id attribute + XML mapping to doc-type.
lib/sts/iso_sts/doc_number.rb Adds conventional @id attribute + XML mapping to doc-number.
lib/sts/iso_sts/copyright_year.rb Restores missing content-type / specific-use attributes + XML mappings to copyright-year.
lib/sts/iso_sts/copyright_statement.rb Restores missing content-type / specific-use / xml:lang attributes + XML mappings to copyright-statement.
lib/sts/iso_sts/copyright_holder.rb Restores missing content-type / specific-use / xml:lang attributes + XML mappings to copyright-holder.
lib/sts/iso_sts/body.rb Restores missing specific-use attribute + XML mapping to body.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread spec/iso_sts/iso_sts_element_spec.rb Outdated

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.

Pull request overview

Copilot reviewed 44 out of 44 changed files in this pull request and generated no new comments.

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