sts 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/.rubocop.yml +3 -0
- data/.rubocop_todo.yml +17 -3
- data/CLAUDE.md +72 -0
- data/GAPS.guidelines.iso-sts-ed2.1/01-maintenance.md +19 -0
- data/GAPS.guidelines.iso-sts-ed2.1/03-general.md +75 -0
- data/GAPS.guidelines.iso-sts-ed2.1/04-structure.md +75 -0
- data/GAPS.guidelines.iso-sts-ed2.1/05-content.md +63 -0
- data/GAPS.guidelines.iso-sts-ed2.1/06-tables.md +53 -0
- data/GAPS.guidelines.iso-sts-ed2.1/07-formulae.md +41 -0
- data/GAPS.guidelines.iso-sts-ed2.1/08-figures.md +45 -0
- data/GAPS.guidelines.iso-sts-ed2.1/09-terms.md +56 -0
- data/GAPS.guidelines.iso-sts-ed2.1/10-references.md +56 -0
- data/GAPS.guidelines.iso-sts-ed2.1/annex-a-multilingual.md +79 -0
- data/GAPS.guidelines.niso-sts-v1.0/01-introduction-scope.md +27 -0
- data/GAPS.guidelines.niso-sts-v1.0/02-document-structure.md +100 -0
- data/GAPS.guidelines.niso-sts-v1.0/03-front-matter.md +149 -0
- data/GAPS.guidelines.niso-sts-v1.0/04-body-content.md +209 -0
- data/GAPS.guidelines.niso-sts-v1.0/05-tables-figures.md +152 -0
- data/GAPS.guidelines.niso-sts-v1.0/06-math-formulae.md +128 -0
- data/GAPS.guidelines.niso-sts-v1.0/07-references.md +113 -0
- data/GAPS.guidelines.niso-sts-v1.0/08-terminology.md +127 -0
- data/GAPS.guidelines.niso-sts-v1.0/09-metadata.md +113 -0
- data/GAPS.guidelines.niso-sts-v1.0/10-iso-iec-variant.md +141 -0
- data/GAPS.guidelines.niso-sts-v1.0/SUMMARY.md +96 -0
- data/GAPS.guidelines.schema-xref.md +101 -0
- data/Gemfile +2 -1
- data/TODO.sts-refactor/00-overview.md +172 -0
- data/TODO.sts-refactor/01-mathml-delegation.md +153 -0
- data/TODO.sts-refactor/02-type-resolution.md +122 -0
- data/TODO.sts-refactor/03-namespace-coupling.md +158 -0
- data/TODO.sts-refactor/04-register-versioning.md +180 -0
- data/TODO.sts-refactor/05-missing-elements.md +195 -0
- data/TODO.sts-refactor/06-missing-attributes.md +152 -0
- data/TODO.sts-refactor/07-incomplete-models.md +180 -0
- data/TODO.sts-refactor/08-isoiec-profile.md +169 -0
- data/TODO.sts-refactor/09-autoload-cleanup.md +88 -0
- data/TODO.sts-refactor/10-test-coverage.md +164 -0
- data/TODO.sts-refactor/11-duplicate-models.md +168 -0
- data/lib/sts/iso_sts/annex_type.rb +2 -0
- data/lib/sts/iso_sts/app.rb +26 -1
- data/lib/sts/iso_sts/app_group.rb +1 -0
- data/lib/sts/iso_sts/array.rb +1 -0
- data/lib/sts/iso_sts/back.rb +1 -0
- data/lib/sts/iso_sts/body.rb +4 -0
- data/lib/sts/iso_sts/bold.rb +23 -11
- data/lib/sts/iso_sts/break.rb +3 -0
- data/lib/sts/iso_sts/caption.rb +1 -0
- data/lib/sts/iso_sts/comm_ref.rb +2 -0
- data/lib/sts/iso_sts/content_language.rb +22 -0
- data/lib/sts/iso_sts/copyright_holder.rb +4 -2
- data/lib/sts/iso_sts/copyright_statement.rb +4 -2
- data/lib/sts/iso_sts/copyright_year.rb +3 -0
- data/lib/sts/iso_sts/def.rb +1 -0
- data/lib/sts/iso_sts/def_item.rb +1 -0
- data/lib/sts/iso_sts/def_list.rb +1 -0
- data/lib/sts/iso_sts/disp_formula.rb +5 -1
- data/lib/sts/iso_sts/doc_ref.rb +2 -0
- data/lib/sts/iso_sts/document_identification.rb +3 -0
- data/lib/sts/iso_sts/edition.rb +2 -0
- data/lib/sts/iso_sts/ext_link.rb +1 -1
- data/lib/sts/iso_sts/fig.rb +1 -0
- data/lib/sts/iso_sts/fn.rb +1 -0
- data/lib/sts/iso_sts/fn_group.rb +1 -0
- data/lib/sts/iso_sts/front.rb +5 -0
- data/lib/sts/iso_sts/graphic.rb +5 -0
- data/lib/sts/iso_sts/inline_formula.rb +1 -1
- data/lib/sts/iso_sts/iso_meta.rb +4 -3
- data/lib/sts/iso_sts/italic.rb +23 -11
- data/lib/sts/iso_sts/label.rb +7 -5
- data/lib/sts/iso_sts/language.rb +2 -0
- data/lib/sts/iso_sts/list.rb +1 -0
- data/lib/sts/iso_sts/list_item.rb +7 -4
- data/lib/sts/iso_sts/mathml2/math.rb +20 -18
- data/lib/sts/iso_sts/meta_date.rb +20 -0
- data/lib/sts/iso_sts/mixed_citation.rb +35 -11
- data/lib/sts/iso_sts/monospace.rb +26 -0
- data/lib/sts/iso_sts/named_content.rb +44 -0
- data/lib/sts/iso_sts/nat_meta.rb +5 -4
- data/lib/sts/iso_sts/non_normative_example.rb +5 -0
- data/lib/sts/iso_sts/non_normative_note.rb +1 -0
- data/lib/sts/iso_sts/page_count.rb +2 -0
- data/lib/sts/iso_sts/paragraph.rb +34 -22
- data/lib/sts/iso_sts/permissions.rb +3 -0
- data/lib/sts/iso_sts/preformat.rb +8 -5
- data/lib/sts/iso_sts/ref.rb +1 -0
- data/lib/sts/iso_sts/ref_list.rb +1 -0
- data/lib/sts/iso_sts/reg_meta.rb +5 -4
- data/lib/sts/iso_sts/release_date.rb +2 -0
- data/lib/sts/iso_sts/sc.rb +26 -0
- data/lib/sts/iso_sts/sec.rb +12 -2
- data/lib/sts/iso_sts/secretariat.rb +2 -0
- data/lib/sts/iso_sts/standard.rb +6 -0
- data/lib/sts/iso_sts/standard_cross_reference.rb +5 -2
- data/lib/sts/iso_sts/standard_identification.rb +3 -0
- data/lib/sts/iso_sts/standard_ref.rb +16 -0
- data/lib/sts/iso_sts/std.rb +7 -5
- data/lib/sts/iso_sts/std_ref.rb +2 -0
- data/lib/sts/iso_sts/strike.rb +26 -0
- data/lib/sts/iso_sts/styled_content.rb +19 -15
- data/lib/sts/iso_sts/sub.rb +2 -0
- data/lib/sts/iso_sts/sup.rb +2 -0
- data/lib/sts/iso_sts/table.rb +1 -0
- data/lib/sts/iso_sts/table_wrap.rb +1 -0
- data/lib/sts/iso_sts/table_wrap_foot.rb +3 -0
- data/lib/sts/iso_sts/td.rb +32 -14
- data/lib/sts/iso_sts/term.rb +6 -6
- data/lib/sts/iso_sts/term_sec.rb +1 -0
- data/lib/sts/iso_sts/th.rb +32 -14
- data/lib/sts/iso_sts/title.rb +17 -7
- data/lib/sts/iso_sts/title_compl.rb +2 -0
- data/lib/sts/iso_sts/title_full.rb +2 -0
- data/lib/sts/iso_sts/title_intro.rb +2 -0
- data/lib/sts/iso_sts/title_main.rb +2 -0
- data/lib/sts/iso_sts/title_wrap.rb +1 -0
- data/lib/sts/iso_sts/tr.rb +1 -0
- data/lib/sts/iso_sts/underline.rb +26 -0
- data/lib/sts/iso_sts/uri.rb +32 -0
- data/lib/sts/iso_sts/xref.rb +3 -3
- data/lib/sts/iso_sts.rb +11 -0
- data/lib/sts/mathml.rb +21 -0
- data/lib/sts/namespaces.rb +3 -0
- data/lib/sts/niso_sts/abstract.rb +3 -0
- data/lib/sts/niso_sts/access_date.rb +2 -0
- data/lib/sts/niso_sts/accrediting_organization.rb +2 -0
- data/lib/sts/niso_sts/ack.rb +1 -1
- data/lib/sts/niso_sts/addr_line.rb +2 -0
- data/lib/sts/niso_sts/address.rb +3 -0
- data/lib/sts/niso_sts/adoption.rb +1 -1
- data/lib/sts/niso_sts/adoption_front.rb +1 -0
- data/lib/sts/niso_sts/aff_alternatives.rb +3 -0
- data/lib/sts/niso_sts/alt_text.rb +2 -0
- data/lib/sts/niso_sts/alt_title.rb +2 -0
- data/lib/sts/niso_sts/alternatives.rb +3 -4
- data/lib/sts/niso_sts/annotation.rb +1 -3
- data/lib/sts/niso_sts/anonymous.rb +3 -0
- data/lib/sts/niso_sts/app.rb +16 -1
- data/lib/sts/niso_sts/app_group.rb +5 -0
- data/lib/sts/niso_sts/article_title.rb +2 -0
- data/lib/sts/niso_sts/attrib.rb +2 -0
- data/lib/sts/niso_sts/author_comment.rb +1 -3
- data/lib/sts/niso_sts/author_notes.rb +1 -1
- data/lib/sts/niso_sts/authorization.rb +2 -0
- data/lib/sts/niso_sts/award_group.rb +23 -4
- data/lib/sts/niso_sts/award_id.rb +6 -0
- data/lib/sts/niso_sts/back.rb +25 -6
- data/lib/sts/niso_sts/bio.rb +1 -3
- data/lib/sts/niso_sts/body.rb +38 -0
- data/lib/sts/niso_sts/boxed_text.rb +41 -3
- data/lib/sts/niso_sts/break.rb +14 -0
- data/lib/sts/niso_sts/caption.rb +15 -1
- data/lib/sts/niso_sts/chapter_title.rb +2 -0
- data/lib/sts/niso_sts/chem_struct.rb +2 -0
- data/lib/sts/niso_sts/chem_struct_wrap.rb +1 -0
- data/lib/sts/niso_sts/citation_alternatives.rb +3 -0
- data/lib/sts/niso_sts/city.rb +2 -0
- data/lib/sts/niso_sts/code.rb +111 -0
- data/lib/sts/niso_sts/collab.rb +8 -0
- data/lib/sts/niso_sts/collab_alternatives.rb +3 -0
- data/lib/sts/niso_sts/comm_ref_group.rb +3 -0
- data/lib/sts/niso_sts/comment.rb +2 -0
- data/lib/sts/niso_sts/compound_subject.rb +29 -0
- data/lib/sts/niso_sts/compound_subject_part.rb +39 -0
- data/lib/sts/niso_sts/conf_acronym.rb +2 -0
- data/lib/sts/niso_sts/conf_date.rb +2 -0
- data/lib/sts/niso_sts/conf_loc.rb +2 -0
- data/lib/sts/niso_sts/conf_name.rb +2 -0
- data/lib/sts/niso_sts/conf_num.rb +2 -0
- data/lib/sts/niso_sts/conf_sponsor.rb +2 -0
- data/lib/sts/niso_sts/conf_theme.rb +2 -0
- data/lib/sts/niso_sts/conference.rb +3 -0
- data/lib/sts/niso_sts/content_language.rb +2 -0
- data/lib/sts/niso_sts/contrib.rb +1 -0
- data/lib/sts/niso_sts/contrib_group.rb +1 -0
- data/lib/sts/niso_sts/contrib_id.rb +2 -0
- data/lib/sts/niso_sts/copyright_holder.rb +2 -0
- data/lib/sts/niso_sts/copyright_statement.rb +2 -0
- data/lib/sts/niso_sts/copyright_year.rb +2 -0
- data/lib/sts/niso_sts/country.rb +2 -0
- data/lib/sts/niso_sts/counts.rb +3 -0
- data/lib/sts/niso_sts/custom_meta.rb +3 -0
- data/lib/sts/niso_sts/custom_meta_group.rb +3 -0
- data/lib/sts/niso_sts/data_title.rb +29 -0
- data/lib/sts/niso_sts/date.rb +3 -0
- data/lib/sts/niso_sts/date_in_citation.rb +2 -0
- data/lib/sts/niso_sts/day.rb +2 -0
- data/lib/sts/niso_sts/def.rb +3 -0
- data/lib/sts/niso_sts/def_head.rb +18 -0
- data/lib/sts/niso_sts/def_item.rb +13 -0
- data/lib/sts/niso_sts/def_list.rb +25 -3
- data/lib/sts/niso_sts/degrees.rb +2 -0
- data/lib/sts/niso_sts/disp_formula_group.rb +1 -4
- data/lib/sts/niso_sts/disp_quote.rb +3 -1
- data/lib/sts/niso_sts/display_formula.rb +47 -2
- data/lib/sts/niso_sts/doc_number.rb +2 -0
- data/lib/sts/niso_sts/doc_type.rb +2 -0
- data/lib/sts/niso_sts/document_identification.rb +1 -0
- data/lib/sts/niso_sts/editing_instruction.rb +9 -5
- data/lib/sts/niso_sts/edition.rb +2 -0
- data/lib/sts/niso_sts/element_citation.rb +1 -1
- data/lib/sts/niso_sts/elocation_id.rb +2 -0
- data/lib/sts/niso_sts/email.rb +2 -0
- data/lib/sts/niso_sts/equation_count.rb +2 -0
- data/lib/sts/niso_sts/era.rb +2 -0
- data/lib/sts/niso_sts/ext_link.rb +32 -2
- data/lib/sts/niso_sts/fax.rb +2 -0
- data/lib/sts/niso_sts/fig_count.rb +2 -0
- data/lib/sts/niso_sts/fig_group.rb +1 -0
- data/lib/sts/niso_sts/figure.rb +14 -1
- data/lib/sts/niso_sts/floats_group.rb +3 -4
- data/lib/sts/niso_sts/fn.rb +2 -1
- data/lib/sts/niso_sts/fn_group.rb +3 -0
- data/lib/sts/niso_sts/fpage.rb +2 -0
- data/lib/sts/niso_sts/front.rb +16 -0
- data/lib/sts/niso_sts/funding_group.rb +1 -0
- data/lib/sts/niso_sts/funding_source.rb +2 -0
- data/lib/sts/niso_sts/given_names.rb +2 -0
- data/lib/sts/niso_sts/glossary.rb +1 -1
- data/lib/sts/niso_sts/gov.rb +2 -0
- data/lib/sts/niso_sts/graphic.rb +6 -0
- data/lib/sts/niso_sts/hr.rb +3 -0
- data/lib/sts/niso_sts/ics.rb +5 -0
- data/lib/sts/niso_sts/ics_desc.rb +2 -0
- data/lib/sts/niso_sts/ics_wrap.rb +9 -0
- data/lib/sts/niso_sts/index.rb +32 -0
- data/lib/sts/niso_sts/index_div.rb +30 -0
- data/lib/sts/niso_sts/index_entry.rb +32 -0
- data/lib/sts/niso_sts/index_term.rb +1 -0
- data/lib/sts/niso_sts/index_title_group.rb +22 -0
- data/lib/sts/niso_sts/inline_formula.rb +38 -2
- data/lib/sts/niso_sts/inline_media.rb +50 -0
- data/lib/sts/niso_sts/institution.rb +2 -0
- data/lib/sts/niso_sts/institution_id.rb +2 -0
- data/lib/sts/niso_sts/institution_wrap.rb +3 -0
- data/lib/sts/niso_sts/intro.rb +2 -0
- data/lib/sts/niso_sts/is_proof.rb +2 -0
- data/lib/sts/niso_sts/isbn.rb +2 -0
- data/lib/sts/niso_sts/issn.rb +2 -0
- data/lib/sts/niso_sts/issn_l.rb +2 -0
- data/lib/sts/niso_sts/issue.rb +2 -0
- data/lib/sts/niso_sts/kwd_group.rb +9 -0
- data/lib/sts/niso_sts/label.rb +7 -2
- data/lib/sts/niso_sts/legend.rb +39 -0
- data/lib/sts/niso_sts/license.rb +2 -0
- data/lib/sts/niso_sts/license_p.rb +2 -0
- data/lib/sts/niso_sts/list.rb +9 -2
- data/lib/sts/niso_sts/list_item.rb +9 -4
- data/lib/sts/niso_sts/long_desc.rb +2 -0
- data/lib/sts/niso_sts/lpage.rb +2 -0
- data/lib/sts/niso_sts/main.rb +2 -0
- data/lib/sts/niso_sts/media.rb +1 -0
- data/lib/sts/niso_sts/meta_date.rb +2 -0
- data/lib/sts/niso_sts/meta_note.rb +1 -1
- data/lib/sts/niso_sts/metadata_iso.rb +1 -1
- data/lib/sts/niso_sts/metadata_std.rb +16 -8
- data/lib/sts/niso_sts/milestone_end.rb +1 -3
- data/lib/sts/niso_sts/milestone_start.rb +1 -3
- data/lib/sts/niso_sts/mixed_citation.rb +22 -0
- data/lib/sts/niso_sts/mml_content.rb +0 -2
- data/lib/sts/niso_sts/monospace.rb +9 -0
- data/lib/sts/niso_sts/month.rb +2 -0
- data/lib/sts/niso_sts/name.rb +3 -0
- data/lib/sts/niso_sts/name_alternatives.rb +5 -0
- data/lib/sts/niso_sts/named_content.rb +51 -1
- data/lib/sts/niso_sts/nat_meta.rb +3 -0
- data/lib/sts/niso_sts/nested_kwd.rb +3 -0
- data/lib/sts/niso_sts/nlm_citation.rb +1 -1
- data/lib/sts/niso_sts/non_normative_example.rb +15 -2
- data/lib/sts/niso_sts/non_normative_note.rb +14 -2
- data/lib/sts/niso_sts/normative_example.rb +1 -1
- data/lib/sts/niso_sts/normative_note.rb +3 -1
- data/lib/sts/niso_sts/note.rb +1 -1
- data/lib/sts/niso_sts/notes.rb +1 -1
- data/lib/sts/niso_sts/notes_group.rb +1 -0
- data/lib/sts/niso_sts/object_id.rb +4 -0
- data/lib/sts/niso_sts/on_behalf_of.rb +2 -0
- data/lib/sts/niso_sts/open_access.rb +3 -4
- data/lib/sts/niso_sts/originator.rb +2 -0
- data/lib/sts/niso_sts/page_count.rb +2 -0
- data/lib/sts/niso_sts/page_range.rb +2 -0
- data/lib/sts/niso_sts/paragraph.rb +39 -7
- data/lib/sts/niso_sts/part_number.rb +2 -0
- data/lib/sts/niso_sts/part_of_speech.rb +2 -0
- data/lib/sts/niso_sts/patent.rb +2 -0
- data/lib/sts/niso_sts/permissions.rb +7 -1
- data/lib/sts/niso_sts/phone.rb +2 -0
- data/lib/sts/niso_sts/postal_code.rb +2 -0
- data/lib/sts/niso_sts/prefix.rb +2 -0
- data/lib/sts/niso_sts/preformat.rb +15 -0
- data/lib/sts/niso_sts/price.rb +2 -0
- data/lib/sts/niso_sts/principal_award_recipient.rb +2 -0
- data/lib/sts/niso_sts/principal_investigator.rb +2 -0
- data/lib/sts/niso_sts/private_char.rb +3 -3
- data/lib/sts/niso_sts/processing_meta.rb +54 -0
- data/lib/sts/niso_sts/product.rb +2 -0
- data/lib/sts/niso_sts/proj_id.rb +2 -0
- data/lib/sts/niso_sts/pub_date.rb +4 -0
- data/lib/sts/niso_sts/pub_id.rb +2 -0
- data/lib/sts/niso_sts/publisher.rb +3 -0
- data/lib/sts/niso_sts/publisher_loc.rb +2 -0
- data/lib/sts/niso_sts/publisher_name.rb +2 -0
- data/lib/sts/niso_sts/ref_count.rb +2 -0
- data/lib/sts/niso_sts/reference.rb +1 -0
- data/lib/sts/niso_sts/reference_list.rb +6 -1
- data/lib/sts/niso_sts/reference_standard.rb +4 -2
- data/lib/sts/niso_sts/reg_meta.rb +3 -0
- data/lib/sts/niso_sts/related_term.rb +2 -0
- data/lib/sts/niso_sts/release_date.rb +11 -6
- data/lib/sts/niso_sts/release_version.rb +2 -0
- data/lib/sts/niso_sts/release_version_id.rb +2 -0
- data/lib/sts/niso_sts/role.rb +35 -0
- data/lib/sts/niso_sts/ruby.rb +1 -0
- data/lib/sts/niso_sts/sdo.rb +2 -0
- data/lib/sts/niso_sts/season.rb +2 -0
- data/lib/sts/niso_sts/sec_meta.rb +26 -0
- data/lib/sts/niso_sts/secretariat.rb +2 -0
- data/lib/sts/niso_sts/section.rb +47 -4
- data/lib/sts/niso_sts/see_also_entry.rb +26 -0
- data/lib/sts/niso_sts/see_entry.rb +26 -0
- data/lib/sts/niso_sts/self_uri.rb +2 -0
- data/lib/sts/niso_sts/series.rb +2 -0
- data/lib/sts/niso_sts/series_text.rb +2 -0
- data/lib/sts/niso_sts/series_title.rb +2 -0
- data/lib/sts/niso_sts/sig.rb +2 -0
- data/lib/sts/niso_sts/size.rb +2 -0
- data/lib/sts/niso_sts/source.rb +29 -0
- data/lib/sts/niso_sts/speaker.rb +2 -0
- data/lib/sts/niso_sts/speech.rb +1 -1
- data/lib/sts/niso_sts/standard.rb +3 -0
- data/lib/sts/niso_sts/standard_identification.rb +3 -1
- data/lib/sts/niso_sts/state.rb +2 -0
- data/lib/sts/niso_sts/statement.rb +1 -1
- data/lib/sts/niso_sts/std_doc_meta.rb +50 -11
- data/lib/sts/niso_sts/std_id.rb +2 -0
- data/lib/sts/niso_sts/std_id_group.rb +3 -0
- data/lib/sts/niso_sts/std_org.rb +1 -0
- data/lib/sts/niso_sts/std_org_abbrev.rb +2 -0
- data/lib/sts/niso_sts/std_org_group.rb +3 -0
- data/lib/sts/niso_sts/std_org_name.rb +2 -0
- data/lib/sts/niso_sts/std_organization.rb +2 -0
- data/lib/sts/niso_sts/string_conf.rb +2 -0
- data/lib/sts/niso_sts/string_date.rb +2 -0
- data/lib/sts/niso_sts/string_name.rb +2 -0
- data/lib/sts/niso_sts/styled_content.rb +39 -0
- data/lib/sts/niso_sts/sub.rb +11 -0
- data/lib/sts/niso_sts/subj_group.rb +11 -0
- data/lib/sts/niso_sts/subtitle.rb +2 -0
- data/lib/sts/niso_sts/suffix.rb +2 -0
- data/lib/sts/niso_sts/sup.rb +13 -0
- data/lib/sts/niso_sts/suppl_number.rb +2 -0
- data/lib/sts/niso_sts/suppl_type.rb +2 -0
- data/lib/sts/niso_sts/suppl_version.rb +2 -0
- data/lib/sts/niso_sts/supplementary_material.rb +1 -0
- data/lib/sts/niso_sts/surname.rb +2 -0
- data/lib/sts/niso_sts/table_count.rb +2 -0
- data/lib/sts/niso_sts/table_wrap_group.rb +32 -0
- data/lib/sts/niso_sts/term_display.rb +22 -0
- data/lib/sts/niso_sts/term_display_string.rb +22 -0
- data/lib/sts/niso_sts/term_head.rb +2 -0
- data/lib/sts/niso_sts/term_section.rb +3 -3
- data/lib/sts/niso_sts/term_source.rb +2 -0
- data/lib/sts/niso_sts/tex_math.rb +2 -0
- data/lib/sts/niso_sts/textual_form.rb +2 -0
- data/lib/sts/niso_sts/time_stamp.rb +2 -0
- data/lib/sts/niso_sts/title.rb +26 -0
- data/lib/sts/niso_sts/title_wrap.rb +2 -0
- data/lib/sts/niso_sts/toc.rb +32 -0
- data/lib/sts/niso_sts/toc_div.rb +30 -0
- data/lib/sts/niso_sts/toc_entry.rb +30 -0
- data/lib/sts/niso_sts/toc_title_group.rb +22 -0
- data/lib/sts/niso_sts/trans_abstract.rb +1 -0
- data/lib/sts/niso_sts/trans_source.rb +2 -0
- data/lib/sts/niso_sts/trans_title.rb +2 -0
- data/lib/sts/niso_sts/trans_title_group.rb +3 -0
- data/lib/sts/niso_sts/underline.rb +5 -0
- data/lib/sts/niso_sts/uri.rb +4 -0
- data/lib/sts/niso_sts/urn.rb +2 -0
- data/lib/sts/niso_sts/verse_group.rb +1 -1
- data/lib/sts/niso_sts/verse_line.rb +2 -0
- data/lib/sts/niso_sts/version.rb +2 -0
- data/lib/sts/niso_sts/volume.rb +2 -0
- data/lib/sts/niso_sts/volume_id.rb +2 -0
- data/lib/sts/niso_sts/volume_issue_group.rb +3 -4
- data/lib/sts/niso_sts/volume_series.rb +2 -0
- data/lib/sts/niso_sts/word_count.rb +2 -0
- data/lib/sts/niso_sts/year.rb +2 -0
- data/lib/sts/niso_sts.rb +35 -10
- data/lib/sts/profiles/iso_iec/constraints.rb +43 -0
- data/lib/sts/profiles/iso_iec/validator.rb +73 -0
- data/lib/sts/profiles/iso_iec.rb +10 -0
- data/lib/sts/profiles.rb +7 -0
- data/lib/sts/tbx_iso_tml/bold.rb +30 -1
- data/lib/sts/tbx_iso_tml/caption.rb +3 -0
- data/lib/sts/tbx_iso_tml/col.rb +10 -0
- data/lib/sts/tbx_iso_tml/cross_reference.rb +2 -0
- data/lib/sts/tbx_iso_tml/definition.rb +18 -2
- data/lib/sts/tbx_iso_tml/entailed_term.rb +2 -0
- data/lib/sts/tbx_iso_tml/example.rb +9 -3
- data/lib/sts/tbx_iso_tml/external_graphic.rb +2 -0
- data/lib/sts/tbx_iso_tml/external_source.rb +2 -0
- data/lib/sts/tbx_iso_tml/fn.rb +3 -2
- data/lib/sts/tbx_iso_tml/fn_group.rb +3 -0
- data/lib/sts/tbx_iso_tml/geographical_usage.rb +3 -0
- data/lib/sts/tbx_iso_tml/grammatical_gender.rb +2 -0
- data/lib/sts/tbx_iso_tml/grammatical_number.rb +2 -0
- data/lib/sts/tbx_iso_tml/italic.rb +27 -1
- data/lib/sts/tbx_iso_tml/lang_set.rb +2 -0
- data/lib/sts/tbx_iso_tml/mfenced.rb +2 -0
- data/lib/sts/tbx_iso_tml/mfrac.rb +2 -2
- data/lib/sts/tbx_iso_tml/mi.rb +3 -2
- data/lib/sts/tbx_iso_tml/mrow.rb +2 -2
- data/lib/sts/tbx_iso_tml/mspace.rb +2 -0
- data/lib/sts/tbx_iso_tml/mstyle.rb +2 -2
- data/lib/sts/tbx_iso_tml/msub.rb +2 -0
- data/lib/sts/tbx_iso_tml/msup.rb +4 -1
- data/lib/sts/tbx_iso_tml/munder.rb +3 -0
- data/lib/sts/tbx_iso_tml/munderover.rb +2 -0
- data/lib/sts/tbx_iso_tml/normative_authorization.rb +2 -0
- data/lib/sts/tbx_iso_tml/note.rb +11 -7
- data/lib/sts/tbx_iso_tml/part_of_speech.rb +2 -0
- data/lib/sts/tbx_iso_tml/pronunciation.rb +3 -0
- data/lib/sts/tbx_iso_tml/see.rb +2 -0
- data/lib/sts/tbx_iso_tml/semantics.rb +2 -0
- data/lib/sts/tbx_iso_tml/source.rb +6 -0
- data/lib/sts/tbx_iso_tml/subject_field.rb +2 -0
- data/lib/sts/tbx_iso_tml/sup.rb +3 -2
- data/lib/sts/tbx_iso_tml/table.rb +1 -0
- data/lib/sts/tbx_iso_tml/table_wrap.rb +3 -1
- data/lib/sts/tbx_iso_tml/table_wrap_foot.rb +3 -0
- data/lib/sts/tbx_iso_tml/tbody.rb +9 -1
- data/lib/sts/tbx_iso_tml/td.rb +122 -17
- data/lib/sts/tbx_iso_tml/term.rb +9 -5
- data/lib/sts/tbx_iso_tml/term_type.rb +2 -0
- data/lib/sts/tbx_iso_tml/tfoot.rb +5 -1
- data/lib/sts/tbx_iso_tml/th.rb +133 -18
- data/lib/sts/tbx_iso_tml/thead.rb +9 -1
- data/lib/sts/tbx_iso_tml/tr.rb +16 -0
- data/lib/sts/tbx_iso_tml/xref.rb +2 -2
- data/lib/sts/version.rb +1 -1
- data/lib/sts.rb +1 -2
- data/reference-docs/Guidelines for coding ed.2.1.pdf +0 -0
- data/reference-docs/NISO-STS-1-2-compare-1-0.pdf +0 -0
- data/reference-docs/NISOSTS-guidelines-v1.0.pdf +0 -0
- metadata +76 -3
- data/lib/sts/niso_sts/mathml.rb +0 -69
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# 02: Type Resolution Anti-Pattern Fix
|
|
2
|
+
|
|
3
|
+
**Priority**: HIGH
|
|
4
|
+
**Category**: Anti-Pattern Elimination
|
|
5
|
+
**Estimated Effort**: Low
|
|
6
|
+
**Files Affected**: `lib/sts/content_groups/helpers.rb`
|
|
7
|
+
|
|
8
|
+
## Problem
|
|
9
|
+
|
|
10
|
+
Current `lib/sts/content_groups/helpers.rb` uses `Object.const_get` for type resolution:
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
def inject_elements(klass, elements)
|
|
14
|
+
elements.each do |name, type_name, _, is_collection|
|
|
15
|
+
type = Object.const_get(type_name) # Anti-pattern
|
|
16
|
+
coll = is_collection.nil? || is_collection
|
|
17
|
+
klass.attribute name, type, collection: coll
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Why This Is Wrong
|
|
23
|
+
|
|
24
|
+
1. **`Object.const_get`**: String-based lookup, no compile-time checking, fragile to typos
|
|
25
|
+
2. **Hidden dependency**: No `require` statement indicates the dependency
|
|
26
|
+
3. **Security risk**: Can resolve arbitrary constants if input is user-controlled
|
|
27
|
+
4. **Performance**: Resolved at runtime, not cached efficiently
|
|
28
|
+
|
|
29
|
+
## Solution
|
|
30
|
+
|
|
31
|
+
### Option A: Direct Constant Reference
|
|
32
|
+
|
|
33
|
+
Pass actual class objects instead of strings:
|
|
34
|
+
|
|
35
|
+
```ruby
|
|
36
|
+
module Sts
|
|
37
|
+
module ContentGroups
|
|
38
|
+
module Helpers
|
|
39
|
+
module_function
|
|
40
|
+
|
|
41
|
+
# Elements is now [[:attribute_name, Class, nil, is_collection?], ...]
|
|
42
|
+
def inject_elements(klass, elements)
|
|
43
|
+
elements.each do |name, type, _, is_collection|
|
|
44
|
+
coll = is_collection.nil? || is_collection
|
|
45
|
+
klass.attribute name, type, collection: coll
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def inject_element_mappings(klass, mappings)
|
|
50
|
+
mappings.each do |xml_name, type, ruby_name|
|
|
51
|
+
klass.xml { map_element xml_name, to: ruby_name }
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Option B: Register-Based Resolution
|
|
60
|
+
|
|
61
|
+
Use lutaml-model's register system:
|
|
62
|
+
|
|
63
|
+
```ruby
|
|
64
|
+
module Sts
|
|
65
|
+
module ContentGroups
|
|
66
|
+
module Helpers
|
|
67
|
+
module_function
|
|
68
|
+
|
|
69
|
+
def resolve_type(type_identifier)
|
|
70
|
+
case type_identifier
|
|
71
|
+
when Module then type_identifier
|
|
72
|
+
when Symbol
|
|
73
|
+
Lutaml::Model::GlobalRegister.resolve(type_identifier) ||
|
|
74
|
+
raise(ArgumentError, "Unknown type: #{type_identifier}")
|
|
75
|
+
else
|
|
76
|
+
raise(TypeError, "Expected Module or Symbol, got #{type_identifier.class}")
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def inject_elements(klass, elements)
|
|
81
|
+
elements.each do |name, type, _, is_collection|
|
|
82
|
+
resolved_type = resolve_type(type)
|
|
83
|
+
coll = is_collection.nil? || is_collection
|
|
84
|
+
klass.attribute name, resolved_type, collection: coll
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Files Using This Helper
|
|
93
|
+
|
|
94
|
+
Need to update all callers to pass class objects:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
grep -r "inject_elements\|inject_element_mappings" lib/sts/
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Expected to find calls in:
|
|
101
|
+
- `lib/sts/iso_sts/content_groups/*.rb`
|
|
102
|
+
- `lib/sts/niso_sts/content_groups/*.rb`
|
|
103
|
+
|
|
104
|
+
## Verification
|
|
105
|
+
|
|
106
|
+
1. All callers pass actual class constants, not strings
|
|
107
|
+
2. `bundle exec rubocop lib/sts/content_groups/helpers.rb` passes
|
|
108
|
+
3. All specs pass — types resolved at class definition time
|
|
109
|
+
|
|
110
|
+
## Dependencies
|
|
111
|
+
|
|
112
|
+
None — can be done independently.
|
|
113
|
+
|
|
114
|
+
## TODO Checklist
|
|
115
|
+
|
|
116
|
+
- [ ] Read `lib/sts/content_groups/helpers.rb`
|
|
117
|
+
- [ ] Find all callers: `grep -r "inject_elements\|inject_element_mappings" lib/sts/`
|
|
118
|
+
- [ ] Choose Option A or B
|
|
119
|
+
- [ ] Update helper methods
|
|
120
|
+
- [ ] Update all callers to pass class objects
|
|
121
|
+
- [ ] Verify no `Object.const_get` remains
|
|
122
|
+
- [ ] Run full test suite
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# 03: Namespace Coupling Architecture Fix
|
|
2
|
+
|
|
3
|
+
**Priority**: HIGH
|
|
4
|
+
**Category**: Architecture
|
|
5
|
+
**Estimated Effort**: High
|
|
6
|
+
**Files Affected**: `lib/sts/iso_sts/content_groups/highlight_elements.rb` (194+ references)
|
|
7
|
+
|
|
8
|
+
## Problem
|
|
9
|
+
|
|
10
|
+
`lib/sts/iso_sts/content_groups/highlight_elements.rb` contains 194+ references to `Sts::NisoSts::*` types:
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
# Examples from highlight_elements.rb
|
|
14
|
+
[:sub, "Sts::NisoSts::Sub", "sub"]
|
|
15
|
+
[:sup, "Sts::NisoSts::Sup", "sup"]
|
|
16
|
+
[:italic, "Sts::NisoSts::Italic", "italic"]
|
|
17
|
+
[:bold, "Sts::NisoSts::Bold", "bold"]
|
|
18
|
+
# ... 190 more
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Why This Is Wrong
|
|
22
|
+
|
|
23
|
+
1. **Violation of namespace isolation**: IsoSts should not depend on NisoSts implementation
|
|
24
|
+
2. **Shared-namespace ambiguity**: These elements appear in both ISOSTS and NISO STS but with different attribute sets
|
|
25
|
+
3. **Tight coupling**: Changes to NisoSts can break IsoSts
|
|
26
|
+
4. **Schema divergence ignored**: `<p>` in ISOSTS has different attributes than `<p>` in NISO STS Extended
|
|
27
|
+
|
|
28
|
+
### Root Cause
|
|
29
|
+
|
|
30
|
+
The schemas ARE different:
|
|
31
|
+
- ISOSTS `<p>`: `@content-type, @id, @specific-use, @xml:lang`
|
|
32
|
+
- NISO STS Extended `<p>`: `@content-type, @id, @originator, @specific-use, @style-type, @xml:base, @xml:lang`
|
|
33
|
+
|
|
34
|
+
## Solution: Three-Tier Architecture
|
|
35
|
+
|
|
36
|
+
### Tier 1: Shared Base Types
|
|
37
|
+
|
|
38
|
+
Create shared types in `Sts::Base` that both namespaces inherit:
|
|
39
|
+
|
|
40
|
+
```ruby
|
|
41
|
+
# lib/sts/base/text/emphasis.rb
|
|
42
|
+
module Sts
|
|
43
|
+
module Base
|
|
44
|
+
module Text
|
|
45
|
+
class Emphasis < Lutaml::Model::Serializable
|
|
46
|
+
# Shared attributes/methods
|
|
47
|
+
attribute :id, :string
|
|
48
|
+
attribute :base_fontsize, :string
|
|
49
|
+
attribute :baseline_shift, :string
|
|
50
|
+
attribute :color, :string
|
|
51
|
+
|
|
52
|
+
xml do
|
|
53
|
+
map_attribute :id, to: :id
|
|
54
|
+
# ...
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
class Bold < Emphasis
|
|
59
|
+
xml { element "bold" }
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
class Italic < Emphasis
|
|
63
|
+
xml { element "italic" }
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
class Sub < Emphasis
|
|
67
|
+
xml { element "sub" }
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
class Sup < Emphasis
|
|
71
|
+
xml { element "sup" }
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Tier 2: IsoSts-Specific Extensions
|
|
79
|
+
|
|
80
|
+
```ruby
|
|
81
|
+
# lib/sts/iso_sts/text/emphasis.rb
|
|
82
|
+
module Sts
|
|
83
|
+
module IsoSts
|
|
84
|
+
module Text
|
|
85
|
+
class Bold < ::Sts::Base::Text::Bold
|
|
86
|
+
# Add IsoSts-specific attributes
|
|
87
|
+
attribute :content_type, :string
|
|
88
|
+
|
|
89
|
+
xml do
|
|
90
|
+
# Override/add IsoSts-specific mapping
|
|
91
|
+
map_attribute "content-type", to: :content_type
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Tier 3: NisoSts-Specific Extensions
|
|
100
|
+
|
|
101
|
+
```ruby
|
|
102
|
+
# lib/sts/niso_sts/text/emphasis.rb
|
|
103
|
+
module Sts
|
|
104
|
+
module NisoSts
|
|
105
|
+
module Text
|
|
106
|
+
class Bold < ::Sts::Base::Text::Bold
|
|
107
|
+
# Add NisoSts-specific attributes
|
|
108
|
+
attribute :originator, :string
|
|
109
|
+
attribute :style_type, :string
|
|
110
|
+
|
|
111
|
+
xml do
|
|
112
|
+
map_attribute "originator", to: :originator
|
|
113
|
+
map_attribute "style-type", to: :style_type
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Implementation Strategy
|
|
122
|
+
|
|
123
|
+
1. **Phase 1**: Identify all shared element types (bold, italic, sub, sup, p, etc.)
|
|
124
|
+
2. **Phase 2**: Create base types with MINIMAL shared attributes
|
|
125
|
+
3. **Phase 3**: Refactor IsoSts to extend bases
|
|
126
|
+
4. **Phase 4**: Refactor NisoSts to extend bases
|
|
127
|
+
5. **Phase 5**: Delete `Sts::NisoSts::*` references from IsoSts content groups
|
|
128
|
+
|
|
129
|
+
## Files to Refactor
|
|
130
|
+
|
|
131
|
+
Primary targets:
|
|
132
|
+
- `lib/sts/iso_sts/content_groups/highlight_elements.rb`
|
|
133
|
+
- `lib/sts/iso_sts/content_groups/emphasis_elements.rb` (if exists)
|
|
134
|
+
- `lib/sts/niso_sts/content_groups/highlight_elements.rb`
|
|
135
|
+
|
|
136
|
+
## Verification
|
|
137
|
+
|
|
138
|
+
1. No `Sts::NisoSts` references in `lib/sts/iso_sts/`
|
|
139
|
+
2. All round-trip tests pass
|
|
140
|
+
3. Schema validation against both ISOSTS DTD and NISO STS XSD passes
|
|
141
|
+
|
|
142
|
+
## Dependencies
|
|
143
|
+
|
|
144
|
+
- `01-mathml-delegation.md` — uses similar patterns
|
|
145
|
+
- `02-type-resolution.md` — must be clean first
|
|
146
|
+
|
|
147
|
+
## TODO Checklist
|
|
148
|
+
|
|
149
|
+
- [ ] Audit all IsoSts → NisoSts references
|
|
150
|
+
- [ ] Categorize by shared vs. truly namespace-specific
|
|
151
|
+
- [ ] Design base type hierarchy
|
|
152
|
+
- [ ] Create `lib/sts/base/` directory structure
|
|
153
|
+
- [ ] Implement base types for shared elements
|
|
154
|
+
- [ ] Refactor IsoSts to use base types
|
|
155
|
+
- [ ] Refactor NisoSts to use base types
|
|
156
|
+
- [ ] Remove cross-namespace references
|
|
157
|
+
- [ ] Verify no circular dependencies
|
|
158
|
+
- [ ] Run full test suite
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# 04: Schema Versioning via lutaml-model Registers
|
|
2
|
+
|
|
3
|
+
**Priority**: HIGH
|
|
4
|
+
**Category**: Architecture
|
|
5
|
+
**Estimated Effort**: Very High
|
|
6
|
+
**Files Affected**: New architecture, all model files
|
|
7
|
+
|
|
8
|
+
## Problem
|
|
9
|
+
|
|
10
|
+
Currently sts-ruby uses flat module namespaces (`IsoSts`, `NisoSts`) with no versioning. Real-world standards have multiple schema versions that differ in element sets and attributes:
|
|
11
|
+
|
|
12
|
+
- **ISOSTS v1.1** (2013, frozen DTD)
|
|
13
|
+
- **NISO STS 1.0** (2017, DTD/XSD/RNG, interchange + extended)
|
|
14
|
+
- **NISO STS 1.2** (2022, backwards compatible with NISO STS 1.0)
|
|
15
|
+
|
|
16
|
+
Schema differences exist on the same element names (e.g., `<p>` attributes differ between ISOSTS and NISO STS Extended).
|
|
17
|
+
|
|
18
|
+
## Reference: mml Gem Pattern
|
|
19
|
+
|
|
20
|
+
The mml gem provides the correct versioning architecture:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
mml/
|
|
24
|
+
├── lib/mml.rb # Top-level entry, requires version modules
|
|
25
|
+
├── lib/mml/
|
|
26
|
+
│ ├── base/ # Shared mixins via `included` hook
|
|
27
|
+
│ │ ├── math.rb # Mml::Base::Math module
|
|
28
|
+
│ │ ├── mi.rb # Mml::Base::Mi module
|
|
29
|
+
│ │ └── ...
|
|
30
|
+
│ ├── v2/ # MathML 2.0 versioned classes
|
|
31
|
+
│ │ ├── math.rb # Mml::V2::Math < Serializable; includes Mml::Base::Math
|
|
32
|
+
│ │ ├── mi.rb # Mml::V2::Mi < Serializable; includes Mml::Base::Mi
|
|
33
|
+
│ │ └── configuration.rb # Mml::V2::Configuration with CONTEXT_ID = :mml_v2
|
|
34
|
+
│ ├── v3/ # MathML 3.0 versioned classes
|
|
35
|
+
│ │ ├── math.rb # Mml::V3::Math < Serializable; includes Mml::Base::Math
|
|
36
|
+
│ │ ├── configuration.rb # Mml::V3::Configuration with CONTEXT_ID = :mml_v3
|
|
37
|
+
│ │ └── ...
|
|
38
|
+
│ └── configuration.rb # Mml::Configuration, dispatches to version
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Key Mechanisms
|
|
42
|
+
|
|
43
|
+
1. **Register per version**: Each version creates a `Lutaml::Model::Register` with unique ID
|
|
44
|
+
2. **`lutaml_default_register`**: Class method on each versioned class points to its register
|
|
45
|
+
3. **Shared modules**: `Mml::Base::*` mixins define shared attributes/behavior via `included` hook
|
|
46
|
+
4. **Version-specific classes**: `Mml::V3::Math` extends shared module with V3-specific attributes
|
|
47
|
+
|
|
48
|
+
```ruby
|
|
49
|
+
# From mml gem
|
|
50
|
+
module Mml
|
|
51
|
+
module V3
|
|
52
|
+
class Configuration
|
|
53
|
+
CONTEXT_ID = :mml_v3
|
|
54
|
+
|
|
55
|
+
def self.register_model(klass, id:)
|
|
56
|
+
register = Lutaml::Model::Register.new(id: CONTEXT_ID)
|
|
57
|
+
register.register_model(klass, id: id)
|
|
58
|
+
klass.define_singleton_method(:lutaml_default_register) { register }
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Proposed Architecture for sts-ruby
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
lib/sts/
|
|
69
|
+
├── base/ # Shared element modules (Tier 1)
|
|
70
|
+
│ ├── text/ # Bold, Italic, Sub, Sup, etc.
|
|
71
|
+
│ ├── struct/ # Section, Paragraph, List, etc.
|
|
72
|
+
│ ├── meta/ # Title, Label, Caption, etc.
|
|
73
|
+
│ └── refs/ # Xref, BiblioRef, etc.
|
|
74
|
+
├── iso_sts/ # ISOSTS v1.1 (frozen)
|
|
75
|
+
│ ├── v1_1/ # ISOSTS v1.1 classes
|
|
76
|
+
│ │ ├── standard.rb # IsoSts::V1_1::Standard
|
|
77
|
+
│ │ ├── paragraph.rb # IsoSts::V1_1::Paragraph (ISOSTS-specific attributes)
|
|
78
|
+
│ │ └── configuration.rb # IsoSts::V1_1::Configuration
|
|
79
|
+
│ └── iso_sts.rb
|
|
80
|
+
├── niso_sts/ # NISO STS (evolving)
|
|
81
|
+
│ ├── v1_0/ # NISO STS 1.0 classes
|
|
82
|
+
│ │ ├── standard.rb # NisoSts::V1_0::Standard
|
|
83
|
+
│ │ ├── paragraph.rb # NisoSts::V1_0::Paragraph
|
|
84
|
+
│ │ └── configuration.rb # NisoSts::V1_0::Configuration
|
|
85
|
+
│ ├── v1_2/ # NISO STS 1.2 classes (extends v1_0)
|
|
86
|
+
│ │ ├── processing_meta.rb # New in 1.2
|
|
87
|
+
│ │ ├── code.rb # New in 1.2
|
|
88
|
+
│ │ ├── standard.rb # NisoSts::V1_2::Standard (adds processing-meta)
|
|
89
|
+
│ │ └── configuration.rb # NisoSts::V1_2::Configuration
|
|
90
|
+
│ └── niso_sts.rb
|
|
91
|
+
├── tbx_iso_tml/ # TBX (versioned with ISO 30042)
|
|
92
|
+
└── sts.rb # Top-level entry point
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Register Registration Pattern
|
|
96
|
+
|
|
97
|
+
```ruby
|
|
98
|
+
module Sts
|
|
99
|
+
module NisoSts
|
|
100
|
+
module V1_0
|
|
101
|
+
class Configuration
|
|
102
|
+
CONTEXT_ID = :niso_sts_v1_0
|
|
103
|
+
|
|
104
|
+
def self.setup!
|
|
105
|
+
register = Lutaml::Model::Register.new(id: CONTEXT_ID)
|
|
106
|
+
# Register all V1_0 models
|
|
107
|
+
Dir[File.join(__dir__, '*.rb')].sort.each do |f|
|
|
108
|
+
require f
|
|
109
|
+
end
|
|
110
|
+
# Set default register for each class
|
|
111
|
+
constants.each do |c|
|
|
112
|
+
klass = const_get(c)
|
|
113
|
+
next unless klass.is_a?(Class) && klass < Lutaml::Model::Serializable
|
|
114
|
+
klass.define_singleton_method(:lutaml_default_register) { register }
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Migration Strategy
|
|
124
|
+
|
|
125
|
+
### Phase 1: Create Register Infrastructure
|
|
126
|
+
- Create `Sts::Configuration` with register setup
|
|
127
|
+
- Create base register for `:iso_sts_v1_1` and `:niso_sts_v1_0`
|
|
128
|
+
|
|
129
|
+
### Phase 2: Create Base Types
|
|
130
|
+
- Extract shared elements from both namespaces into `Sts::Base::*`
|
|
131
|
+
- See `03-namespace-coupling.md` for details
|
|
132
|
+
|
|
133
|
+
### Phase 3: Version the Models
|
|
134
|
+
- Rename current `Sts::IsoSts::*` → `Sts::IsoSts::V1_1::*`
|
|
135
|
+
- Rename current `Sts::NisoSts::*` → `Sts::NisoSts::V1_0::*`
|
|
136
|
+
- Set `lutaml_default_register` on each versioned class
|
|
137
|
+
|
|
138
|
+
### Phase 4: Backward Compatibility Shims
|
|
139
|
+
- Provide temporary aliases at current paths:
|
|
140
|
+
```ruby
|
|
141
|
+
module Sts
|
|
142
|
+
module IsoSts
|
|
143
|
+
# Temporary backward compat - remove in next major version
|
|
144
|
+
Standard = V1_1::Standard
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
```
|
|
148
|
+
- Mark for deprecation in next major release
|
|
149
|
+
|
|
150
|
+
### Phase 5: Add NISO STS 1.2 Support
|
|
151
|
+
- Create `Sts::NisoSts::V1_2` namespace
|
|
152
|
+
- Extend V1_0 models with 1.2 additions
|
|
153
|
+
- See `05-missing-elements.md` for NISO STS 1.2 additions
|
|
154
|
+
|
|
155
|
+
## Verification
|
|
156
|
+
|
|
157
|
+
1. `bundle exec rspec` passes with versioned model loading
|
|
158
|
+
2. ISOSTS documents parse with ISOSTS register
|
|
159
|
+
3. NISO STS 1.0 documents parse with NISO STS 1.0 register
|
|
160
|
+
4. No cross-register contamination
|
|
161
|
+
|
|
162
|
+
## Dependencies
|
|
163
|
+
|
|
164
|
+
- `01-mathml-delegation.md` — MathML already follows this pattern
|
|
165
|
+
- `02-type-resolution.md` — Register provides type resolution
|
|
166
|
+
- `03-namespace-coupling.md` — Base types needed for versioning
|
|
167
|
+
|
|
168
|
+
## TODO Checklist
|
|
169
|
+
|
|
170
|
+
- [ ] Read `lutaml-model` register/global_register source
|
|
171
|
+
- [ ] Read mml gem's versioning pattern fully
|
|
172
|
+
- [ ] Design sts-ruby register architecture
|
|
173
|
+
- [ ] Create `Sts::Configuration` with register setup
|
|
174
|
+
- [ ] Phase 1: Register infrastructure
|
|
175
|
+
- [ ] Phase 2: Base types (coordinated with 03-namespace-coupling)
|
|
176
|
+
- [ ] Phase 3: Version models
|
|
177
|
+
- [ ] Phase 4: Backward compat shims
|
|
178
|
+
- [ ] Phase 5: NISO STS 1.2 support
|
|
179
|
+
- [ ] Update tests for versioned parsing
|
|
180
|
+
- [ ] Document API changes
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# 05: Missing Elements Implementation
|
|
2
|
+
|
|
3
|
+
**Priority**: HIGH
|
|
4
|
+
**Category**: Feature Gap
|
|
5
|
+
**Estimated Effort**: High
|
|
6
|
+
**Files Affected**: New model files, autoload entries
|
|
7
|
+
|
|
8
|
+
## Elements Missing from sts-ruby
|
|
9
|
+
|
|
10
|
+
### Critical (Round-Trip Impact)
|
|
11
|
+
|
|
12
|
+
#### `<processing-meta>` (NISO STS 1.2)
|
|
13
|
+
- **Parent**: `<standard>` (peer to `<front>`, `<body>`, `<back>`)
|
|
14
|
+
- **Attributes**: `@tagset-family`, `@base-tagset`, `@table-model`, `@mathml`, `@math-representation`, `@terminology-model`
|
|
15
|
+
- **Children**: `<extended-by>`, `<restricted-by>`, `<custom-meta-group>`
|
|
16
|
+
- **Reference**: NISO STS 1.2 comparison doc, Section 3
|
|
17
|
+
|
|
18
|
+
#### `<code>` (NISO STS 1.2)
|
|
19
|
+
- **Parents**: `<p>`, `<sec>`, `<list-item>`, and many block contexts
|
|
20
|
+
- **Attributes**: `@code-type`, `@code-version`, `@content-type`, `@executable`, `@id`, `@language`, `@language-version`, `@xml:base`, `@xml:lang`
|
|
21
|
+
- **Content**: Mixed (text + inline elements)
|
|
22
|
+
- **Reference**: NISO STS 1.2, Section 4
|
|
23
|
+
|
|
24
|
+
#### `<inline-code>` (NISO STS 1.2)
|
|
25
|
+
- **Parents**: Inline contexts
|
|
26
|
+
- **Attributes**: Same pattern as `<code>` but for inline usage
|
|
27
|
+
- **Reference**: NISO STS 1.2, Section 4
|
|
28
|
+
|
|
29
|
+
#### `<legend>` (NISO STS 1.2)
|
|
30
|
+
- **Parents**: `<boxed-text>`, `<chem-struct-wrap>`, `<disp-formula>`, `<disp-formula-group>`, `<fig>`, `<fig-group>`, `<graphic>`, `<media>`, `<supplementary-material>`, `<table-wrap>`, `<table-wrap-group>`
|
|
31
|
+
- **Children**: Mixed content with emphasis elements
|
|
32
|
+
- **Reference**: NISO STS 1.2, Section 4
|
|
33
|
+
|
|
34
|
+
#### `<inline-media>` (NISO STS 1.2)
|
|
35
|
+
- **Parents**: Inline contexts
|
|
36
|
+
- **Attributes**: Standard media attributes
|
|
37
|
+
- **Reference**: NISO STS 1.2, Section 4
|
|
38
|
+
|
|
39
|
+
#### `<sub-part-number>` (NISO STS 1.2)
|
|
40
|
+
- **Parent**: `<std-ident>`
|
|
41
|
+
- **Content**: String
|
|
42
|
+
- **Reference**: NISO STS 1.2, Section 4
|
|
43
|
+
|
|
44
|
+
#### `<index>` Hierarchy
|
|
45
|
+
- `<index>` — container for back matter index
|
|
46
|
+
- `<index-div>` — index division
|
|
47
|
+
- `<index-entry>` — individual index entry
|
|
48
|
+
- `<index-title-group>` — index title
|
|
49
|
+
- `<index-term-range-end>` — range end marker
|
|
50
|
+
- `<see-entry>` — "see" cross-reference
|
|
51
|
+
- `<see-also-entry>` — "see also" cross-reference
|
|
52
|
+
- **Reference**: GAPS.guidelines.schema-xref.md
|
|
53
|
+
|
|
54
|
+
#### `<toc>` Hierarchy
|
|
55
|
+
- `<toc>` — table of contents container (in `<front>`)
|
|
56
|
+
- `<toc-div>` — TOC division
|
|
57
|
+
- `<toc-entry>` — TOC entry
|
|
58
|
+
- `<toc-title-group>` — TOC title
|
|
59
|
+
- `<toc-group>` — TOC group (in `<sec>`)
|
|
60
|
+
- **Reference**: GAPS.guidelines.schema-xrf.md
|
|
61
|
+
|
|
62
|
+
#### `<table-wrap-group>`
|
|
63
|
+
- **Parents**: `<sec>`, `<app>`
|
|
64
|
+
- **Children**: `<table-wrap>` collection
|
|
65
|
+
- **Reference**: GAPS.guidelines.schema-xref.md
|
|
66
|
+
|
|
67
|
+
#### `<sec-meta>`
|
|
68
|
+
- **Parent**: `<sec>`
|
|
69
|
+
- **Content**: Section metadata
|
|
70
|
+
- **Reference**: GAPS.guidelines.schema-xref.md
|
|
71
|
+
|
|
72
|
+
#### `<std-doc-meta>`
|
|
73
|
+
- **Parent**: `<front>`
|
|
74
|
+
- **Content**: Standard document metadata
|
|
75
|
+
- **Reference**: GAPS.guidelines.schema-xref.md
|
|
76
|
+
|
|
77
|
+
### Table Model (OASIS CALS) — Lower Priority
|
|
78
|
+
|
|
79
|
+
| Element | Notes |
|
|
80
|
+
|---------|-------|
|
|
81
|
+
| `<tgroup>` | Table group with column specs |
|
|
82
|
+
| `<colspec>` | Column specification |
|
|
83
|
+
| `<row>` | Table row |
|
|
84
|
+
| `<entry>` | Table cell |
|
|
85
|
+
|
|
86
|
+
Most modern ISO documents use XHTML tables. OASIS CALS needed for legacy documents.
|
|
87
|
+
|
|
88
|
+
### Less Critical / Edge Cases
|
|
89
|
+
|
|
90
|
+
| Element | Notes |
|
|
91
|
+
|---------|-------|
|
|
92
|
+
| `<abbrev>` | Abbreviation display element |
|
|
93
|
+
| `<article-categories>` | JATS legacy — skip for NISO STS |
|
|
94
|
+
| `<article-id>` | JATS legacy — skip |
|
|
95
|
+
| `<article-meta>` | JATS legacy — skip |
|
|
96
|
+
| `<compl-title-wrap>` | Complementary title wrap |
|
|
97
|
+
| `<compound-subject>` | Compound subject |
|
|
98
|
+
| `<compound-subject-part>` | Part of compound subject |
|
|
99
|
+
| `<count>` | Count element |
|
|
100
|
+
| `<fallback>` | Alternatives fallback |
|
|
101
|
+
| `<fixed-case>` | Fixed-case text |
|
|
102
|
+
| `<free_to_read>` | ALI namespace |
|
|
103
|
+
| `<glyph-data>` | Private character glyph data |
|
|
104
|
+
| `<glyph-ref>` | Private character glyph reference |
|
|
105
|
+
| `<include>` | XInclude element |
|
|
106
|
+
| `<intro-title-wrap>` | Introduction title wrap |
|
|
107
|
+
| `<issue-id>` | Journal issue ID — skip |
|
|
108
|
+
| `<issue-part>` | Journal issue part — skip |
|
|
109
|
+
| `<issue-sponsor>` | Journal issue sponsor — skip |
|
|
110
|
+
| `<issue-title>` | Journal issue title — skip |
|
|
111
|
+
| `<journal-id>` | Journal ID — skip |
|
|
112
|
+
| `<license_ref>` | ALI license reference |
|
|
113
|
+
| `<main-title-wrap>` | Main title wrap |
|
|
114
|
+
| `<nav-pointer>` | Navigation pointer |
|
|
115
|
+
| `<nav-pointer-group>` | Navigation pointer group |
|
|
116
|
+
| `<num>` | Number element |
|
|
117
|
+
| `<overline-end>` | Overline end marker |
|
|
118
|
+
| `<overline-start>` | Overline start marker |
|
|
119
|
+
| `<part-title>` | Part title |
|
|
120
|
+
| `<sub-part>` | Sub-part element |
|
|
121
|
+
| `<title-group>` | Title group |
|
|
122
|
+
| `<trans-subtitle>` | Translated subtitle |
|
|
123
|
+
| `<underline-end>` | Underline end marker |
|
|
124
|
+
| `<underline-start>` | Underline start marker |
|
|
125
|
+
| `<term-display-string>` | New in NISO STS 1.2 |
|
|
126
|
+
|
|
127
|
+
## Implementation Order
|
|
128
|
+
|
|
129
|
+
1. `<processing-meta>` — needed for schema validation routing
|
|
130
|
+
2. `<code>` and `<inline-code>` — high frequency in real documents
|
|
131
|
+
3. `<legend>` — needed for formula/figure keys
|
|
132
|
+
4. `<inline-media>` — straightforward
|
|
133
|
+
5. `<index>` hierarchy — needed for back matter
|
|
134
|
+
6. `<toc>` hierarchy — needed for front matter
|
|
135
|
+
7. `<table-wrap-group>` — grouped table handling
|
|
136
|
+
8. `<sec-meta>` and `<std-doc-meta>` — structural metadata
|
|
137
|
+
9. OASIS CALS tables — legacy support
|
|
138
|
+
10. Edge case elements — as needed
|
|
139
|
+
|
|
140
|
+
## File Structure
|
|
141
|
+
|
|
142
|
+
Each new element follows the established pattern:
|
|
143
|
+
|
|
144
|
+
```ruby
|
|
145
|
+
# lib/sts/niso_sts/processing_meta.rb
|
|
146
|
+
module Sts
|
|
147
|
+
module NisoSts
|
|
148
|
+
class ProcessingMeta < Lutaml::Model::Serializable
|
|
149
|
+
attribute :tagset_family, :string
|
|
150
|
+
attribute :base_tagset, :string
|
|
151
|
+
attribute :table_model, :string
|
|
152
|
+
attribute :mathml, :string
|
|
153
|
+
attribute :math_representation, :string
|
|
154
|
+
attribute :terminology_model, :string
|
|
155
|
+
attribute :extended_by, ExtendedBy, collection: true
|
|
156
|
+
attribute :restricted_by, RestrictedBy, collection: true
|
|
157
|
+
attribute :custom_meta_group, CustomMetaGroup
|
|
158
|
+
|
|
159
|
+
xml do
|
|
160
|
+
element "processing-meta"
|
|
161
|
+
map_attribute "tagset-family", to: :tagset_family
|
|
162
|
+
map_attribute "base-tagset", to: :base_tagset
|
|
163
|
+
map_attribute "table-model", to: :table_model
|
|
164
|
+
map_attribute "mathml", to: :mathml
|
|
165
|
+
map_attribute "math-representation", to: :math_representation
|
|
166
|
+
map_attribute "terminology-model", to: :terminology_model
|
|
167
|
+
map_element "extended-by", to: :extended_by
|
|
168
|
+
map_element "restricted-by", to: :restricted_by
|
|
169
|
+
map_element "custom-meta-group", to: :custom_meta_group
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Dependencies
|
|
177
|
+
|
|
178
|
+
- `04-register-versioning.md` — new elements should be registered in appropriate version namespace
|
|
179
|
+
|
|
180
|
+
## TODO Checklist
|
|
181
|
+
|
|
182
|
+
- [x] `<processing-meta>` with all attributes
|
|
183
|
+
- [x] `<code>` and `<inline-code>`
|
|
184
|
+
- [x] `<legend>`
|
|
185
|
+
- [x] `<inline-media>`
|
|
186
|
+
- [x] `<sub-part-number>` in `<std-ident>`
|
|
187
|
+
- [x] `<index>` hierarchy (7 elements)
|
|
188
|
+
- [x] `<toc>` hierarchy (5 elements)
|
|
189
|
+
- [x] `<table-wrap-group>`
|
|
190
|
+
- [x] `<sec-meta>`
|
|
191
|
+
- [x] `<std-doc-meta>` (expanded to full XSD model)
|
|
192
|
+
- [x] `<term-display-string>` (NISO STS 1.2)
|
|
193
|
+
- [ ] OASIS CALS table elements
|
|
194
|
+
- [x] Update autoload entries for all new elements
|
|
195
|
+
- [x] Add/update round-trip tests for each element
|