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,152 @@
|
|
|
1
|
+
# 06: Missing Attributes Implementation
|
|
2
|
+
|
|
3
|
+
**Priority**: HIGH
|
|
4
|
+
**Category**: Feature Gap
|
|
5
|
+
**Estimated Effort**: Medium
|
|
6
|
+
**Files Affected**: Existing model files
|
|
7
|
+
|
|
8
|
+
## `@id` Missing on Elements (From Guidelines Sec 3.4)
|
|
9
|
+
|
|
10
|
+
The IEC/ISO Coding Guidelines ed.2.1 Section 3.4 lists elements that MUST carry `@id`. These are missing in sts-ruby:
|
|
11
|
+
|
|
12
|
+
| Element | Current Model | Has `@id` | Fix |
|
|
13
|
+
|---------|--------------|-----------|-----|
|
|
14
|
+
| `<def-item>` | `DefItem` | No | Add `attribute :id, :string` |
|
|
15
|
+
| `<graphic>` | `Graphic` | No | Add `attribute :id, :string` |
|
|
16
|
+
| `<list-item>` | `ListItem` | No | Add `attribute :id, :string` |
|
|
17
|
+
| `<mixed-citation>` | `MixedCitation` | No | Add `attribute :id, :string` |
|
|
18
|
+
| `<std>` | `ReferenceStandard` | No | Add `attribute :id, :string` |
|
|
19
|
+
| `<table-wrap-foot>` | `TableWrapFoot` | No | Add `attribute :id, :string` |
|
|
20
|
+
| `<xref>` | `Xref` | No | Add `attribute :id, :string` |
|
|
21
|
+
|
|
22
|
+
### Implementation Pattern
|
|
23
|
+
|
|
24
|
+
```ruby
|
|
25
|
+
# For each affected model, add:
|
|
26
|
+
attribute :id, :string
|
|
27
|
+
|
|
28
|
+
# In xml block:
|
|
29
|
+
map_attribute "id", to: :id
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## New Attributes from NISO STS 1.2
|
|
33
|
+
|
|
34
|
+
### `@stage-code` on `<release-version>`
|
|
35
|
+
```ruby
|
|
36
|
+
attribute :stage_code, :string
|
|
37
|
+
# map_attribute "stage-code", to: :stage_code
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### `@assigning-authority` Added to Multiple Elements
|
|
41
|
+
Per NISO STS 1.2 Section 7:
|
|
42
|
+
- `<article-id>`, `<award-id>`, `<compound-kwd>`, `<compound-subject>`
|
|
43
|
+
- `<contrib-id>`, `<institution-id>`, `<issue-id>`, `<journal-id>`
|
|
44
|
+
- `<kwd>`, `<kwd-group>`, `<nested-kwd>`, `<object-id>`
|
|
45
|
+
- `<resource-id>`, `<subject>`, `<subj-group>`, `<volume-id>`
|
|
46
|
+
|
|
47
|
+
### `@award-id-type`, `@award-type`, XLink on `<award-id>`
|
|
48
|
+
Per NISO STS 1.2 Section 7:
|
|
49
|
+
```ruby
|
|
50
|
+
attribute :award_id_type, :string
|
|
51
|
+
attribute :award_type, :string
|
|
52
|
+
attribute :xlink_href, :string
|
|
53
|
+
attribute :xlink_type, :string
|
|
54
|
+
attribute :xlink_role, :string
|
|
55
|
+
attribute :xlink_title, :string
|
|
56
|
+
attribute :xlink_show, :string
|
|
57
|
+
attribute :xlink_actuate, :string
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### `@custom-type` / `@custom-value` Solution
|
|
61
|
+
Per NISO STS 1.2 Section 7, these attributes get custom-type/custom-value:
|
|
62
|
+
- `@form-type`
|
|
63
|
+
- `@person-group-type`
|
|
64
|
+
- `@pub-id-type`
|
|
65
|
+
- `@related-term-type`
|
|
66
|
+
- `@ref-type`
|
|
67
|
+
- `std/@type` (dated, undated, multipart)
|
|
68
|
+
- `std-ref/@type`
|
|
69
|
+
|
|
70
|
+
### `@dtd-version` Made Optional with Value List
|
|
71
|
+
```ruby
|
|
72
|
+
attribute :dtd_version, :string
|
|
73
|
+
# Values: "iso-0.9", "iso-1.0", "iso-1.1", "1.0", "1.1d1", "1.2"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `@degree-contribution` on `<role>`
|
|
77
|
+
```ruby
|
|
78
|
+
attribute :degree_contribution, :string
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### `@hreflang` on XLink-bearing Elements
|
|
82
|
+
Added to any element with `@xlink:href`:
|
|
83
|
+
- `<related-article>`, `<related-object>`, and all elements with xlink
|
|
84
|
+
|
|
85
|
+
### `@originator` on Multiple Elements
|
|
86
|
+
Per NISO STS 1.2 Section 7:
|
|
87
|
+
- `<meta-date>`, `<release-date>`, `<release-version-id>`
|
|
88
|
+
- `<secretariat>`, `<self-uri>`, `<wi-number>`
|
|
89
|
+
|
|
90
|
+
### `@style-detail` on `<styled-content>` and `<list>`
|
|
91
|
+
```ruby
|
|
92
|
+
attribute :style_detail, :string
|
|
93
|
+
# Usage: <list list-type="bullet" style-detail="dash">
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### `@use-type` on `<std>`, `<mixed-citation>`, `<element-citation>`
|
|
97
|
+
```ruby
|
|
98
|
+
attribute :use_type, :string
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### `@vocab` and `@vocab-identifier`
|
|
102
|
+
Added to: `<kwd>`, `<compound-kwd>`, `<nested-kwd>`, `<subject>`, `<compound-subject>`, `<inline-media>`, `<institution-id>`
|
|
103
|
+
|
|
104
|
+
### `@vocab-term` and `@vocab-term-identifier` on `<inline-media>`
|
|
105
|
+
|
|
106
|
+
### `@specific-use` on `<release-version>`
|
|
107
|
+
|
|
108
|
+
### New `xref/@ref-type` Value: "abbreviation"
|
|
109
|
+
|
|
110
|
+
### `@list-type` Added Value: "arabic"
|
|
111
|
+
|
|
112
|
+
## `@xml:lang` Missing on Multilingual Elements
|
|
113
|
+
|
|
114
|
+
IEC documents use multiple languages. Check and add `@xml:lang` to:
|
|
115
|
+
- `<p>`, `<title>`, `<term>`, `<def>`, `<label>`, `<caption>`
|
|
116
|
+
- Any element in `MetadataStd` that supports multi-language variants
|
|
117
|
+
|
|
118
|
+
## `@content-type` Missing
|
|
119
|
+
- `<p>` (NisoSts) — already has, verify
|
|
120
|
+
- `<editing-instruction>` — missing per IEC guidelines
|
|
121
|
+
|
|
122
|
+
## Implementation Order
|
|
123
|
+
|
|
124
|
+
1. Fix `@id` on 7 elements (trivial, high impact)
|
|
125
|
+
2. Add `@originator` to elements that need it
|
|
126
|
+
3. Add `@assigning-authority` to listed elements
|
|
127
|
+
4. Add `@xml:lang` to multilingual elements
|
|
128
|
+
5. Add `@style-detail`, `@use-type`, `@custom-type` attributes
|
|
129
|
+
6. Add XLink attributes to `<award-id>`
|
|
130
|
+
7. Add remaining NISO STS 1.2 attributes
|
|
131
|
+
|
|
132
|
+
## Dependencies
|
|
133
|
+
|
|
134
|
+
- `04-register-versioning.md` — some attributes are version-specific
|
|
135
|
+
|
|
136
|
+
## TODO Checklist
|
|
137
|
+
|
|
138
|
+
- [x] Add `@id` to 7 elements listed above
|
|
139
|
+
- [x] Add `@originator` to elements (Paragraph, Section, Abstract, App, DispQuote, List, NormativeNote, NonNormativeNote, DefList)
|
|
140
|
+
- [x] Add `@assigning-authority` to 16 elements (XSD has it on `ext-link` only — done)
|
|
141
|
+
- [x] Add `@xml:lang` to multilingual elements (Label, Caption, DefItem, DefList)
|
|
142
|
+
- [x] Add NISO STS 1.2 specific attributes (vocab, vocab-identifier on IcsWrap, KwdGroup, NamedContent, Role, SubjGroup, Term)
|
|
143
|
+
- [x] Add missing attributes to `<award-id>` (id, specific-use, xml:lang)
|
|
144
|
+
- [x] Add missing attributes to `<ext-link>` (assigning-authority, id, specific-use, xml:lang, xlink attrs)
|
|
145
|
+
- [x] Add missing attributes to `<title>` (content-type, id, specific-use)
|
|
146
|
+
- [x] Add missing attributes to `<caption>` (id, specific-use, xml:lang)
|
|
147
|
+
- [x] Add `@vocab`/`@vocab-identifier` to elements (IcsWrap, KwdGroup, NamedContent, Role, SubjGroup, Term)
|
|
148
|
+
- [ ] Verify attribute mappings match XSD/DTD (OASIS CALS remaining)
|
|
149
|
+
- [x] Add `@id` to all 161 NisoSts models that have `@id` in XSD
|
|
150
|
+
- [x] Add `@id` to 32 TbxIsoTml models
|
|
151
|
+
- [x] Add `@id` to 29 IsoSts models
|
|
152
|
+
- [x] Run round-trip tests after each batch
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# 07: Incomplete Models Fix
|
|
2
|
+
|
|
3
|
+
**Priority**: MEDIUM
|
|
4
|
+
**Category**: Feature Gap
|
|
5
|
+
**Estimated Effort**: Medium
|
|
6
|
+
**Files Affected**: Existing model files
|
|
7
|
+
|
|
8
|
+
## Models Needing Completion
|
|
9
|
+
|
|
10
|
+
### 1. Permissions (Critical — IEC License Data Lost)
|
|
11
|
+
|
|
12
|
+
**Current**: `copyright_statement` is `:string`, `copyright_holder` is single string
|
|
13
|
+
**Needed**:
|
|
14
|
+
- `copyright_statement` → mixed content (supports `<inline-graphic>`, `<br/>`)
|
|
15
|
+
- `copyright_holder` → collection (multiple holders)
|
|
16
|
+
- Add `<license>` child element
|
|
17
|
+
- Add `<license-p>` child element (paragraphs within license)
|
|
18
|
+
- Add `<license_ref>` (ALI namespace, `ali:license_ref`)
|
|
19
|
+
- Add `<ext-link>` child
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
# Current (WRONG)
|
|
23
|
+
attribute :copyright_statement, :string
|
|
24
|
+
attribute :copyright_holder, :string
|
|
25
|
+
|
|
26
|
+
# Fixed
|
|
27
|
+
attribute :copyright_statement, :string # keep as mixed_content
|
|
28
|
+
attribute :copyright_holder, :string, collection: true
|
|
29
|
+
attribute :license, License, collection: true
|
|
30
|
+
attribute :copyright_year, :string
|
|
31
|
+
attribute :copyright_month, :string
|
|
32
|
+
attribute :copyright_day, :string
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 2. EditingInstruction (IEC Amendment Data)
|
|
36
|
+
|
|
37
|
+
**Current**: Missing `@content-type` and `<p>` child
|
|
38
|
+
**Needed**:
|
|
39
|
+
- `@content-type` attribute
|
|
40
|
+
- `<p>` as repeatable child
|
|
41
|
+
- Support for IEC amendment instructions
|
|
42
|
+
|
|
43
|
+
### 3. TermDisplay (IEC Term Content)
|
|
44
|
+
|
|
45
|
+
**Current**: Exists but missing critical children
|
|
46
|
+
**Needed**:
|
|
47
|
+
- `<term>` element support
|
|
48
|
+
- `<def>` element support
|
|
49
|
+
- `<list>` element support
|
|
50
|
+
- `<xref>` element support
|
|
51
|
+
- `<label>` element support
|
|
52
|
+
- `<term-display-string>` (NISO STS 1.2)
|
|
53
|
+
|
|
54
|
+
### 4. DefList
|
|
55
|
+
|
|
56
|
+
**Current**: Missing `@list-content` attribute
|
|
57
|
+
**Needed**:
|
|
58
|
+
- `@list-content` attribute (formula-key, figure-key, abbreviation-key)
|
|
59
|
+
- Proper relationship to DefItem children
|
|
60
|
+
|
|
61
|
+
### 5. Graphic
|
|
62
|
+
|
|
63
|
+
**Current**: Missing `@id`, `<label>`, `<caption>` children
|
|
64
|
+
**Needed**:
|
|
65
|
+
- `@id` attribute
|
|
66
|
+
- `<label>` child (for sub-figure captions)
|
|
67
|
+
- `<caption>` child
|
|
68
|
+
- `<alt-text>` child
|
|
69
|
+
|
|
70
|
+
### 6. Front (NisoSts)
|
|
71
|
+
|
|
72
|
+
**Current**: Missing `<std-doc-meta>` wiring
|
|
73
|
+
**Needed**:
|
|
74
|
+
- `<std-doc-meta>` child element
|
|
75
|
+
- Support for multiple `<std-meta>` (adoption documents)
|
|
76
|
+
- Proper metadata hierarchy
|
|
77
|
+
|
|
78
|
+
### 7. BoxedText
|
|
79
|
+
|
|
80
|
+
**Current**: Most valid children missing
|
|
81
|
+
**Needed**:
|
|
82
|
+
- `<table-wrap>`, `<fig>`, `<disp-formula>`, `<list>`
|
|
83
|
+
- `<p>`, `<caption>`, `<label>`
|
|
84
|
+
- `<sec>` (nested sections in boxed text)
|
|
85
|
+
- All emphasis and inline elements
|
|
86
|
+
|
|
87
|
+
### 8. DispFormula
|
|
88
|
+
|
|
89
|
+
**Current**: Missing `<caption>` (added in NISO STS 1.2)
|
|
90
|
+
**Needed**:
|
|
91
|
+
- `<caption>` child element
|
|
92
|
+
|
|
93
|
+
### 9. Source (Citation Source)
|
|
94
|
+
|
|
95
|
+
**Current**: Missing inline elements added in NISO STS 1.2
|
|
96
|
+
**Needed**:
|
|
97
|
+
- `<abbrev>`, `<alternatives>`, `<inline-graphic>`, `<private-char>`
|
|
98
|
+
- `<chem-struct>`, `<inline-formula>`, `<mml:math>`, `<tex-math>`
|
|
99
|
+
- `<named-content>`, `<styled-content>`, `<fn>`, `<target>`, `<xref>`
|
|
100
|
+
|
|
101
|
+
### 10. InlineFormula
|
|
102
|
+
|
|
103
|
+
**Current**: Missing accessibility elements (NISO STS 1.2)
|
|
104
|
+
**Needed**:
|
|
105
|
+
- `<alt-text>` child
|
|
106
|
+
- `<long-desc>` child
|
|
107
|
+
|
|
108
|
+
### 11. AwardGroup
|
|
109
|
+
|
|
110
|
+
**Current**: Missing new NISO STS 1.2 elements
|
|
111
|
+
**Needed**:
|
|
112
|
+
- `<award-name>` child
|
|
113
|
+
- `<award-desc>` child
|
|
114
|
+
|
|
115
|
+
### 12. DataTitle
|
|
116
|
+
|
|
117
|
+
**Current**: Missing `<inline-graphic>`, `<private-char>` (NISO STS 1.2)
|
|
118
|
+
**Needed**:
|
|
119
|
+
- `<inline-graphic>` child
|
|
120
|
+
- `<private-char>` child
|
|
121
|
+
|
|
122
|
+
### 13. Table Cells (td, th)
|
|
123
|
+
|
|
124
|
+
**Current**: Expanded to full XSD inside-cell content model
|
|
125
|
+
**Done**: disp-quote, speech, and statement are NOT in XSD inside-cell group.
|
|
126
|
+
Td/Th now include: disp-formula, disp-formula-group, element-citation, mixed-citation,
|
|
127
|
+
all emphasis elements, fig, fig-group, inline-graphic, private-char, normative-note,
|
|
128
|
+
normative-example, non-normative-example, email, ext-link, named-content,
|
|
129
|
+
alternatives, code, media, preformat, target, array
|
|
130
|
+
|
|
131
|
+
### 14. StringName Usage Expansion (NISO STS 1.2)
|
|
132
|
+
|
|
133
|
+
`<string-name>` added to:
|
|
134
|
+
- `<contrib>`, `<person-group>`, `<name-alternatives>`
|
|
135
|
+
- `<related-article>`, `<related-object>`
|
|
136
|
+
- `<mixed-citation>`, `<element-citation>`
|
|
137
|
+
|
|
138
|
+
### 15. SubjGroup and KwdGroup Expansion (NISO STS 1.2)
|
|
139
|
+
|
|
140
|
+
`<subj-group>` and `<kwd-group>` added to:
|
|
141
|
+
- `<app>`, `<boxed-text>`, `<sec>`, `<app-group>`
|
|
142
|
+
- `<chem-struct-wrap>`, `<disp-formula>`, `<disp-formula-group>`
|
|
143
|
+
- `<fig>`, `<fig-group>`, `<graphic>`, `<media>`, `<statement>`
|
|
144
|
+
- `<supplementary-material>`, `<table-wrap>`, `<table-wrap-group>`
|
|
145
|
+
|
|
146
|
+
## Implementation Order
|
|
147
|
+
|
|
148
|
+
1. Permissions — highest impact, IEC documents
|
|
149
|
+
2. Graphic — sub-figure support
|
|
150
|
+
3. TermDisplay — terminology sections
|
|
151
|
+
4. DefList — definition lists
|
|
152
|
+
5. EditingInstruction — amendments
|
|
153
|
+
6. Front/std-doc-meta — document structure
|
|
154
|
+
7. BoxedText — content completeness
|
|
155
|
+
8. NISO STS 1.2 additions (DispFormula, Source, InlineFormula, etc.)
|
|
156
|
+
|
|
157
|
+
## Dependencies
|
|
158
|
+
|
|
159
|
+
- `04-register-versioning.md` — version-specific additions
|
|
160
|
+
- `05-missing-elements.md` — some children are new elements
|
|
161
|
+
|
|
162
|
+
## TODO Checklist
|
|
163
|
+
|
|
164
|
+
- [x] Fix Permissions model (mixed content, collection, license)
|
|
165
|
+
- [x] Fix Graphic model (add @id, label, caption)
|
|
166
|
+
- [x] Fix TermDisplay model (add term, def, list, xref, label)
|
|
167
|
+
- [x] Fix DefList model (add @list-content, @originator, @continued-from, @prefix-word, @xml:lang, term_head, def_head, editing_instruction)
|
|
168
|
+
- [x] Fix EditingInstruction model (add @content-type, @rid, title, p)
|
|
169
|
+
- [x] Fix Front model (add std-doc-meta, reg-meta, nat-meta, ack, notes, toc)
|
|
170
|
+
- [x] Fix BoxedText model (add valid children)
|
|
171
|
+
- [x] Fix Back model (add index, toc, ack, notes, glossary, bio, label, title)
|
|
172
|
+
- [x] Add DispFormula caption (NISO STS 1.2) — expanded DisplayFormula with caption, originator, mixed content
|
|
173
|
+
- [x] Expand Source inline elements (NISO STS 1.2) — full inline element support with attributes
|
|
174
|
+
- [x] Add InlineFormula accessibility (NISO STS 1.2) — alt-text, long-desc, emphasis elements
|
|
175
|
+
- [x] Add AwardGroup elements (NISO STS 1.2) — rid, specific-use, xlink attrs, collection recipients
|
|
176
|
+
- [x] Add DataTitle elements (NISO STS 1.2) — full inline elements with attributes
|
|
177
|
+
- [x] Expand SubjGroup/KwdGroup locations (NISO STS 1.2) — SubjGroup recursive nesting, compound-subject
|
|
178
|
+
- [x] Expand table cell content (NISO STS 1.2) — full XSD inside-cell content model
|
|
179
|
+
- [x] Expand StringName usage (NISO STS 1.2) — added to name-alternatives
|
|
180
|
+
- [x] Run round-trip tests after each model fix
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# 08: ISO/IEC Usage Profile Layer
|
|
2
|
+
|
|
3
|
+
**Priority**: MEDIUM
|
|
4
|
+
**Category**: Architecture
|
|
5
|
+
**Estimated Effort**: High
|
|
6
|
+
**Files Affected**: New module
|
|
7
|
+
|
|
8
|
+
## Context
|
|
9
|
+
|
|
10
|
+
ISO/IEC NISO STS is NOT a separate schema. It is a **usage profile** — a constraint layer on top of NISO STS that specifies:
|
|
11
|
+
- Which elements are required vs. optional
|
|
12
|
+
- Which attribute values are allowed
|
|
13
|
+
- How to use elements in ISO/IEC context
|
|
14
|
+
- Additional conventions (ID schemes, committee references, etc.)
|
|
15
|
+
|
|
16
|
+
This means we should NOT create separate model classes for ISO/IEC. Instead, we need a **validation/constraint layer**.
|
|
17
|
+
|
|
18
|
+
## Reference Sources
|
|
19
|
+
|
|
20
|
+
- `reference-docs/Guidelines for coding ed.2.1.pdf` — IEC/ISO Coding Guidelines ed.2.1
|
|
21
|
+
- ISO/IEC Directives Part 2 — document structure rules
|
|
22
|
+
- NISO STS Tag Library — element definitions
|
|
23
|
+
|
|
24
|
+
## Architecture: Validation Layer
|
|
25
|
+
|
|
26
|
+
### Option A: Dry-Validation Schema
|
|
27
|
+
|
|
28
|
+
```ruby
|
|
29
|
+
# lib/sts/profiles/iso_iec/validator.rb
|
|
30
|
+
module Sts
|
|
31
|
+
module Profiles
|
|
32
|
+
module IsoIec
|
|
33
|
+
class Validator
|
|
34
|
+
def initialize(register = :niso_sts_v1_0)
|
|
35
|
+
@register = register
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def validate(document)
|
|
39
|
+
errors = []
|
|
40
|
+
errors.concat(validate_structure(document))
|
|
41
|
+
errors.concat(validate_ids(document))
|
|
42
|
+
errors.concat(validate_metadata(document))
|
|
43
|
+
errors.concat(validate_references(document))
|
|
44
|
+
errors
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def validate_structure(doc)
|
|
50
|
+
errors = []
|
|
51
|
+
# ISO/IEC requires <front>, <body> in <standard>
|
|
52
|
+
unless doc.front
|
|
53
|
+
errors << "ISO/IEC profile requires <front> in <standard>"
|
|
54
|
+
end
|
|
55
|
+
unless doc.body
|
|
56
|
+
errors << "ISO/IEC profile requires <body> in <standard>"
|
|
57
|
+
end
|
|
58
|
+
errors
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def validate_ids(doc)
|
|
62
|
+
# ISO/IEC: all <sec> must have @id matching pattern sec_N
|
|
63
|
+
# ISO/IEC: all <fig> must have @id matching pattern fig_N
|
|
64
|
+
# etc.
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def validate_metadata(doc)
|
|
68
|
+
# ISO/IEC: <std-meta> must have <std-ident> with specific children
|
|
69
|
+
# ISO/IEC: committee reference format
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def validate_references(doc)
|
|
73
|
+
# ISO/IEC: <std> references must have dated/undated format
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Option B: Profile Module with Class Methods
|
|
82
|
+
|
|
83
|
+
```ruby
|
|
84
|
+
# lib/sts/profiles/iso_iec/constraints.rb
|
|
85
|
+
module Sts
|
|
86
|
+
module Profiles
|
|
87
|
+
module IsoIec
|
|
88
|
+
module Constraints
|
|
89
|
+
# Elements that MUST have @id
|
|
90
|
+
REQUIRED_ID_ELEMENTS = %i[
|
|
91
|
+
sec app fig table-wrap disp-formula
|
|
92
|
+
ref-list ref p term-sec
|
|
93
|
+
].freeze
|
|
94
|
+
|
|
95
|
+
# Required children of <std-meta>
|
|
96
|
+
REQUIRED_STD_META_CHILDREN = %i[
|
|
97
|
+
std-ident doc-ref release-version
|
|
98
|
+
].freeze
|
|
99
|
+
|
|
100
|
+
# Allowed values for @std-id-type
|
|
101
|
+
STD_ID_TYPES = %w[
|
|
102
|
+
dated undated isbn doi
|
|
103
|
+
].freeze
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Option C: Custom lutaml-model Validation
|
|
111
|
+
|
|
112
|
+
Extend lutaml-model's validation to support profile-specific rules:
|
|
113
|
+
|
|
114
|
+
```ruby
|
|
115
|
+
# This would require lutaml-model changes — consider for future
|
|
116
|
+
class Sts::NisoSts::Standard
|
|
117
|
+
validates :front, presence: { message: "required by ISO/IEC profile" },
|
|
118
|
+
if: -> { iso_iec_profile? }
|
|
119
|
+
end
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Recommended Approach
|
|
123
|
+
|
|
124
|
+
Start with **Option B** (constraint constants) as a documentation layer, then build **Option A** (validator) on top. This avoids coupling validation to the model classes themselves.
|
|
125
|
+
|
|
126
|
+
## Profile Differences to Capture
|
|
127
|
+
|
|
128
|
+
### ISO Documents
|
|
129
|
+
- `<std-ident>` with `<originator>ISO</originator>`
|
|
130
|
+
- Committee reference format: `TC/SC/WG`
|
|
131
|
+
- Stage codes per ISO harmonized system
|
|
132
|
+
|
|
133
|
+
### IEC Documents
|
|
134
|
+
- `<std-ident>` with `<originator>IEC</originator>`
|
|
135
|
+
- Different committee reference format
|
|
136
|
+
- Copyright statement with inline-graphic
|
|
137
|
+
|
|
138
|
+
### National Adoptions
|
|
139
|
+
- `<std-doc-meta>` wrapper for national metadata
|
|
140
|
+
- `<adopted-from>` reference to international standard
|
|
141
|
+
|
|
142
|
+
## Files to Create
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
lib/sts/profiles/
|
|
146
|
+
├── iso_iec/
|
|
147
|
+
│ ├── constraints.rb # Constraint constants
|
|
148
|
+
│ ├── validator.rb # Validation logic
|
|
149
|
+
│ ├── id_scheme.rb # ID naming conventions
|
|
150
|
+
│ └── metadata_rules.rb # Metadata requirements
|
|
151
|
+
└── profiles.rb # Entry point
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Dependencies
|
|
155
|
+
|
|
156
|
+
- `04-register-versioning.md` — needs to know which schema version to validate against
|
|
157
|
+
|
|
158
|
+
## TODO Checklist
|
|
159
|
+
|
|
160
|
+
- [x] Extract ISO/IEC constraints from Guidelines ed.2.1
|
|
161
|
+
- [ ] Extract IEC-specific constraints
|
|
162
|
+
- [x] Design validator architecture
|
|
163
|
+
- [x] Implement constraint constants module
|
|
164
|
+
- [x] Implement basic structural validator
|
|
165
|
+
- [ ] Implement ID scheme validator
|
|
166
|
+
- [x] Implement metadata validator (originator, doc-type validation)
|
|
167
|
+
- [ ] Add profile selection to parsing API
|
|
168
|
+
- [x] Write specs for validation
|
|
169
|
+
- [ ] Document usage
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# 09: Autoload and Require Cleanup
|
|
2
|
+
|
|
3
|
+
**Priority**: LOW
|
|
4
|
+
**Category**: Cleanup
|
|
5
|
+
**Estimated Effort**: Medium
|
|
6
|
+
**Files Affected**: `lib/sts.rb`, `lib/sts/niso_sts.rb`, `lib/sts/iso_sts.rb`
|
|
7
|
+
|
|
8
|
+
## Current Issues
|
|
9
|
+
|
|
10
|
+
### 1. Autoload Alphabetization
|
|
11
|
+
|
|
12
|
+
The autoload entries in `lib/sts/niso_sts.rb` should be alphabetically ordered. Check for any out-of-order entries when adding new elements.
|
|
13
|
+
|
|
14
|
+
### 2. Moxml Monkey-Patch
|
|
15
|
+
|
|
16
|
+
`lib/sts.rb` contains a monkey-patch on Moxml:
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
Moxml::Adapter::Nokogiri.singleton_class.alias_method(:_orig_children, :children)
|
|
20
|
+
Moxml::Adapter::Nokogiri.define_singleton_method(:children, &:children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This patches an external library's behavior. If Moxml fixes the underlying issue, this will mask it or cause conflicts.
|
|
24
|
+
|
|
25
|
+
**Action**: Add a comment explaining WHY this patch exists (the Nokogiri adapter bug it works around) and a link to the upstream issue if tracked.
|
|
26
|
+
|
|
27
|
+
### 3. Orphaned/Unused Files
|
|
28
|
+
|
|
29
|
+
After refactoring (TODOs 01-04), check for:
|
|
30
|
+
- Files in `lib/sts/niso_sts/` that are no longer referenced
|
|
31
|
+
- Files in `lib/sts/iso_sts/` that are no longer referenced
|
|
32
|
+
- Unused requires
|
|
33
|
+
|
|
34
|
+
### 4. Require Order Dependencies
|
|
35
|
+
|
|
36
|
+
Some files may have implicit load-order dependencies (class A references class B, but B hasn't been loaded yet). The autoload system should handle this, but verify.
|
|
37
|
+
|
|
38
|
+
### 5. Missing Requires for Cross-Namespace Types
|
|
39
|
+
|
|
40
|
+
After fixing namespace coupling (TODO 03), ensure all cross-namespace references are replaced with proper requires or base type references.
|
|
41
|
+
|
|
42
|
+
## File Structure After Cleanup
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
lib/
|
|
46
|
+
├── sts.rb # Top-level: requires, Moxml patch (documented)
|
|
47
|
+
├── sts/
|
|
48
|
+
│ ├── namespaces.rb # Namespace constants
|
|
49
|
+
│ ├── mathml.rb # MathML wrapper (after TODO 01 fix)
|
|
50
|
+
│ ├── mathml/ # MathML-specific types (if needed)
|
|
51
|
+
│ ├── base/ # Shared base types (after TODO 03)
|
|
52
|
+
│ │ ├── text/ # Bold, Italic, Sub, Sup
|
|
53
|
+
│ │ ├── struct/ # Section, Paragraph, List
|
|
54
|
+
│ │ ├── meta/ # Title, Label, Caption
|
|
55
|
+
│ │ └── refs/ # Xref, BiblioRef
|
|
56
|
+
│ ├── iso_sts/ # ISOSTS namespace
|
|
57
|
+
│ │ ├── iso_sts.rb # Autoload declarations
|
|
58
|
+
│ │ ├── v1_1/ # ISOSTS v1.1 classes
|
|
59
|
+
│ │ └── content_groups/ # Content group helpers
|
|
60
|
+
│ ├── niso_sts/ # NISO STS namespace
|
|
61
|
+
│ │ ├── niso_sts.rb # Autoload declarations
|
|
62
|
+
│ │ ├── v1_0/ # NISO STS 1.0 classes
|
|
63
|
+
│ │ ├── v1_2/ # NISO STS 1.2 classes
|
|
64
|
+
│ │ ├── content_groups/ # Content group helpers
|
|
65
|
+
│ │ ├── mml_content/ # MathML content elements
|
|
66
|
+
│ │ └── xi.rb, ali.rb # Namespace modules
|
|
67
|
+
│ ├── tbx_iso_tml/ # TBX namespace
|
|
68
|
+
│ │ ├── tbx_iso_tml.rb # Autoload declarations
|
|
69
|
+
│ │ └── ...
|
|
70
|
+
│ ├── content_groups/ # Shared content group helpers
|
|
71
|
+
│ │ └── helpers.rb # After TODO 02 fix
|
|
72
|
+
│ └── profiles/ # ISO/IEC validation layer (after TODO 08)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Dependencies
|
|
76
|
+
|
|
77
|
+
- `01-mathml-delegation.md` — MathML wrapper location
|
|
78
|
+
- `03-namespace-coupling.md` — base types directory structure
|
|
79
|
+
- `04-register-versioning.md` — versioned subdirectories
|
|
80
|
+
|
|
81
|
+
## TODO Checklist
|
|
82
|
+
|
|
83
|
+
- [x] Document Moxml monkey-patch with rationale (removed entirely — upstream fix in moxml aa58888)
|
|
84
|
+
- [x] Audit autoload entries for alphabetical order
|
|
85
|
+
- [x] After refactoring: remove orphaned files (deleted content_groups dead code)
|
|
86
|
+
- [ ] After refactoring: verify no implicit load-order deps
|
|
87
|
+
- [x] After refactoring: clean up unused requires
|
|
88
|
+
- [x] Verify `bundle exec rake` passes cleanly
|