From 612a42920c8b9eaea6155a4a38b0e61a70dff754 Mon Sep 17 00:00:00 2001 From: HassanAkbar Date: Mon, 27 Jul 2026 13:29:44 +0500 Subject: [PATCH 1/4] complete isosts namespace closure --- TODO.sts-refactor/00-overview.md | 23 +- TODO.sts-refactor/03-namespace-coupling.md | 79 ++-- lib/sts/iso_sts.rb | 103 ++++- lib/sts/iso_sts/addr_line.rb | 77 ++++ lib/sts/iso_sts/address.rb | 40 ++ lib/sts/iso_sts/aff.rb | 87 ++++ lib/sts/iso_sts/aff_alternatives.rb | 18 + lib/sts/iso_sts/alternatives.rb | 45 ++ lib/sts/iso_sts/anonymous.rb | 19 + lib/sts/iso_sts/article_title.rb | 92 ++++ lib/sts/iso_sts/attrib.rb | 31 +- lib/sts/iso_sts/author_comment.rb | 32 ++ lib/sts/iso_sts/award_id.rb | 69 +++ lib/sts/iso_sts/bio.rb | 111 +++++ lib/sts/iso_sts/boxed_text.rb | 64 ++- lib/sts/iso_sts/chapter_title.rb | 56 +++ lib/sts/iso_sts/chem_struct.rb | 102 +++++ lib/sts/iso_sts/chem_struct_wrap.rb | 60 +++ lib/sts/iso_sts/collab.rb | 118 +++++ lib/sts/iso_sts/comment.rb | 94 ++++ lib/sts/iso_sts/conf_date.rb | 24 + lib/sts/iso_sts/conf_loc.rb | 24 + lib/sts/iso_sts/conf_name.rb | 24 + lib/sts/iso_sts/conf_sponsor.rb | 24 + lib/sts/iso_sts/contrib.rb | 74 +++ lib/sts/iso_sts/contrib_group.rb | 45 ++ lib/sts/iso_sts/custom_meta.rb | 1 - lib/sts/iso_sts/custom_meta_group.rb | 2 + lib/sts/iso_sts/date.rb | 28 ++ lib/sts/iso_sts/date_in_citation.rb | 32 ++ lib/sts/iso_sts/degrees.rb | 24 + lib/sts/iso_sts/disp_formula_group.rb | 43 ++ lib/sts/iso_sts/disp_quote.rb | 62 ++- lib/sts/iso_sts/element_citation.rb | 203 +++++++++ lib/sts/iso_sts/elocation_id.rb | 24 + lib/sts/iso_sts/fig_group.rb | 50 +++ lib/sts/iso_sts/funding_source.rb | 85 ++++ lib/sts/iso_sts/given_names.rb | 20 + lib/sts/iso_sts/glossary.rb | 91 ++++ lib/sts/iso_sts/glyph_data.rb | 32 ++ lib/sts/iso_sts/glyph_ref.rb | 17 + lib/sts/iso_sts/gov.rb | 52 +++ .../iso_sts/inline_supplementary_material.rb | 78 ++++ lib/sts/iso_sts/isbn.rb | 22 + lib/sts/iso_sts/issn.rb | 22 + lib/sts/iso_sts/issue_id.rb | 26 ++ lib/sts/iso_sts/issue_part.rb | 24 + lib/sts/iso_sts/issue_title.rb | 24 + lib/sts/iso_sts/journal_id.rb | 24 + lib/sts/iso_sts/license.rb | 3 +- lib/sts/iso_sts/license_p.rb | 119 +++-- lib/sts/iso_sts/media.rb | 64 +++ lib/sts/iso_sts/meta_name.rb | 3 + lib/sts/iso_sts/meta_value.rb | 59 ++- lib/sts/iso_sts/mixed_citation.rb | 8 +- lib/sts/iso_sts/name.rb | 32 ++ lib/sts/iso_sts/name_alternatives.rb | 20 + lib/sts/iso_sts/on_behalf_of.rb | 50 +++ lib/sts/iso_sts/open_access.rb | 28 ++ lib/sts/iso_sts/overline.rb | 99 +++++ lib/sts/iso_sts/part_title.rb | 56 +++ lib/sts/iso_sts/patent.rb | 26 ++ lib/sts/iso_sts/person_group.rb | 44 ++ lib/sts/iso_sts/prefix.rb | 24 + lib/sts/iso_sts/price.rb | 46 ++ lib/sts/iso_sts/private_char.rb | 28 ++ lib/sts/iso_sts/ref.rb | 2 +- lib/sts/iso_sts/related_article.rb | 191 ++++++++ lib/sts/iso_sts/related_object.rb | 182 ++++++++ lib/sts/iso_sts/role.rb | 52 +++ lib/sts/iso_sts/roman.rb | 99 +++++ lib/sts/iso_sts/sans_serif.rb | 99 +++++ lib/sts/iso_sts/series.rb | 52 +++ lib/sts/iso_sts/size.rb | 24 + lib/sts/iso_sts/source.rb | 58 +++ lib/sts/iso_sts/speaker.rb | 42 ++ lib/sts/iso_sts/speech.rb | 34 ++ lib/sts/iso_sts/statement.rb | 40 ++ lib/sts/iso_sts/string_name.rb | 36 ++ lib/sts/iso_sts/subtitle.rb | 96 ++++ lib/sts/iso_sts/suffix.rb | 24 + lib/sts/iso_sts/supplement.rb | 73 +++ lib/sts/iso_sts/supplementary_material.rb | 108 +++++ lib/sts/iso_sts/surname.rb | 20 + lib/sts/iso_sts/table_wrap_group.rb | 44 ++ lib/sts/iso_sts/target.rb | 52 +++ lib/sts/iso_sts/term_display.rb | 81 ++++ lib/sts/iso_sts/term_head.rb | 40 +- lib/sts/iso_sts/term_sec.rb | 2 +- lib/sts/iso_sts/textual_form.rb | 56 +++ lib/sts/iso_sts/trans_source.rb | 58 +++ lib/sts/iso_sts/trans_title.rb | 96 ++++ lib/sts/iso_sts/verse_group.rb | 38 ++ lib/sts/iso_sts/verse_line.rb | 69 +++ lib/sts/iso_sts/volume_id.rb | 26 ++ lib/sts/iso_sts/volume_series.rb | 24 + spec/iso_sts/iso_sts_element_spec.rb | 102 +---- .../iso_sts_recursive_content_closure_spec.rb | 420 ++++++++++++++++++ 98 files changed, 5330 insertions(+), 240 deletions(-) create mode 100644 lib/sts/iso_sts/addr_line.rb create mode 100644 lib/sts/iso_sts/address.rb create mode 100644 lib/sts/iso_sts/aff.rb create mode 100644 lib/sts/iso_sts/aff_alternatives.rb create mode 100644 lib/sts/iso_sts/alternatives.rb create mode 100644 lib/sts/iso_sts/anonymous.rb create mode 100644 lib/sts/iso_sts/article_title.rb create mode 100644 lib/sts/iso_sts/author_comment.rb create mode 100644 lib/sts/iso_sts/award_id.rb create mode 100644 lib/sts/iso_sts/bio.rb create mode 100644 lib/sts/iso_sts/chapter_title.rb create mode 100644 lib/sts/iso_sts/chem_struct.rb create mode 100644 lib/sts/iso_sts/chem_struct_wrap.rb create mode 100644 lib/sts/iso_sts/collab.rb create mode 100644 lib/sts/iso_sts/comment.rb create mode 100644 lib/sts/iso_sts/conf_date.rb create mode 100644 lib/sts/iso_sts/conf_loc.rb create mode 100644 lib/sts/iso_sts/conf_name.rb create mode 100644 lib/sts/iso_sts/conf_sponsor.rb create mode 100644 lib/sts/iso_sts/contrib.rb create mode 100644 lib/sts/iso_sts/contrib_group.rb create mode 100644 lib/sts/iso_sts/date.rb create mode 100644 lib/sts/iso_sts/date_in_citation.rb create mode 100644 lib/sts/iso_sts/degrees.rb create mode 100644 lib/sts/iso_sts/disp_formula_group.rb create mode 100644 lib/sts/iso_sts/element_citation.rb create mode 100644 lib/sts/iso_sts/elocation_id.rb create mode 100644 lib/sts/iso_sts/fig_group.rb create mode 100644 lib/sts/iso_sts/funding_source.rb create mode 100644 lib/sts/iso_sts/given_names.rb create mode 100644 lib/sts/iso_sts/glossary.rb create mode 100644 lib/sts/iso_sts/glyph_data.rb create mode 100644 lib/sts/iso_sts/glyph_ref.rb create mode 100644 lib/sts/iso_sts/gov.rb create mode 100644 lib/sts/iso_sts/inline_supplementary_material.rb create mode 100644 lib/sts/iso_sts/isbn.rb create mode 100644 lib/sts/iso_sts/issn.rb create mode 100644 lib/sts/iso_sts/issue_id.rb create mode 100644 lib/sts/iso_sts/issue_part.rb create mode 100644 lib/sts/iso_sts/issue_title.rb create mode 100644 lib/sts/iso_sts/journal_id.rb create mode 100644 lib/sts/iso_sts/media.rb create mode 100644 lib/sts/iso_sts/name.rb create mode 100644 lib/sts/iso_sts/name_alternatives.rb create mode 100644 lib/sts/iso_sts/on_behalf_of.rb create mode 100644 lib/sts/iso_sts/open_access.rb create mode 100644 lib/sts/iso_sts/overline.rb create mode 100644 lib/sts/iso_sts/part_title.rb create mode 100644 lib/sts/iso_sts/patent.rb create mode 100644 lib/sts/iso_sts/person_group.rb create mode 100644 lib/sts/iso_sts/prefix.rb create mode 100644 lib/sts/iso_sts/price.rb create mode 100644 lib/sts/iso_sts/private_char.rb create mode 100644 lib/sts/iso_sts/related_article.rb create mode 100644 lib/sts/iso_sts/related_object.rb create mode 100644 lib/sts/iso_sts/role.rb create mode 100644 lib/sts/iso_sts/roman.rb create mode 100644 lib/sts/iso_sts/sans_serif.rb create mode 100644 lib/sts/iso_sts/series.rb create mode 100644 lib/sts/iso_sts/size.rb create mode 100644 lib/sts/iso_sts/source.rb create mode 100644 lib/sts/iso_sts/speaker.rb create mode 100644 lib/sts/iso_sts/speech.rb create mode 100644 lib/sts/iso_sts/statement.rb create mode 100644 lib/sts/iso_sts/string_name.rb create mode 100644 lib/sts/iso_sts/subtitle.rb create mode 100644 lib/sts/iso_sts/suffix.rb create mode 100644 lib/sts/iso_sts/supplement.rb create mode 100644 lib/sts/iso_sts/supplementary_material.rb create mode 100644 lib/sts/iso_sts/surname.rb create mode 100644 lib/sts/iso_sts/table_wrap_group.rb create mode 100644 lib/sts/iso_sts/target.rb create mode 100644 lib/sts/iso_sts/term_display.rb create mode 100644 lib/sts/iso_sts/textual_form.rb create mode 100644 lib/sts/iso_sts/trans_source.rb create mode 100644 lib/sts/iso_sts/trans_title.rb create mode 100644 lib/sts/iso_sts/verse_group.rb create mode 100644 lib/sts/iso_sts/verse_line.rb create mode 100644 lib/sts/iso_sts/volume_id.rb create mode 100644 lib/sts/iso_sts/volume_series.rb create mode 100644 spec/sts/iso_sts_recursive_content_closure_spec.rb diff --git a/TODO.sts-refactor/00-overview.md b/TODO.sts-refactor/00-overview.md index b06822d..ed02964 100644 --- a/TODO.sts-refactor/00-overview.md +++ b/TODO.sts-refactor/00-overview.md @@ -19,7 +19,7 @@ |---|------|----------|----------|--------------| | 01 | `01-mathml-delegation.md` | Anti-Pattern Fix | DONE | — | | 02 | `02-type-resolution.md` | Anti-Pattern Fix | DONE | — | -| 03 | `03-namespace-coupling.md` | Architecture | IN PROGRESS (63→6 refs) | 01, 02 | +| 03 | `03-namespace-coupling.md` | Architecture | DONE (63→0 refs) | 01, 02 | | 04 | `04-register-versioning.md` | Architecture | HIGH | 01, 02 | | 05 | `05-missing-elements.md` | Feature Gap | MOSTLY DONE | 04 | | 06 | `06-missing-attributes.md` | Feature Gap | DONE | 04 | @@ -166,9 +166,9 @@ grep -r "method_missing|respond_to_missing|Object.const_get|\.send" lib/ - ~~Expand StringName usage (in contrib, element-citation, related-article — NISO STS 1.2)~~ → DONE: added to name-alternatives; already in person-group and mixed-citation ### Architectural Items (High Effort) -- `03-namespace-coupling.md` — IN PROGRESS: 63→6 IsoSts→NisoSts references - remaining (issue #40). ISOSTS.xsd governs content models and all non-`@id` - attributes; the `@id` follows the 86948b9 convention. +- `03-namespace-coupling.md` — DONE: 63→0 IsoSts→NisoSts references + (issue #40). ISOSTS.xsd governs content models and all non-`@id` attributes; + the `@id` follows the 86948b9 convention. - `04-register-versioning.md` — Version the models via lutaml-model Registers - `11-duplicate-models.md` — 44 overlapping element resolution (depends on 03) @@ -192,14 +192,7 @@ the **NISO** XSD and applied the result to IsoSts. `standard_ref`). ## Next Action -Two independent tracks: -1. Finish `03` — the 6 remaining refs split across five recursive roots - (`ElementCitation`, `PersonGroup`, `Collab`, `Source`, `TermDisplay`) and - five child-bearing roots. `DispQuote` and `BoxedText` themselves are now - IsoSts classes. The first 15 high-reuse dependency leaves are modelled, - reducing the unresolved closures to 78–84 not-yet-modelled ISOSTS elements - before existing IsoSts boundaries. The remaining work still needs an - architecture decision for the recursive content core. -2. The remaining schema-conformance follow-up above — the 7 spurious attributes - on 5 models and the 6 classes without `@id`. (The dropped-attribute data loss - is now fixed.) +`03` is complete: the 90-model closure removes every IsoSts→NisoSts reference. +Continue with the remaining schema-conformance follow-up above — the 7 spurious +attributes on 5 models and the 6 classes without `@id`. (The dropped-attribute +data loss is now fixed.) diff --git a/TODO.sts-refactor/03-namespace-coupling.md b/TODO.sts-refactor/03-namespace-coupling.md index c347571..ca9cbce 100644 --- a/TODO.sts-refactor/03-namespace-coupling.md +++ b/TODO.sts-refactor/03-namespace-coupling.md @@ -3,7 +3,7 @@ **Priority**: HIGH **Category**: Architecture **Estimated Effort**: High -**Status**: Partially done — 63 → 6 references (GitHub issue #40) +**Status**: Complete — 63 → 0 references (GitHub issue #40) ## Problem @@ -18,7 +18,8 @@ The `IsoSts::Attrib` addition then reduced it from 13 to 11 (Array#attrib, TableWrapFoot#attrib) and filled the omission in DispQuote / BoxedText from PR #48. The License/TermHead/CustomMetaGroup closure then reduced it from 11 to 6 (Permissions#license, DefList#term_head, and -IsoMeta/RegMeta/NatMeta#custom_meta_group). +IsoMeta/RegMeta/NatMeta#custom_meta_group). The full recursive closure then +removed the final 6 references. ## Content models from ISOSTS.xsd; `@id` from the 86948b9 convention @@ -46,7 +47,7 @@ Non-`@id` attribute lists must be **generated** from the XSD, never hand-read: `version` on `tex-math` and `specific-use` on `pub-id` sit after long `xs:enumeration` blocks and are invisible to a truncated read. -## Done in issue #40 — 47 refs removed, 46 classes added +## Done in issue #40 — 63 refs removed, 136 classes added - **14 `xs:string` elements** (`originator`, `doc-type`, `doc-number`, `part-number`, `version`, `suppl-type`, `suppl-number`, `suppl-version`, @@ -78,25 +79,25 @@ Non-`@id` attribute lists must be **generated** from the XSD, never hand-read: - **`DispQuote` and `BoxedText` added** — modelled from ISOSTS.xsd (not copied from NisoSts, which disagrees: `NisoSts::DispQuote` lacks `xml_lang` and `title`; `NisoSts::BoxedText` carries `form_type`/`is_form` that ISOSTS does - not define). Children limited to existing IsoSts types; omitted children - (`speech`, `statement`, `verse-group`, `address`, `alternatives`, - `array`, `chem-struct-wrap`, `fig-group`, `media`, `supplementary-material`, - `table-wrap`, `table-wrap-group`, `disp-formula-group`, `mml:math`, - `related-article`, `related-object`, `glossary`) are tracked below. + not define). Their first pass was limited to existing IsoSts child types. `BoxedText#sts_object_id` (not `:object_id`) follows the `NisoSts::Graphic` convention to avoid clashing with `Object#object_id`. 3 refs. - **`Attrib` added** — mixed-content class modelled from ISOSTS.xsd with the - 25 inline-element children that have IsoSts types today. Fills the + 25 inline-element children that had IsoSts types at the time. It fills the `attrib` gap left in `DispQuote` and `BoxedText` from the prior bullet. - 2 refs (`Array#attrib`, `TableWrapFoot#attrib`). Omitted inline children - (`inline-supplementary-material`, `related-article`, `related-object`, - `element-citation`, `overline`, `roman`, `sans-serif`, `alternatives`, - `private-char`, `chem-struct`, `mml:math`, `target`, `tbx:entailedTerm`) - tracked below. + 2 refs (`Array#attrib`, `TableWrapFoot#attrib`). - **License / TermHead / CustomMetaGroup closure added** — `License`, `LicenseP`, `TermHead`, `CustomMetaGroup`, `CustomMeta`, `MetaName`, and `MetaValue` modelled from ISOSTS.xsd. 5 refs (`Permissions#license`, `DefList#term_head`, `IsoMeta/RegMeta/NatMeta#custom_meta_group`). +- **90-model full closure completed** — 80 models are new and 10 earlier + bounded models are expanded to their complete content models. All direct + and transitive ISOSTS elements needed by `disp-quote`, `boxed-text`, + `person-group`, `collab`, `source`, `article-title`, and the bounded + metadata roots now close through IsoSts, TBX, and MathML types. Every model + uses the exact ISOSTS attributes and child cardinalities plus the mandatory + project `@id` surface; none uses `required: true`. This removes the final + 6 refs from `MixedCitation`, `Ref`, and `TermSec`. ### Why classes and not plain `:string` @@ -107,26 +108,26 @@ round-trip. For a scalar, `render_empty: :empty` recovers it; for a collection to `[]`, destroying the information at parse time before any render option applies. Content-only classes round-trip every case. -## Remaining — 6 refs - -**5 refs to 5 recursive roots**: `ElementCitation`, `PersonGroup`, `Collab`, -`Source`, `TermDisplay`. Each reaches the same 78–79-element -mutually-recursive core before existing IsoSts boundaries (`sec` → `p` → -`disp-quote` → `p`). `DispQuote`, `BoxedText`, `Attrib`, `License`, -`TermHead`, and `CustomMetaGroup` are now IsoSts classes and no longer in -this list. The remaining 6 are the recursive roots — see -`TODO.roadmap/04-issue-40-recursive-roots.md` for the strategy. - -**8 refs to 5 child-bearing roots**, now measured after the first dependency -layer: `attrib` (:1082) reaches 78 not-yet-modelled ISOSTS elements before -existing IsoSts boundaries, `term-head` (:4308) reaches 79, `article-title` -reaches 78, `license` → `license-p` (:51) reaches 84, and -`custom-meta-group` → `custom-meta` reaches 82. They converge on the same -recursive content core as the deep roots, so none is another bounded model -batch. `publisher` was the only exception: its four-element closure -(`publisher`, `publisher-name`, `publisher-loc`, `email`) is complete. -The Niso `Attrib` class is only 17 lines because it omits all 37 ISOSTS child -types; copying it would silently drop valid ISO content rather than decouple it. +## Complete — 0 refs + +The final 6 references were `Ref#element_citation`, four `MixedCitation` +children (`person_group`, `collab`, `source`, and `article_title`), and +`TermSec#term_display`. Their complete recursive and bounded closures are now +modelled in IsoSts. + +The earlier four bounded roots had a combined 12-element closure before +existing IsoSts boundaries: + +- `TermHead` — 1 ref in `DefList`; only `term-head` was needed. +- `CustomMetaGroup` — 3 refs in `IsoMeta`, `NatMeta`, and `RegMeta`; its + 4-element closure is `custom-meta-group`, `custom-meta`, `meta-name`, and + `meta-value`. +- `License` — 1 ref in `Permissions`; its 6-element closure is `license`, + `license-p`, `award-id`, `funding-source`, `open-access`, and `price`. +- `TermDisplay` — 1 ref in `TermSec`; only `term-display` was needed. + +All four closures are now modelled in IsoSts and all six host references point +to their IsoSts types. ## Rejected: three-tier `Sts::Base` hierarchy @@ -140,7 +141,7 @@ That draft also targeted `lib/sts/iso_sts/content_groups/highlight_elements.rb` and "194+ references" to emphasis types. That file was deleted as dead code; the real work was metadata types, not highlight elements. -## Naming trap (for the deferred work) +## Naming trap A mechanical `s/NisoSts::/IsoSts::/` is wrong. Nine elements already have different class names per namespace, so a blind rename creates `IsoSts::Section` @@ -156,13 +157,13 @@ Remap child references by **XML element name**, not class name. ## Scope boundary Independence from NisoSts is not independence in general: `lib/sts/iso_sts/` -still references 6 `TbxIsoTml` types directly, and much of the deferred closure -reaches `TbxIsoTml`/MathML. Those are shared namespaces, outside this ADR. +still references 6 `TbxIsoTml` types directly, and the completed closure reaches +`TbxIsoTml`/MathML. Those are shared namespaces, outside this ADR. ## Verification -1. `grep -rho "Sts::NisoSts::" lib/sts/iso_sts/ | wc -l` → `16` +1. `grep -rho "Sts::NisoSts::" lib/sts/iso_sts/ | wc -l` → `0` 2. Every *non-`@id`* attribute on an IsoSts model traces to a line in `ISOSTS.xsd`; `@id` follows the 86948b9 convention -3. Autoload registry 1:1 with the directory (131/131) +3. Autoload registry 1:1 with the directory (220/220) 4. `bundle exec rspec` green; `bundle exec rubocop` clean diff --git a/lib/sts/iso_sts.rb b/lib/sts/iso_sts.rb index 014491b..b88d7c1 100644 --- a/lib/sts/iso_sts.rb +++ b/lib/sts/iso_sts.rb @@ -88,8 +88,6 @@ module IsoSts autoload :Label, "#{__dir__}/iso_sts/label" autoload :Title, "#{__dir__}/iso_sts/title" autoload :Bold, "#{__dir__}/iso_sts/bold" - autoload :BoxedText, "#{__dir__}/iso_sts/boxed_text" - autoload :DispQuote, "#{__dir__}/iso_sts/disp_quote" autoload :Italic, "#{__dir__}/iso_sts/italic" autoload :Monospace, "#{__dir__}/iso_sts/monospace" autoload :NamedContent, "#{__dir__}/iso_sts/named_content" @@ -101,19 +99,12 @@ module IsoSts # Shared model foundations autoload :Abbrev, "#{__dir__}/iso_sts/abbrev" autoload :Annotation, "#{__dir__}/iso_sts/annotation" - autoload :Attrib, "#{__dir__}/iso_sts/attrib" autoload :Country, "#{__dir__}/iso_sts/country" - autoload :CustomMeta, "#{__dir__}/iso_sts/custom_meta" - autoload :CustomMetaGroup, "#{__dir__}/iso_sts/custom_meta_group" autoload :Day, "#{__dir__}/iso_sts/day" autoload :Etal, "#{__dir__}/iso_sts/etal" autoload :Fax, "#{__dir__}/iso_sts/fax" autoload :InlineGraphic, "#{__dir__}/iso_sts/inline_graphic" autoload :Institution, "#{__dir__}/iso_sts/institution" - autoload :License, "#{__dir__}/iso_sts/license" - autoload :LicenseP, "#{__dir__}/iso_sts/license_p" - autoload :MetaName, "#{__dir__}/iso_sts/meta_name" - autoload :MetaValue, "#{__dir__}/iso_sts/meta_value" autoload :MilestoneEnd, "#{__dir__}/iso_sts/milestone_end" autoload :MilestoneStart, "#{__dir__}/iso_sts/milestone_start" autoload :Month, "#{__dir__}/iso_sts/month" @@ -121,6 +112,100 @@ module IsoSts autoload :ObjectId, "#{__dir__}/iso_sts/object_id" autoload :Phone, "#{__dir__}/iso_sts/phone" autoload :Season, "#{__dir__}/iso_sts/season" + + # Recursive content closure + autoload :AddrLine, "#{__dir__}/iso_sts/addr_line" + autoload :Address, "#{__dir__}/iso_sts/address" + autoload :Aff, "#{__dir__}/iso_sts/aff" + autoload :AffAlternatives, "#{__dir__}/iso_sts/aff_alternatives" + autoload :Alternatives, "#{__dir__}/iso_sts/alternatives" + autoload :Anonymous, "#{__dir__}/iso_sts/anonymous" + autoload :ArticleTitle, "#{__dir__}/iso_sts/article_title" + autoload :Attrib, "#{__dir__}/iso_sts/attrib" + autoload :AuthorComment, "#{__dir__}/iso_sts/author_comment" + autoload :Bio, "#{__dir__}/iso_sts/bio" + autoload :BoxedText, "#{__dir__}/iso_sts/boxed_text" + autoload :ChapterTitle, "#{__dir__}/iso_sts/chapter_title" + autoload :ChemStruct, "#{__dir__}/iso_sts/chem_struct" + autoload :ChemStructWrap, "#{__dir__}/iso_sts/chem_struct_wrap" + autoload :Collab, "#{__dir__}/iso_sts/collab" + autoload :Comment, "#{__dir__}/iso_sts/comment" + autoload :ConfDate, "#{__dir__}/iso_sts/conf_date" + autoload :ConfLoc, "#{__dir__}/iso_sts/conf_loc" + autoload :ConfName, "#{__dir__}/iso_sts/conf_name" + autoload :ConfSponsor, "#{__dir__}/iso_sts/conf_sponsor" + autoload :Contrib, "#{__dir__}/iso_sts/contrib" + autoload :ContribGroup, "#{__dir__}/iso_sts/contrib_group" + autoload :Date, "#{__dir__}/iso_sts/date" + autoload :DateInCitation, "#{__dir__}/iso_sts/date_in_citation" + autoload :Degrees, "#{__dir__}/iso_sts/degrees" + autoload :DispFormulaGroup, "#{__dir__}/iso_sts/disp_formula_group" + autoload :DispQuote, "#{__dir__}/iso_sts/disp_quote" + autoload :ElementCitation, "#{__dir__}/iso_sts/element_citation" + autoload :ElocationId, "#{__dir__}/iso_sts/elocation_id" + autoload :FigGroup, "#{__dir__}/iso_sts/fig_group" + autoload :GivenNames, "#{__dir__}/iso_sts/given_names" + autoload :Glossary, "#{__dir__}/iso_sts/glossary" + autoload :GlyphData, "#{__dir__}/iso_sts/glyph_data" + autoload :GlyphRef, "#{__dir__}/iso_sts/glyph_ref" + autoload :Gov, "#{__dir__}/iso_sts/gov" + autoload :InlineSupplementaryMaterial, + "#{__dir__}/iso_sts/inline_supplementary_material" + autoload :Isbn, "#{__dir__}/iso_sts/isbn" + autoload :Issn, "#{__dir__}/iso_sts/issn" + autoload :IssueId, "#{__dir__}/iso_sts/issue_id" + autoload :IssuePart, "#{__dir__}/iso_sts/issue_part" + autoload :IssueTitle, "#{__dir__}/iso_sts/issue_title" + autoload :JournalId, "#{__dir__}/iso_sts/journal_id" + autoload :Media, "#{__dir__}/iso_sts/media" + autoload :Name, "#{__dir__}/iso_sts/name" + autoload :NameAlternatives, "#{__dir__}/iso_sts/name_alternatives" + autoload :OnBehalfOf, "#{__dir__}/iso_sts/on_behalf_of" + autoload :Overline, "#{__dir__}/iso_sts/overline" + autoload :PartTitle, "#{__dir__}/iso_sts/part_title" + autoload :Patent, "#{__dir__}/iso_sts/patent" + autoload :PersonGroup, "#{__dir__}/iso_sts/person_group" + autoload :Prefix, "#{__dir__}/iso_sts/prefix" + autoload :PrivateChar, "#{__dir__}/iso_sts/private_char" + autoload :RelatedArticle, "#{__dir__}/iso_sts/related_article" + autoload :RelatedObject, "#{__dir__}/iso_sts/related_object" + autoload :Role, "#{__dir__}/iso_sts/role" + autoload :Roman, "#{__dir__}/iso_sts/roman" + autoload :SansSerif, "#{__dir__}/iso_sts/sans_serif" + autoload :Series, "#{__dir__}/iso_sts/series" + autoload :Size, "#{__dir__}/iso_sts/size" + autoload :Source, "#{__dir__}/iso_sts/source" + autoload :Speaker, "#{__dir__}/iso_sts/speaker" + autoload :Speech, "#{__dir__}/iso_sts/speech" + autoload :Statement, "#{__dir__}/iso_sts/statement" + autoload :StringName, "#{__dir__}/iso_sts/string_name" + autoload :Subtitle, "#{__dir__}/iso_sts/subtitle" + autoload :Suffix, "#{__dir__}/iso_sts/suffix" + autoload :Supplement, "#{__dir__}/iso_sts/supplement" + autoload :SupplementaryMaterial, "#{__dir__}/iso_sts/supplementary_material" + autoload :Surname, "#{__dir__}/iso_sts/surname" + autoload :TableWrapGroup, "#{__dir__}/iso_sts/table_wrap_group" + autoload :Target, "#{__dir__}/iso_sts/target" + autoload :TextualForm, "#{__dir__}/iso_sts/textual_form" + autoload :TransSource, "#{__dir__}/iso_sts/trans_source" + autoload :TransTitle, "#{__dir__}/iso_sts/trans_title" + autoload :VerseGroup, "#{__dir__}/iso_sts/verse_group" + autoload :VerseLine, "#{__dir__}/iso_sts/verse_line" + autoload :VolumeId, "#{__dir__}/iso_sts/volume_id" + autoload :VolumeSeries, "#{__dir__}/iso_sts/volume_series" + + # Remaining namespace closure + autoload :AwardId, "#{__dir__}/iso_sts/award_id" + autoload :CustomMeta, "#{__dir__}/iso_sts/custom_meta" + autoload :CustomMetaGroup, "#{__dir__}/iso_sts/custom_meta_group" + autoload :FundingSource, "#{__dir__}/iso_sts/funding_source" + autoload :License, "#{__dir__}/iso_sts/license" + autoload :LicenseP, "#{__dir__}/iso_sts/license_p" + autoload :MetaName, "#{__dir__}/iso_sts/meta_name" + autoload :MetaValue, "#{__dir__}/iso_sts/meta_value" + autoload :OpenAccess, "#{__dir__}/iso_sts/open_access" + autoload :Price, "#{__dir__}/iso_sts/price" + autoload :TermDisplay, "#{__dir__}/iso_sts/term_display" autoload :TermHead, "#{__dir__}/iso_sts/term_head" # List elements diff --git a/lib/sts/iso_sts/addr_line.rb b/lib/sts/iso_sts/addr_line.rb new file mode 100644 index 0000000..d6ae53e --- /dev/null +++ b/lib/sts/iso_sts/addr_line.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class AddrLine < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + attribute :country, ::Sts::IsoSts::Country, collection: true + attribute :fax, ::Sts::IsoSts::Fax, collection: true + attribute :institution, ::Sts::IsoSts::Institution, collection: true + attribute :phone, ::Sts::IsoSts::Phone, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "addr-line" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + map_element "country", to: :country + map_element "fax", to: :fax + map_element "institution", to: :institution + map_element "phone", to: :phone + end + end + end +end diff --git a/lib/sts/iso_sts/address.rb b/lib/sts/iso_sts/address.rb new file mode 100644 index 0000000..d753862 --- /dev/null +++ b/lib/sts/iso_sts/address.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Address < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :originator, :string + attribute :addr_line, ::Sts::IsoSts::AddrLine, collection: true + attribute :country, ::Sts::IsoSts::Country, collection: true + attribute :fax, ::Sts::IsoSts::Fax, collection: true + attribute :institution, ::Sts::IsoSts::Institution, collection: true + attribute :phone, ::Sts::IsoSts::Phone, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + + xml do + element "address" + ordered + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "originator", to: :originator + map_element "addr-line", to: :addr_line + map_element "country", to: :country + map_element "fax", to: :fax + map_element "institution", to: :institution + map_element "phone", to: :phone + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + end + end + end +end diff --git a/lib/sts/iso_sts/aff.rb b/lib/sts/iso_sts/aff.rb new file mode 100644 index 0000000..12d734f --- /dev/null +++ b/lib/sts/iso_sts/aff.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Aff < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :rid, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :addr_line, ::Sts::IsoSts::AddrLine, collection: true + attribute :country, ::Sts::IsoSts::Country, collection: true + attribute :fax, ::Sts::IsoSts::Fax, collection: true + attribute :institution, ::Sts::IsoSts::Institution, collection: true + attribute :phone, ::Sts::IsoSts::Phone, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :break, ::Sts::IsoSts::Break, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :label, ::Sts::IsoSts::Label, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "aff" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "rid", to: :rid + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "addr-line", to: :addr_line + map_element "country", to: :country + map_element "fax", to: :fax + map_element "institution", to: :institution + map_element "phone", to: :phone + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "break", to: :break + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "label", to: :label + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/aff_alternatives.rb b/lib/sts/iso_sts/aff_alternatives.rb new file mode 100644 index 0000000..d98fb6f --- /dev/null +++ b/lib/sts/iso_sts/aff_alternatives.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class AffAlternatives < Lutaml::Model::Serializable + attribute :id, :string + attribute :aff, ::Sts::IsoSts::Aff, collection: true + + xml do + element "aff-alternatives" + ordered + + map_attribute "id", to: :id + map_element "aff", to: :aff + end + end + end +end diff --git a/lib/sts/iso_sts/alternatives.rb b/lib/sts/iso_sts/alternatives.rb new file mode 100644 index 0000000..789ecfe --- /dev/null +++ b/lib/sts/iso_sts/alternatives.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Alternatives < Lutaml::Model::Serializable + attribute :id, :string + attribute :originator, :string + attribute :array, ::Sts::IsoSts::Array, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :media, ::Sts::IsoSts::Media, collection: true + attribute :preformat, ::Sts::IsoSts::Preformat, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :supplementary_material, ::Sts::IsoSts::SupplementaryMaterial, + collection: true + attribute :table, ::Sts::IsoSts::Table, collection: true + attribute :textual_form, ::Sts::IsoSts::TextualForm, collection: true + attribute :math, ::Mml::V2::Math, collection: true + + xml do + element "alternatives" + ordered + + map_attribute "id", to: :id + map_attribute "originator", to: :originator + map_element "array", to: :array + map_element "chem-struct", to: :chem_struct + map_element "graphic", to: :graphic + map_element "inline-graphic", to: :inline_graphic + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "media", to: :media + map_element "preformat", to: :preformat + map_element "private-char", to: :private_char + map_element "supplementary-material", to: :supplementary_material + map_element "table", to: :table + map_element "textual-form", to: :textual_form + map_element "math", to: :math + end + end + end +end diff --git a/lib/sts/iso_sts/anonymous.rb b/lib/sts/iso_sts/anonymous.rb new file mode 100644 index 0000000..c64d77f --- /dev/null +++ b/lib/sts/iso_sts/anonymous.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Anonymous < Lutaml::Model::Serializable + attribute :id, :string + attribute :specific_use, :string + attribute :xml_lang, :string + + xml do + element "anonymous" + + map_attribute "id", to: :id + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + end + end + end +end diff --git a/lib/sts/iso_sts/article_title.rb b/lib/sts/iso_sts/article_title.rb new file mode 100644 index 0000000..f040162 --- /dev/null +++ b/lib/sts/iso_sts/article_title.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class ArticleTitle < Lutaml::Model::Serializable + attribute :id, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + attribute :break, ::Sts::IsoSts::Break, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "article-title" + mixed_content + + map_attribute "id", to: :id + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "math", to: :math + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref + map_element "sub", to: :sub + map_element "sup", to: :sup + map_element "break", to: :break + end + end + end +end diff --git a/lib/sts/iso_sts/attrib.rb b/lib/sts/iso_sts/attrib.rb index d0189c3..145cc3b 100644 --- a/lib/sts/iso_sts/attrib.rb +++ b/lib/sts/iso_sts/attrib.rb @@ -10,17 +10,31 @@ class Attrib < Lutaml::Model::Serializable attribute :email, ::Sts::IsoSts::Email, collection: true attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :element_citation, ::Sts::IsoSts::ElementCitation, + collection: true attribute :mixed_citation, ::Sts::IsoSts::MixedCitation, collection: true attribute :std, ::Sts::IsoSts::Std, collection: true attribute :bold, ::Sts::IsoSts::Bold, collection: true attribute :italic, ::Sts::IsoSts::Italic, collection: true attribute :monospace, ::Sts::IsoSts::Monospace, collection: true attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true attribute :sc, ::Sts::IsoSts::Sc, collection: true attribute :strike, ::Sts::IsoSts::Strike, collection: true attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :math, ::Mml::V2::Math, collection: true attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, @@ -28,6 +42,8 @@ class Attrib < Lutaml::Model::Serializable attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true attribute :xref, ::Sts::IsoSts::Xref, collection: true attribute :std_ref, ::Sts::IsoSts::StdRef, collection: true attribute :sub, ::Sts::IsoSts::Sub, collection: true @@ -40,28 +56,41 @@ class Attrib < Lutaml::Model::Serializable map_attribute "id", to: :id map_attribute "specific-use", to: :specific_use map_attribute "xml:lang", to: :xml_lang - map_content to: :content map_element "email", to: :email map_element "ext-link", to: :ext_link map_element "uri", to: :uri + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "element-citation", to: :element_citation map_element "mixed-citation", to: :mixed_citation map_element "std", to: :std map_element "bold", to: :bold map_element "italic", to: :italic map_element "monospace", to: :monospace map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif map_element "sc", to: :sc map_element "strike", to: :strike map_element "underline", to: :underline + map_element "alternatives", to: :alternatives map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct map_element "inline-formula", to: :inline_formula + map_element "math", to: :math map_element "abbrev", to: :abbrev map_element "milestone-end", to: :milestone_end map_element "milestone-start", to: :milestone_start map_element "named-content", to: :named_content map_element "styled-content", to: :styled_content map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term map_element "xref", to: :xref map_element "std-ref", to: :std_ref map_element "sub", to: :sub diff --git a/lib/sts/iso_sts/author_comment.rb b/lib/sts/iso_sts/author_comment.rb new file mode 100644 index 0000000..953cf81 --- /dev/null +++ b/lib/sts/iso_sts/author_comment.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class AuthorComment < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :title, ::Sts::IsoSts::Title + attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true + attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, + collection: true + attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, + collection: true + + xml do + element "author-comment" + ordered + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_element "title", to: :title + map_element "p", to: :paragraph + map_element "non-normative-note", to: :non_normative_note + map_element "non-normative-example", to: :non_normative_example + end + end + end +end diff --git a/lib/sts/iso_sts/award_id.rb b/lib/sts/iso_sts/award_id.rb new file mode 100644 index 0000000..bf7ccfe --- /dev/null +++ b/lib/sts/iso_sts/award_id.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class AwardId < Lutaml::Model::Serializable + attribute :id, :string + attribute :rid, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "award-id" + mixed_content + + map_attribute "id", to: :id + map_attribute "rid", to: :rid + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/bio.rb b/lib/sts/iso_sts/bio.rb new file mode 100644 index 0000000..2f8d759 --- /dev/null +++ b/lib/sts/iso_sts/bio.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Bio < Lutaml::Model::Serializable + attribute :id, :string + attribute :rid, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :xlink_type, :string + attribute :xlink_href, :string + attribute :xlink_role, :string + attribute :xlink_title, :string + attribute :xlink_show, :string + attribute :xlink_actuate, :string + attribute :label, ::Sts::IsoSts::Label + attribute :title, ::Sts::IsoSts::Title + attribute :address, ::Sts::IsoSts::Address, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :array, ::Sts::IsoSts::Array, collection: true + attribute :boxed_text, ::Sts::IsoSts::BoxedText, collection: true + attribute :chem_struct_wrap, ::Sts::IsoSts::ChemStructWrap, + collection: true + attribute :fig, ::Sts::IsoSts::Fig, collection: true + attribute :fig_group, ::Sts::IsoSts::FigGroup, collection: true + attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :media, ::Sts::IsoSts::Media, collection: true + attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, + collection: true + attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, + collection: true + attribute :preformat, ::Sts::IsoSts::Preformat, collection: true + attribute :supplementary_material, ::Sts::IsoSts::SupplementaryMaterial, + collection: true + attribute :table_wrap, ::Sts::IsoSts::TableWrap, collection: true + attribute :table_wrap_group, ::Sts::IsoSts::TableWrapGroup, + collection: true + attribute :disp_formula, ::Sts::IsoSts::DispFormula, collection: true + attribute :disp_formula_group, ::Sts::IsoSts::DispFormulaGroup, + collection: true + attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true + attribute :def_list, ::Sts::IsoSts::DefList, collection: true + attribute :list, ::Sts::IsoSts::List, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :disp_quote, ::Sts::IsoSts::DispQuote, collection: true + attribute :speech, ::Sts::IsoSts::Speech, collection: true + attribute :statement, ::Sts::IsoSts::Statement, collection: true + attribute :verse_group, ::Sts::IsoSts::VerseGroup, collection: true + attribute :sec, ::Sts::IsoSts::Sec, collection: true + attribute :term_sec, ::Sts::IsoSts::TermSec, collection: true + attribute :fn_group, ::Sts::IsoSts::FnGroup, collection: true + attribute :glossary, ::Sts::IsoSts::Glossary, collection: true + attribute :ref_list, ::Sts::IsoSts::RefList, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "bio" + ordered + + map_attribute "id", to: :id + map_attribute "rid", to: :rid + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "xlink:type", to: :xlink_type + map_attribute "xlink:href", to: :xlink_href + map_attribute "xlink:role", to: :xlink_role + map_attribute "xlink:title", to: :xlink_title + map_attribute "xlink:show", to: :xlink_show + map_attribute "xlink:actuate", to: :xlink_actuate + map_element "label", to: :label + map_element "title", to: :title + map_element "address", to: :address + map_element "alternatives", to: :alternatives + map_element "array", to: :array + map_element "boxed-text", to: :boxed_text + map_element "chem-struct-wrap", to: :chem_struct_wrap + map_element "fig", to: :fig + map_element "fig-group", to: :fig_group + map_element "graphic", to: :graphic + map_element "media", to: :media + map_element "non-normative-note", to: :non_normative_note + map_element "non-normative-example", to: :non_normative_example + map_element "preformat", to: :preformat + map_element "supplementary-material", to: :supplementary_material + map_element "table-wrap", to: :table_wrap + map_element "table-wrap-group", to: :table_wrap_group + map_element "disp-formula", to: :disp_formula + map_element "disp-formula-group", to: :disp_formula_group + map_element "p", to: :paragraph + map_element "def-list", to: :def_list + map_element "list", to: :list + map_element "math", to: :math + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "disp-quote", to: :disp_quote + map_element "speech", to: :speech + map_element "statement", to: :statement + map_element "verse-group", to: :verse_group + map_element "sec", to: :sec + map_element "term-sec", to: :term_sec + map_element "fn-group", to: :fn_group + map_element "glossary", to: :glossary + map_element "ref-list", to: :ref_list + end + end + end +end diff --git a/lib/sts/iso_sts/boxed_text.rb b/lib/sts/iso_sts/boxed_text.rb index fff5c6d..cc1ae71 100644 --- a/lib/sts/iso_sts/boxed_text.rb +++ b/lib/sts/iso_sts/boxed_text.rb @@ -13,22 +13,44 @@ class BoxedText < Lutaml::Model::Serializable attribute :sts_object_id, ::Sts::IsoSts::ObjectId, collection: true attribute :label, ::Sts::IsoSts::Label attribute :caption, ::Sts::IsoSts::Caption - attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true - attribute :list, ::Sts::IsoSts::List, collection: true - attribute :def_list, ::Sts::IsoSts::DefList, collection: true + attribute :address, ::Sts::IsoSts::Address, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :array, ::Sts::IsoSts::Array, collection: true + attribute :boxed_text, ::Sts::IsoSts::BoxedText, collection: true + attribute :chem_struct_wrap, ::Sts::IsoSts::ChemStructWrap, + collection: true + attribute :fig, ::Sts::IsoSts::Fig, collection: true + attribute :fig_group, ::Sts::IsoSts::FigGroup, collection: true + attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :media, ::Sts::IsoSts::Media, collection: true attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, collection: true attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, collection: true attribute :preformat, ::Sts::IsoSts::Preformat, collection: true - attribute :fig, ::Sts::IsoSts::Fig, collection: true - attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :supplementary_material, ::Sts::IsoSts::SupplementaryMaterial, + collection: true + attribute :table_wrap, ::Sts::IsoSts::TableWrap, collection: true + attribute :table_wrap_group, ::Sts::IsoSts::TableWrapGroup, + collection: true attribute :disp_formula, ::Sts::IsoSts::DispFormula, collection: true + attribute :disp_formula_group, ::Sts::IsoSts::DispFormulaGroup, + collection: true + attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true + attribute :def_list, ::Sts::IsoSts::DefList, collection: true + attribute :list, ::Sts::IsoSts::List, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true attribute :disp_quote, ::Sts::IsoSts::DispQuote, collection: true - attribute :boxed_text, ::Sts::IsoSts::BoxedText, collection: true + attribute :speech, ::Sts::IsoSts::Speech, collection: true + attribute :statement, ::Sts::IsoSts::Statement, collection: true + attribute :verse_group, ::Sts::IsoSts::VerseGroup, collection: true attribute :sec, ::Sts::IsoSts::Sec, collection: true attribute :term_sec, ::Sts::IsoSts::TermSec, collection: true attribute :fn_group, ::Sts::IsoSts::FnGroup, collection: true + attribute :glossary, ::Sts::IsoSts::Glossary, collection: true attribute :ref_list, ::Sts::IsoSts::RefList, collection: true attribute :attrib, ::Sts::IsoSts::Attrib, collection: true attribute :permissions, ::Sts::IsoSts::Permissions, collection: true @@ -44,24 +66,40 @@ class BoxedText < Lutaml::Model::Serializable map_attribute "xml:lang", to: :xml_lang map_attribute "content-type", to: :content_type map_attribute "originator", to: :originator - map_element "object-id", to: :sts_object_id map_element "label", to: :label map_element "caption", to: :caption - map_element "p", to: :paragraph - map_element "list", to: :list - map_element "def-list", to: :def_list + map_element "address", to: :address + map_element "alternatives", to: :alternatives + map_element "array", to: :array + map_element "boxed-text", to: :boxed_text + map_element "chem-struct-wrap", to: :chem_struct_wrap + map_element "fig", to: :fig + map_element "fig-group", to: :fig_group + map_element "graphic", to: :graphic + map_element "media", to: :media map_element "non-normative-note", to: :non_normative_note map_element "non-normative-example", to: :non_normative_example map_element "preformat", to: :preformat - map_element "fig", to: :fig - map_element "graphic", to: :graphic + map_element "supplementary-material", to: :supplementary_material + map_element "table-wrap", to: :table_wrap + map_element "table-wrap-group", to: :table_wrap_group map_element "disp-formula", to: :disp_formula + map_element "disp-formula-group", to: :disp_formula_group + map_element "p", to: :paragraph + map_element "def-list", to: :def_list + map_element "list", to: :list + map_element "math", to: :math + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object map_element "disp-quote", to: :disp_quote - map_element "boxed-text", to: :boxed_text + map_element "speech", to: :speech + map_element "statement", to: :statement + map_element "verse-group", to: :verse_group map_element "sec", to: :sec map_element "term-sec", to: :term_sec map_element "fn-group", to: :fn_group + map_element "glossary", to: :glossary map_element "ref-list", to: :ref_list map_element "attrib", to: :attrib map_element "permissions", to: :permissions diff --git a/lib/sts/iso_sts/chapter_title.rb b/lib/sts/iso_sts/chapter_title.rb new file mode 100644 index 0000000..2902c68 --- /dev/null +++ b/lib/sts/iso_sts/chapter_title.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class ChapterTitle < Lutaml::Model::Serializable + attribute :id, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do + element "chapter-title" + mixed_content + + map_attribute "id", to: :id + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/chem_struct.rb b/lib/sts/iso_sts/chem_struct.rb new file mode 100644 index 0000000..ec42262 --- /dev/null +++ b/lib/sts/iso_sts/chem_struct.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class ChemStruct < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :xlink_type, :string + attribute :xlink_href, :string + attribute :xlink_role, :string + attribute :xlink_title, :string + attribute :xlink_show, :string + attribute :xlink_actuate, :string + attribute :content, :string, collection: true + attribute :alt_text, ::Sts::IsoSts::AltText, collection: true + attribute :long_desc, ::Sts::IsoSts::LongDesc, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :break, ::Sts::IsoSts::Break, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :label, ::Sts::IsoSts::Label, collection: true + attribute :def_list, ::Sts::IsoSts::DefList, collection: true + attribute :list, ::Sts::IsoSts::List, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :array, ::Sts::IsoSts::Array, collection: true + attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :media, ::Sts::IsoSts::Media, collection: true + attribute :preformat, ::Sts::IsoSts::Preformat, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "chem-struct" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "xlink:type", to: :xlink_type + map_attribute "xlink:href", to: :xlink_href + map_attribute "xlink:role", to: :xlink_role + map_attribute "xlink:title", to: :xlink_title + map_attribute "xlink:show", to: :xlink_show + map_attribute "xlink:actuate", to: :xlink_actuate + map_content to: :content + map_element "alt-text", to: :alt_text + map_element "long-desc", to: :long_desc + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "break", to: :break + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "label", to: :label + map_element "def-list", to: :def_list + map_element "list", to: :list + map_element "math", to: :math + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "alternatives", to: :alternatives + map_element "array", to: :array + map_element "graphic", to: :graphic + map_element "media", to: :media + map_element "preformat", to: :preformat + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/chem_struct_wrap.rb b/lib/sts/iso_sts/chem_struct_wrap.rb new file mode 100644 index 0000000..c6241ff --- /dev/null +++ b/lib/sts/iso_sts/chem_struct_wrap.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class ChemStructWrap < Lutaml::Model::Serializable + attribute :id, :string + attribute :position, :string + attribute :orientation, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content_type, :string + attribute :originator, :string + attribute :sts_object_id, ::Sts::IsoSts::ObjectId, collection: true + attribute :label, ::Sts::IsoSts::Label + attribute :caption, ::Sts::IsoSts::Caption + attribute :alt_text, ::Sts::IsoSts::AltText, collection: true + attribute :long_desc, ::Sts::IsoSts::LongDesc, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :media, ::Sts::IsoSts::Media, collection: true + attribute :preformat, ::Sts::IsoSts::Preformat, collection: true + attribute :textual_form, ::Sts::IsoSts::TextualForm, collection: true + attribute :attrib, ::Sts::IsoSts::Attrib, collection: true + attribute :permissions, ::Sts::IsoSts::Permissions, collection: true + + xml do + element "chem-struct-wrap" + ordered + + map_attribute "id", to: :id + map_attribute "position", to: :position + map_attribute "orientation", to: :orientation + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "content-type", to: :content_type + map_attribute "originator", to: :originator + map_element "object-id", to: :sts_object_id + map_element "label", to: :label + map_element "caption", to: :caption + map_element "alt-text", to: :alt_text + map_element "long-desc", to: :long_desc + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "alternatives", to: :alternatives + map_element "chem-struct", to: :chem_struct + map_element "graphic", to: :graphic + map_element "media", to: :media + map_element "preformat", to: :preformat + map_element "textual-form", to: :textual_form + map_element "attrib", to: :attrib + map_element "permissions", to: :permissions + end + end + end +end diff --git a/lib/sts/iso_sts/collab.rb b/lib/sts/iso_sts/collab.rb new file mode 100644 index 0000000..9434375 --- /dev/null +++ b/lib/sts/iso_sts/collab.rb @@ -0,0 +1,118 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Collab < Lutaml::Model::Serializable + attribute :id, :string + attribute :collab_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :xlink_type, :string + attribute :xlink_href, :string + attribute :xlink_role, :string + attribute :xlink_title, :string + attribute :xlink_show, :string + attribute :xlink_actuate, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + attribute :addr_line, ::Sts::IsoSts::AddrLine, collection: true + attribute :country, ::Sts::IsoSts::Country, collection: true + attribute :fax, ::Sts::IsoSts::Fax, collection: true + attribute :institution, ::Sts::IsoSts::Institution, collection: true + attribute :phone, ::Sts::IsoSts::Phone, collection: true + attribute :contrib_group, ::Sts::IsoSts::ContribGroup, collection: true + attribute :address, ::Sts::IsoSts::Address, collection: true + attribute :aff, ::Sts::IsoSts::Aff, collection: true + attribute :aff_alternatives, ::Sts::IsoSts::AffAlternatives, + collection: true + attribute :author_comment, ::Sts::IsoSts::AuthorComment, collection: true + attribute :bio, ::Sts::IsoSts::Bio, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :on_behalf_of, ::Sts::IsoSts::OnBehalfOf, collection: true + attribute :role, ::Sts::IsoSts::Role, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "collab" + mixed_content + + map_attribute "id", to: :id + map_attribute "collab-type", to: :collab_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "xlink:type", to: :xlink_type + map_attribute "xlink:href", to: :xlink_href + map_attribute "xlink:role", to: :xlink_role + map_attribute "xlink:title", to: :xlink_title + map_attribute "xlink:show", to: :xlink_show + map_attribute "xlink:actuate", to: :xlink_actuate + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + map_element "addr-line", to: :addr_line + map_element "country", to: :country + map_element "fax", to: :fax + map_element "institution", to: :institution + map_element "phone", to: :phone + map_element "contrib-group", to: :contrib_group + map_element "address", to: :address + map_element "aff", to: :aff + map_element "aff-alternatives", to: :aff_alternatives + map_element "author-comment", to: :author_comment + map_element "bio", to: :bio + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "on-behalf-of", to: :on_behalf_of + map_element "role", to: :role + map_element "uri", to: :uri + map_element "xref", to: :xref + map_element "fn", to: :fn + end + end + end +end diff --git a/lib/sts/iso_sts/comment.rb b/lib/sts/iso_sts/comment.rb new file mode 100644 index 0000000..e65a25e --- /dev/null +++ b/lib/sts/iso_sts/comment.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Comment < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "comment" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "math", to: :math + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/conf_date.rb b/lib/sts/iso_sts/conf_date.rb new file mode 100644 index 0000000..ab897a3 --- /dev/null +++ b/lib/sts/iso_sts/conf_date.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class ConfDate < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "conf-date" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/conf_loc.rb b/lib/sts/iso_sts/conf_loc.rb new file mode 100644 index 0000000..c64a7bb --- /dev/null +++ b/lib/sts/iso_sts/conf_loc.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class ConfLoc < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "conf-loc" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/conf_name.rb b/lib/sts/iso_sts/conf_name.rb new file mode 100644 index 0000000..119d125 --- /dev/null +++ b/lib/sts/iso_sts/conf_name.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class ConfName < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "conf-name" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/conf_sponsor.rb b/lib/sts/iso_sts/conf_sponsor.rb new file mode 100644 index 0000000..ba232d5 --- /dev/null +++ b/lib/sts/iso_sts/conf_sponsor.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class ConfSponsor < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "conf-sponsor" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/contrib.rb b/lib/sts/iso_sts/contrib.rb new file mode 100644 index 0000000..30fca0e --- /dev/null +++ b/lib/sts/iso_sts/contrib.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Contrib < Lutaml::Model::Serializable + attribute :id, :string + attribute :contrib_type, :string + attribute :corresp, :string + attribute :equal_contrib, :string + attribute :deceased, :string + attribute :rid, :string + attribute :specific_use, :string + attribute :xlink_type, :string + attribute :xlink_href, :string + attribute :xlink_role, :string + attribute :xlink_title, :string + attribute :xlink_show, :string + attribute :xlink_actuate, :string + attribute :anonymous, ::Sts::IsoSts::Anonymous, collection: true + attribute :collab, ::Sts::IsoSts::Collab, collection: true + attribute :name, ::Sts::IsoSts::Name, collection: true + attribute :name_alternatives, ::Sts::IsoSts::NameAlternatives, + collection: true + attribute :degrees, ::Sts::IsoSts::Degrees, collection: true + attribute :address, ::Sts::IsoSts::Address, collection: true + attribute :aff, ::Sts::IsoSts::Aff, collection: true + attribute :aff_alternatives, ::Sts::IsoSts::AffAlternatives, + collection: true + attribute :author_comment, ::Sts::IsoSts::AuthorComment, collection: true + attribute :bio, ::Sts::IsoSts::Bio, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :on_behalf_of, ::Sts::IsoSts::OnBehalfOf, collection: true + attribute :role, ::Sts::IsoSts::Role, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "contrib" + ordered + + map_attribute "id", to: :id + map_attribute "contrib-type", to: :contrib_type + map_attribute "corresp", to: :corresp + map_attribute "equal-contrib", to: :equal_contrib + map_attribute "deceased", to: :deceased + map_attribute "rid", to: :rid + map_attribute "specific-use", to: :specific_use + map_attribute "xlink:type", to: :xlink_type + map_attribute "xlink:href", to: :xlink_href + map_attribute "xlink:role", to: :xlink_role + map_attribute "xlink:title", to: :xlink_title + map_attribute "xlink:show", to: :xlink_show + map_attribute "xlink:actuate", to: :xlink_actuate + map_element "anonymous", to: :anonymous + map_element "collab", to: :collab + map_element "name", to: :name + map_element "name-alternatives", to: :name_alternatives + map_element "degrees", to: :degrees + map_element "address", to: :address + map_element "aff", to: :aff + map_element "aff-alternatives", to: :aff_alternatives + map_element "author-comment", to: :author_comment + map_element "bio", to: :bio + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "on-behalf-of", to: :on_behalf_of + map_element "role", to: :role + map_element "uri", to: :uri + map_element "xref", to: :xref + end + end + end +end diff --git a/lib/sts/iso_sts/contrib_group.rb b/lib/sts/iso_sts/contrib_group.rb new file mode 100644 index 0000000..bfa2485 --- /dev/null +++ b/lib/sts/iso_sts/contrib_group.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class ContribGroup < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :contrib, ::Sts::IsoSts::Contrib, collection: true + attribute :address, ::Sts::IsoSts::Address, collection: true + attribute :aff, ::Sts::IsoSts::Aff, collection: true + attribute :aff_alternatives, ::Sts::IsoSts::AffAlternatives, + collection: true + attribute :author_comment, ::Sts::IsoSts::AuthorComment, collection: true + attribute :bio, ::Sts::IsoSts::Bio, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :on_behalf_of, ::Sts::IsoSts::OnBehalfOf, collection: true + attribute :role, ::Sts::IsoSts::Role, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + + xml do + element "contrib-group" + ordered + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_element "contrib", to: :contrib + map_element "address", to: :address + map_element "aff", to: :aff + map_element "aff-alternatives", to: :aff_alternatives + map_element "author-comment", to: :author_comment + map_element "bio", to: :bio + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "on-behalf-of", to: :on_behalf_of + map_element "role", to: :role + map_element "uri", to: :uri + map_element "xref", to: :xref + end + end + end +end diff --git a/lib/sts/iso_sts/custom_meta.rb b/lib/sts/iso_sts/custom_meta.rb index ea7c715..508e6fc 100644 --- a/lib/sts/iso_sts/custom_meta.rb +++ b/lib/sts/iso_sts/custom_meta.rb @@ -28,7 +28,6 @@ class CustomMeta < Lutaml::Model::Serializable map_attribute "xlink:title", to: :xlink_title map_attribute "xlink:show", to: :xlink_show map_attribute "xlink:actuate", to: :xlink_actuate - map_element "meta-name", to: :meta_name map_element "meta-value", to: :meta_value end diff --git a/lib/sts/iso_sts/custom_meta_group.rb b/lib/sts/iso_sts/custom_meta_group.rb index aa72ecb..afe500e 100644 --- a/lib/sts/iso_sts/custom_meta_group.rb +++ b/lib/sts/iso_sts/custom_meta_group.rb @@ -3,12 +3,14 @@ module Sts module IsoSts class CustomMetaGroup < Lutaml::Model::Serializable + attribute :id, :string attribute :custom_meta, ::Sts::IsoSts::CustomMeta, collection: true xml do element "custom-meta-group" ordered + map_attribute "id", to: :id map_element "custom-meta", to: :custom_meta end end diff --git a/lib/sts/iso_sts/date.rb b/lib/sts/iso_sts/date.rb new file mode 100644 index 0000000..edb5b9e --- /dev/null +++ b/lib/sts/iso_sts/date.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Date < Lutaml::Model::Serializable + attribute :id, :string + attribute :date_type, :string + attribute :specific_use, :string + attribute :day, ::Sts::IsoSts::Day + attribute :month, ::Sts::IsoSts::Month + attribute :season, ::Sts::IsoSts::Season + attribute :year, ::Sts::IsoSts::Year + + xml do + element "date" + ordered + + map_attribute "id", to: :id + map_attribute "date-type", to: :date_type + map_attribute "specific-use", to: :specific_use + map_element "day", to: :day + map_element "month", to: :month + map_element "season", to: :season + map_element "year", to: :year + end + end + end +end diff --git a/lib/sts/iso_sts/date_in_citation.rb b/lib/sts/iso_sts/date_in_citation.rb new file mode 100644 index 0000000..0a12762 --- /dev/null +++ b/lib/sts/iso_sts/date_in_citation.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class DateInCitation < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :day, ::Sts::IsoSts::Day, collection: true + attribute :month, ::Sts::IsoSts::Month, collection: true + attribute :season, ::Sts::IsoSts::Season, collection: true + attribute :year, ::Sts::IsoSts::Year, collection: true + + xml do + element "date-in-citation" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "day", to: :day + map_element "month", to: :month + map_element "season", to: :season + map_element "year", to: :year + end + end + end +end diff --git a/lib/sts/iso_sts/degrees.rb b/lib/sts/iso_sts/degrees.rb new file mode 100644 index 0000000..cf13a8e --- /dev/null +++ b/lib/sts/iso_sts/degrees.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Degrees < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "degrees" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/disp_formula_group.rb b/lib/sts/iso_sts/disp_formula_group.rb new file mode 100644 index 0000000..87dea5f --- /dev/null +++ b/lib/sts/iso_sts/disp_formula_group.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class DispFormulaGroup < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :originator, :string + attribute :label, ::Sts::IsoSts::Label + attribute :caption, ::Sts::IsoSts::Caption + attribute :alt_text, ::Sts::IsoSts::AltText, collection: true + attribute :long_desc, ::Sts::IsoSts::LongDesc, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :disp_formula, ::Sts::IsoSts::DispFormula, collection: true + attribute :disp_formula_group, ::Sts::IsoSts::DispFormulaGroup, + collection: true + + xml do + element "disp-formula-group" + ordered + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "originator", to: :originator + map_element "label", to: :label + map_element "caption", to: :caption + map_element "alt-text", to: :alt_text + map_element "long-desc", to: :long_desc + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "disp-formula", to: :disp_formula + map_element "disp-formula-group", to: :disp_formula_group + end + end + end +end diff --git a/lib/sts/iso_sts/disp_quote.rb b/lib/sts/iso_sts/disp_quote.rb index 4973a79..0623646 100644 --- a/lib/sts/iso_sts/disp_quote.rb +++ b/lib/sts/iso_sts/disp_quote.rb @@ -10,22 +10,44 @@ class DispQuote < Lutaml::Model::Serializable attribute :originator, :string attribute :label, ::Sts::IsoSts::Label attribute :title, ::Sts::IsoSts::Title - attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true - attribute :list, ::Sts::IsoSts::List, collection: true - attribute :def_list, ::Sts::IsoSts::DefList, collection: true + attribute :address, ::Sts::IsoSts::Address, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :array, ::Sts::IsoSts::Array, collection: true + attribute :boxed_text, ::Sts::IsoSts::BoxedText, collection: true + attribute :chem_struct_wrap, ::Sts::IsoSts::ChemStructWrap, + collection: true + attribute :fig, ::Sts::IsoSts::Fig, collection: true + attribute :fig_group, ::Sts::IsoSts::FigGroup, collection: true + attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :media, ::Sts::IsoSts::Media, collection: true attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, collection: true attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, collection: true attribute :preformat, ::Sts::IsoSts::Preformat, collection: true - attribute :fig, ::Sts::IsoSts::Fig, collection: true - attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :supplementary_material, ::Sts::IsoSts::SupplementaryMaterial, + collection: true + attribute :table_wrap, ::Sts::IsoSts::TableWrap, collection: true + attribute :table_wrap_group, ::Sts::IsoSts::TableWrapGroup, + collection: true attribute :disp_formula, ::Sts::IsoSts::DispFormula, collection: true + attribute :disp_formula_group, ::Sts::IsoSts::DispFormulaGroup, + collection: true + attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true + attribute :def_list, ::Sts::IsoSts::DefList, collection: true + attribute :list, ::Sts::IsoSts::List, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true attribute :disp_quote, ::Sts::IsoSts::DispQuote, collection: true + attribute :speech, ::Sts::IsoSts::Speech, collection: true + attribute :statement, ::Sts::IsoSts::Statement, collection: true + attribute :verse_group, ::Sts::IsoSts::VerseGroup, collection: true attribute :attrib, ::Sts::IsoSts::Attrib, collection: true attribute :permissions, ::Sts::IsoSts::Permissions, collection: true - xml do + xml do # rubocop:disable Metrics/BlockLength element "disp-quote" ordered @@ -34,19 +56,35 @@ class DispQuote < Lutaml::Model::Serializable map_attribute "specific-use", to: :specific_use map_attribute "xml:lang", to: :xml_lang map_attribute "originator", to: :originator - map_element "label", to: :label map_element "title", to: :title - map_element "p", to: :paragraph - map_element "list", to: :list - map_element "def-list", to: :def_list + map_element "address", to: :address + map_element "alternatives", to: :alternatives + map_element "array", to: :array + map_element "boxed-text", to: :boxed_text + map_element "chem-struct-wrap", to: :chem_struct_wrap + map_element "fig", to: :fig + map_element "fig-group", to: :fig_group + map_element "graphic", to: :graphic + map_element "media", to: :media map_element "non-normative-note", to: :non_normative_note map_element "non-normative-example", to: :non_normative_example map_element "preformat", to: :preformat - map_element "fig", to: :fig - map_element "graphic", to: :graphic + map_element "supplementary-material", to: :supplementary_material + map_element "table-wrap", to: :table_wrap + map_element "table-wrap-group", to: :table_wrap_group map_element "disp-formula", to: :disp_formula + map_element "disp-formula-group", to: :disp_formula_group + map_element "p", to: :paragraph + map_element "def-list", to: :def_list + map_element "list", to: :list + map_element "math", to: :math + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object map_element "disp-quote", to: :disp_quote + map_element "speech", to: :speech + map_element "statement", to: :statement + map_element "verse-group", to: :verse_group map_element "attrib", to: :attrib map_element "permissions", to: :permissions end diff --git a/lib/sts/iso_sts/element_citation.rb b/lib/sts/iso_sts/element_citation.rb new file mode 100644 index 0000000..c358a4b --- /dev/null +++ b/lib/sts/iso_sts/element_citation.rb @@ -0,0 +1,203 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class ElementCitation < Lutaml::Model::Serializable + attribute :id, :string + attribute :publication_type, :string + attribute :publisher_type, :string + attribute :publication_format, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :xlink_type, :string + attribute :xlink_href, :string + attribute :xlink_role, :string + attribute :xlink_title, :string + attribute :xlink_show, :string + attribute :xlink_actuate, :string + attribute :break, ::Sts::IsoSts::Break, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :label, ::Sts::IsoSts::Label, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :annotation, ::Sts::IsoSts::Annotation, collection: true + attribute :article_title, ::Sts::IsoSts::ArticleTitle, collection: true + attribute :chapter_title, ::Sts::IsoSts::ChapterTitle, collection: true + attribute :collab, ::Sts::IsoSts::Collab, collection: true + attribute :comment, ::Sts::IsoSts::Comment, collection: true + attribute :conf_date, ::Sts::IsoSts::ConfDate, collection: true + attribute :conf_loc, ::Sts::IsoSts::ConfLoc, collection: true + attribute :conf_name, ::Sts::IsoSts::ConfName, collection: true + attribute :conf_sponsor, ::Sts::IsoSts::ConfSponsor, collection: true + attribute :date, ::Sts::IsoSts::Date, collection: true + attribute :date_in_citation, ::Sts::IsoSts::DateInCitation, + collection: true + attribute :day, ::Sts::IsoSts::Day, collection: true + attribute :edition, ::Sts::IsoSts::Edition, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :elocation_id, ::Sts::IsoSts::ElocationId, collection: true + attribute :etal, ::Sts::IsoSts::Etal, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :fpage, ::Sts::IsoSts::Fpage, collection: true + attribute :gov, ::Sts::IsoSts::Gov, collection: true + attribute :institution, ::Sts::IsoSts::Institution, collection: true + attribute :isbn, ::Sts::IsoSts::Isbn, collection: true + attribute :issn, ::Sts::IsoSts::Issn, collection: true + attribute :issue, ::Sts::IsoSts::Issue, collection: true + attribute :issue_id, ::Sts::IsoSts::IssueId, collection: true + attribute :issue_part, ::Sts::IsoSts::IssuePart, collection: true + attribute :issue_title, ::Sts::IsoSts::IssueTitle, collection: true + attribute :lpage, ::Sts::IsoSts::Lpage, collection: true + attribute :month, ::Sts::IsoSts::Month, collection: true + attribute :name, ::Sts::IsoSts::Name, collection: true + attribute :name_alternatives, ::Sts::IsoSts::NameAlternatives, + collection: true + attribute :sts_object_id, ::Sts::IsoSts::ObjectId, collection: true + attribute :page_range, ::Sts::IsoSts::PageRange, collection: true + attribute :part_title, ::Sts::IsoSts::PartTitle, collection: true + attribute :patent, ::Sts::IsoSts::Patent, collection: true + attribute :person_group, ::Sts::IsoSts::PersonGroup, collection: true + attribute :pub_id, ::Sts::IsoSts::PubId, collection: true + attribute :publisher_loc, ::Sts::IsoSts::PublisherLoc, collection: true + attribute :publisher_name, ::Sts::IsoSts::PublisherName, collection: true + attribute :role, ::Sts::IsoSts::Role, collection: true + attribute :season, ::Sts::IsoSts::Season, collection: true + attribute :series, ::Sts::IsoSts::Series, collection: true + attribute :size, ::Sts::IsoSts::Size, collection: true + attribute :source, ::Sts::IsoSts::Source, collection: true + attribute :std, ::Sts::IsoSts::Std, collection: true + attribute :string_name, ::Sts::IsoSts::StringName, collection: true + attribute :supplement, ::Sts::IsoSts::Supplement, collection: true + attribute :trans_source, ::Sts::IsoSts::TransSource, collection: true + attribute :trans_title, ::Sts::IsoSts::TransTitle, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :volume, ::Sts::IsoSts::Volume, collection: true + attribute :volume_id, ::Sts::IsoSts::VolumeId, collection: true + attribute :volume_series, ::Sts::IsoSts::VolumeSeries, collection: true + attribute :year, ::Sts::IsoSts::Year, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "element-citation" + ordered + + map_attribute "id", to: :id + map_attribute "publication-type", to: :publication_type + map_attribute "publisher-type", to: :publisher_type + map_attribute "publication-format", to: :publication_format + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "xlink:type", to: :xlink_type + map_attribute "xlink:href", to: :xlink_href + map_attribute "xlink:role", to: :xlink_role + map_attribute "xlink:title", to: :xlink_title + map_attribute "xlink:show", to: :xlink_show + map_attribute "xlink:actuate", to: :xlink_actuate + map_element "break", to: :break + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "label", to: :label + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "annotation", to: :annotation + map_element "article-title", to: :article_title + map_element "chapter-title", to: :chapter_title + map_element "collab", to: :collab + map_element "comment", to: :comment + map_element "conf-date", to: :conf_date + map_element "conf-loc", to: :conf_loc + map_element "conf-name", to: :conf_name + map_element "conf-sponsor", to: :conf_sponsor + map_element "date", to: :date + map_element "date-in-citation", to: :date_in_citation + map_element "day", to: :day + map_element "edition", to: :edition + map_element "email", to: :email + map_element "elocation-id", to: :elocation_id + map_element "etal", to: :etal + map_element "ext-link", to: :ext_link + map_element "fpage", to: :fpage + map_element "gov", to: :gov + map_element "institution", to: :institution + map_element "isbn", to: :isbn + map_element "issn", to: :issn + map_element "issue", to: :issue + map_element "issue-id", to: :issue_id + map_element "issue-part", to: :issue_part + map_element "issue-title", to: :issue_title + map_element "lpage", to: :lpage + map_element "month", to: :month + map_element "name", to: :name + map_element "name-alternatives", to: :name_alternatives + map_element "object-id", to: :sts_object_id + map_element "page-range", to: :page_range + map_element "part-title", to: :part_title + map_element "patent", to: :patent + map_element "person-group", to: :person_group + map_element "pub-id", to: :pub_id + map_element "publisher-loc", to: :publisher_loc + map_element "publisher-name", to: :publisher_name + map_element "role", to: :role + map_element "season", to: :season + map_element "series", to: :series + map_element "size", to: :size + map_element "source", to: :source + map_element "std", to: :std + map_element "string-name", to: :string_name + map_element "supplement", to: :supplement + map_element "trans-source", to: :trans_source + map_element "trans-title", to: :trans_title + map_element "uri", to: :uri + map_element "volume", to: :volume + map_element "volume-id", to: :volume_id + map_element "volume-series", to: :volume_series + map_element "year", to: :year + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/elocation_id.rb b/lib/sts/iso_sts/elocation_id.rb new file mode 100644 index 0000000..ebdbad7 --- /dev/null +++ b/lib/sts/iso_sts/elocation_id.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class ElocationId < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :seq, :string + attribute :specific_use, :string + attribute :content, :string, collection: true + + xml do + element "elocation-id" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "seq", to: :seq + map_attribute "specific-use", to: :specific_use + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/fig_group.rb b/lib/sts/iso_sts/fig_group.rb new file mode 100644 index 0000000..12eb9ef --- /dev/null +++ b/lib/sts/iso_sts/fig_group.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class FigGroup < Lutaml::Model::Serializable + attribute :id, :string + attribute :position, :string + attribute :orientation, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content_type, :string + attribute :originator, :string + attribute :label, ::Sts::IsoSts::Label + attribute :caption, ::Sts::IsoSts::Caption + attribute :alt_text, ::Sts::IsoSts::AltText, collection: true + attribute :long_desc, ::Sts::IsoSts::LongDesc, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :fig, ::Sts::IsoSts::Fig, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :media, ::Sts::IsoSts::Media, collection: true + + xml do + element "fig-group" + ordered + + map_attribute "id", to: :id + map_attribute "position", to: :position + map_attribute "orientation", to: :orientation + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "content-type", to: :content_type + map_attribute "originator", to: :originator + map_element "label", to: :label + map_element "caption", to: :caption + map_element "alt-text", to: :alt_text + map_element "long-desc", to: :long_desc + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "fig", to: :fig + map_element "alternatives", to: :alternatives + map_element "graphic", to: :graphic + map_element "media", to: :media + end + end + end +end diff --git a/lib/sts/iso_sts/funding_source.rb b/lib/sts/iso_sts/funding_source.rb new file mode 100644 index 0000000..12dac68 --- /dev/null +++ b/lib/sts/iso_sts/funding_source.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class FundingSource < Lutaml::Model::Serializable + attribute :id, :string + attribute :rid, :string + attribute :source_type, :string + attribute :country, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :xlink_type, :string + attribute :xlink_href, :string + attribute :xlink_role, :string + attribute :xlink_title, :string + attribute :xlink_show, :string + attribute :xlink_actuate, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "funding-source" + mixed_content + + map_attribute "id", to: :id + map_attribute "rid", to: :rid + map_attribute "source-type", to: :source_type + map_attribute "country", to: :country + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "xlink:type", to: :xlink_type + map_attribute "xlink:href", to: :xlink_href + map_attribute "xlink:role", to: :xlink_role + map_attribute "xlink:title", to: :xlink_title + map_attribute "xlink:show", to: :xlink_show + map_attribute "xlink:actuate", to: :xlink_actuate + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/given_names.rb b/lib/sts/iso_sts/given_names.rb new file mode 100644 index 0000000..635f245 --- /dev/null +++ b/lib/sts/iso_sts/given_names.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class GivenNames < Lutaml::Model::Serializable + attribute :id, :string + attribute :initials, :string + attribute :content, :string, collection: true + + xml do + element "given-names" + mixed_content + + map_attribute "id", to: :id + map_attribute "initials", to: :initials + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/glossary.rb b/lib/sts/iso_sts/glossary.rb new file mode 100644 index 0000000..a23058a --- /dev/null +++ b/lib/sts/iso_sts/glossary.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Glossary < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :originator, :string + attribute :label, ::Sts::IsoSts::Label + attribute :title, ::Sts::IsoSts::Title + attribute :address, ::Sts::IsoSts::Address, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :array, ::Sts::IsoSts::Array, collection: true + attribute :boxed_text, ::Sts::IsoSts::BoxedText, collection: true + attribute :chem_struct_wrap, ::Sts::IsoSts::ChemStructWrap, + collection: true + attribute :fig, ::Sts::IsoSts::Fig, collection: true + attribute :fig_group, ::Sts::IsoSts::FigGroup, collection: true + attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :media, ::Sts::IsoSts::Media, collection: true + attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, + collection: true + attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, + collection: true + attribute :preformat, ::Sts::IsoSts::Preformat, collection: true + attribute :supplementary_material, ::Sts::IsoSts::SupplementaryMaterial, + collection: true + attribute :table_wrap, ::Sts::IsoSts::TableWrap, collection: true + attribute :table_wrap_group, ::Sts::IsoSts::TableWrapGroup, + collection: true + attribute :disp_formula, ::Sts::IsoSts::DispFormula, collection: true + attribute :disp_formula_group, ::Sts::IsoSts::DispFormulaGroup, + collection: true + attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true + attribute :def_list, ::Sts::IsoSts::DefList, collection: true + attribute :list, ::Sts::IsoSts::List, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :disp_quote, ::Sts::IsoSts::DispQuote, collection: true + attribute :speech, ::Sts::IsoSts::Speech, collection: true + attribute :statement, ::Sts::IsoSts::Statement, collection: true + attribute :verse_group, ::Sts::IsoSts::VerseGroup, collection: true + attribute :glossary, ::Sts::IsoSts::Glossary, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "glossary" + ordered + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "originator", to: :originator + map_element "label", to: :label + map_element "title", to: :title + map_element "address", to: :address + map_element "alternatives", to: :alternatives + map_element "array", to: :array + map_element "boxed-text", to: :boxed_text + map_element "chem-struct-wrap", to: :chem_struct_wrap + map_element "fig", to: :fig + map_element "fig-group", to: :fig_group + map_element "graphic", to: :graphic + map_element "media", to: :media + map_element "non-normative-note", to: :non_normative_note + map_element "non-normative-example", to: :non_normative_example + map_element "preformat", to: :preformat + map_element "supplementary-material", to: :supplementary_material + map_element "table-wrap", to: :table_wrap + map_element "table-wrap-group", to: :table_wrap_group + map_element "disp-formula", to: :disp_formula + map_element "disp-formula-group", to: :disp_formula_group + map_element "p", to: :paragraph + map_element "def-list", to: :def_list + map_element "list", to: :list + map_element "math", to: :math + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "disp-quote", to: :disp_quote + map_element "speech", to: :speech + map_element "statement", to: :statement + map_element "verse-group", to: :verse_group + map_element "glossary", to: :glossary + end + end + end +end diff --git a/lib/sts/iso_sts/glyph_data.rb b/lib/sts/iso_sts/glyph_data.rb new file mode 100644 index 0000000..a084b02 --- /dev/null +++ b/lib/sts/iso_sts/glyph_data.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class GlyphData < Lutaml::Model::Serializable + attribute :id, :string + attribute :fontchar, :string + attribute :fontname, :string + attribute :format, :string + attribute :resolution, :string + attribute :xml_space, :string + attribute :x_size, :string + attribute :y_size, :string + attribute :content, :string, collection: true + + xml do + element "glyph-data" + mixed_content + + map_attribute "id", to: :id + map_attribute "fontchar", to: :fontchar + map_attribute "fontname", to: :fontname + map_attribute "format", to: :format + map_attribute "resolution", to: :resolution + map_attribute "xml:space", to: :xml_space + map_attribute "x-size", to: :x_size + map_attribute "y-size", to: :y_size + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/glyph_ref.rb b/lib/sts/iso_sts/glyph_ref.rb new file mode 100644 index 0000000..5e1b413 --- /dev/null +++ b/lib/sts/iso_sts/glyph_ref.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class GlyphRef < Lutaml::Model::Serializable + attribute :id, :string + attribute :glyph_data, :string + + xml do + element "glyph-ref" + + map_attribute "id", to: :id + map_attribute "glyph-data", to: :glyph_data + end + end + end +end diff --git a/lib/sts/iso_sts/gov.rb b/lib/sts/iso_sts/gov.rb new file mode 100644 index 0000000..efdae66 --- /dev/null +++ b/lib/sts/iso_sts/gov.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Gov < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + + xml do + element "gov" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "sub", to: :sub + map_element "sup", to: :sup + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + end + end + end +end diff --git a/lib/sts/iso_sts/inline_supplementary_material.rb b/lib/sts/iso_sts/inline_supplementary_material.rb new file mode 100644 index 0000000..6bdbb65 --- /dev/null +++ b/lib/sts/iso_sts/inline_supplementary_material.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class InlineSupplementaryMaterial < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :mimetype, :string + attribute :mime_subtype, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :xlink_type, :string + attribute :xlink_href, :string + attribute :xlink_role, :string + attribute :xlink_title, :string + attribute :xlink_show, :string + attribute :xlink_actuate, :string + attribute :content, :string, collection: true + attribute :alt_text, ::Sts::IsoSts::AltText, collection: true + attribute :long_desc, ::Sts::IsoSts::LongDesc, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "inline-supplementary-material" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "mimetype", to: :mimetype + map_attribute "mime-subtype", to: :mime_subtype + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "xlink:type", to: :xlink_type + map_attribute "xlink:href", to: :xlink_href + map_attribute "xlink:role", to: :xlink_role + map_attribute "xlink:title", to: :xlink_title + map_attribute "xlink:show", to: :xlink_show + map_attribute "xlink:actuate", to: :xlink_actuate + map_content to: :content + map_element "alt-text", to: :alt_text + map_element "long-desc", to: :long_desc + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/isbn.rb b/lib/sts/iso_sts/isbn.rb new file mode 100644 index 0000000..b835988 --- /dev/null +++ b/lib/sts/iso_sts/isbn.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Isbn < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :content, :string, collection: true + + xml do + element "isbn" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/issn.rb b/lib/sts/iso_sts/issn.rb new file mode 100644 index 0000000..9f64315 --- /dev/null +++ b/lib/sts/iso_sts/issn.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Issn < Lutaml::Model::Serializable + attribute :id, :string + attribute :pub_type, :string + attribute :specific_use, :string + attribute :content, :string, collection: true + + xml do + element "issn" + mixed_content + + map_attribute "id", to: :id + map_attribute "pub-type", to: :pub_type + map_attribute "specific-use", to: :specific_use + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/issue_id.rb b/lib/sts/iso_sts/issue_id.rb new file mode 100644 index 0000000..9f76d34 --- /dev/null +++ b/lib/sts/iso_sts/issue_id.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class IssueId < Lutaml::Model::Serializable + attribute :id, :string + attribute :pub_id_type, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "issue-id" + mixed_content + + map_attribute "id", to: :id + map_attribute "pub-id-type", to: :pub_id_type + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/issue_part.rb b/lib/sts/iso_sts/issue_part.rb new file mode 100644 index 0000000..e110121 --- /dev/null +++ b/lib/sts/iso_sts/issue_part.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class IssuePart < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "issue-part" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/issue_title.rb b/lib/sts/iso_sts/issue_title.rb new file mode 100644 index 0000000..a3d760e --- /dev/null +++ b/lib/sts/iso_sts/issue_title.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class IssueTitle < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "issue-title" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/journal_id.rb b/lib/sts/iso_sts/journal_id.rb new file mode 100644 index 0000000..c95e94e --- /dev/null +++ b/lib/sts/iso_sts/journal_id.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class JournalId < Lutaml::Model::Serializable + attribute :id, :string + attribute :journal_id_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "journal-id" + mixed_content + + map_attribute "id", to: :id + map_attribute "journal-id-type", to: :journal_id_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/license.rb b/lib/sts/iso_sts/license.rb index 9f528cf..732dd4d 100644 --- a/lib/sts/iso_sts/license.rb +++ b/lib/sts/iso_sts/license.rb @@ -3,6 +3,7 @@ module Sts module IsoSts class License < Lutaml::Model::Serializable + attribute :id, :string attribute :license_type, :string attribute :specific_use, :string attribute :xml_lang, :string @@ -18,6 +19,7 @@ class License < Lutaml::Model::Serializable element "license" ordered + map_attribute "id", to: :id map_attribute "license-type", to: :license_type map_attribute "specific-use", to: :specific_use map_attribute "xml:lang", to: :xml_lang @@ -27,7 +29,6 @@ class License < Lutaml::Model::Serializable map_attribute "xlink:title", to: :xlink_title map_attribute "xlink:show", to: :xlink_show map_attribute "xlink:actuate", to: :xlink_actuate - map_element "license-p", to: :license_p end end diff --git a/lib/sts/iso_sts/license_p.rb b/lib/sts/iso_sts/license_p.rb index ba88751..fc42146 100644 --- a/lib/sts/iso_sts/license_p.rb +++ b/lib/sts/iso_sts/license_p.rb @@ -5,46 +5,80 @@ module IsoSts class LicenseP < Lutaml::Model::Serializable attribute :id, :string attribute :specific_use, :string - attribute :xml_lang, :string - attribute :content_type, :string attribute :content, :string, collection: true attribute :email, ::Sts::IsoSts::Email, collection: true attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :address, ::Sts::IsoSts::Address, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :array, ::Sts::IsoSts::Array, collection: true + attribute :boxed_text, ::Sts::IsoSts::BoxedText, collection: true + attribute :chem_struct_wrap, ::Sts::IsoSts::ChemStructWrap, + collection: true + attribute :fig, ::Sts::IsoSts::Fig, collection: true + attribute :fig_group, ::Sts::IsoSts::FigGroup, collection: true + attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :media, ::Sts::IsoSts::Media, collection: true + attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, + collection: true + attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, + collection: true + attribute :preformat, ::Sts::IsoSts::Preformat, collection: true + attribute :supplementary_material, ::Sts::IsoSts::SupplementaryMaterial, + collection: true + attribute :table_wrap, ::Sts::IsoSts::TableWrap, collection: true + attribute :table_wrap_group, ::Sts::IsoSts::TableWrapGroup, + collection: true + attribute :disp_formula, ::Sts::IsoSts::DispFormula, collection: true + attribute :disp_formula_group, ::Sts::IsoSts::DispFormulaGroup, + collection: true + attribute :element_citation, ::Sts::IsoSts::ElementCitation, + collection: true attribute :mixed_citation, ::Sts::IsoSts::MixedCitation, collection: true attribute :std, ::Sts::IsoSts::Std, collection: true attribute :bold, ::Sts::IsoSts::Bold, collection: true attribute :italic, ::Sts::IsoSts::Italic, collection: true attribute :monospace, ::Sts::IsoSts::Monospace, collection: true attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true attribute :sc, ::Sts::IsoSts::Sc, collection: true attribute :strike, ::Sts::IsoSts::Strike, collection: true attribute :underline, ::Sts::IsoSts::Underline, collection: true - attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :award_id, ::Sts::IsoSts::AwardId, collection: true + attribute :funding_source, ::Sts::IsoSts::FundingSource, collection: true + attribute :open_access, ::Sts::IsoSts::OpenAccess, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :def_list, ::Sts::IsoSts::DefList, collection: true + attribute :list, ::Sts::IsoSts::List, collection: true + attribute :math, ::Mml::V2::Math, collection: true attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, collection: true attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true - attribute :list, ::Sts::IsoSts::List, collection: true - attribute :def_list, ::Sts::IsoSts::DefList, collection: true - attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, - collection: true - attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, - collection: true - attribute :preformat, ::Sts::IsoSts::Preformat, collection: true - attribute :fig, ::Sts::IsoSts::Fig, collection: true - attribute :graphic, ::Sts::IsoSts::Graphic, collection: true - attribute :disp_formula, ::Sts::IsoSts::DispFormula, collection: true attribute :disp_quote, ::Sts::IsoSts::DispQuote, collection: true - attribute :boxed_text, ::Sts::IsoSts::BoxedText, collection: true + attribute :speech, ::Sts::IsoSts::Speech, collection: true + attribute :statement, ::Sts::IsoSts::Statement, collection: true + attribute :verse_group, ::Sts::IsoSts::VerseGroup, collection: true attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true attribute :xref, ::Sts::IsoSts::Xref, collection: true - attribute :std_ref, ::Sts::IsoSts::StdRef, collection: true + attribute :break, ::Sts::IsoSts::Break, collection: true attribute :sub, ::Sts::IsoSts::Sub, collection: true attribute :sup, ::Sts::IsoSts::Sup, collection: true + attribute :price, ::Sts::IsoSts::Price, collection: true xml do # rubocop:disable Metrics/BlockLength element "license-p" @@ -52,44 +86,71 @@ class LicenseP < Lutaml::Model::Serializable map_attribute "id", to: :id map_attribute "specific-use", to: :specific_use - map_attribute "xml:lang", to: :xml_lang - map_attribute "content-type", to: :content_type - map_content to: :content map_element "email", to: :email map_element "ext-link", to: :ext_link map_element "uri", to: :uri + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "address", to: :address + map_element "alternatives", to: :alternatives + map_element "array", to: :array + map_element "boxed-text", to: :boxed_text + map_element "chem-struct-wrap", to: :chem_struct_wrap + map_element "fig", to: :fig + map_element "fig-group", to: :fig_group + map_element "graphic", to: :graphic + map_element "media", to: :media + map_element "non-normative-note", to: :non_normative_note + map_element "non-normative-example", to: :non_normative_example + map_element "preformat", to: :preformat + map_element "supplementary-material", to: :supplementary_material + map_element "table-wrap", to: :table_wrap + map_element "table-wrap-group", to: :table_wrap_group + map_element "disp-formula", to: :disp_formula + map_element "disp-formula-group", to: :disp_formula_group + map_element "element-citation", to: :element_citation map_element "mixed-citation", to: :mixed_citation map_element "std", to: :std map_element "bold", to: :bold map_element "italic", to: :italic map_element "monospace", to: :monospace map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif map_element "sc", to: :sc map_element "strike", to: :strike map_element "underline", to: :underline - map_element "inline-graphic", to: :inline_graphic + map_element "award-id", to: :award_id + map_element "funding-source", to: :funding_source + map_element "open-access", to: :open_access + map_element "chem-struct", to: :chem_struct map_element "inline-formula", to: :inline_formula + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "def-list", to: :def_list + map_element "list", to: :list + map_element "math", to: :math map_element "abbrev", to: :abbrev map_element "milestone-end", to: :milestone_end map_element "milestone-start", to: :milestone_start map_element "named-content", to: :named_content map_element "styled-content", to: :styled_content - map_element "list", to: :list - map_element "def-list", to: :def_list - map_element "non-normative-note", to: :non_normative_note - map_element "non-normative-example", to: :non_normative_example - map_element "preformat", to: :preformat - map_element "fig", to: :fig - map_element "graphic", to: :graphic - map_element "disp-formula", to: :disp_formula map_element "disp-quote", to: :disp_quote - map_element "boxed-text", to: :boxed_text + map_element "speech", to: :speech + map_element "statement", to: :statement + map_element "verse-group", to: :verse_group map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term map_element "xref", to: :xref - map_element "std-ref", to: :std_ref + map_element "break", to: :break map_element "sub", to: :sub map_element "sup", to: :sup + map_element "price", to: :price end end end diff --git a/lib/sts/iso_sts/media.rb b/lib/sts/iso_sts/media.rb new file mode 100644 index 0000000..1e735c8 --- /dev/null +++ b/lib/sts/iso_sts/media.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Media < Lutaml::Model::Serializable + attribute :id, :string + attribute :position, :string + attribute :orientation, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content_type, :string + attribute :mimetype, :string + attribute :mime_subtype, :string + attribute :xlink_type, :string + attribute :xlink_href, :string + attribute :xlink_role, :string + attribute :xlink_title, :string + attribute :xlink_show, :string + attribute :xlink_actuate, :string + attribute :originator, :string + attribute :alt_text, ::Sts::IsoSts::AltText, collection: true + attribute :long_desc, ::Sts::IsoSts::LongDesc, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :sts_object_id, ::Sts::IsoSts::ObjectId, collection: true + attribute :label, ::Sts::IsoSts::Label, collection: true + attribute :caption, ::Sts::IsoSts::Caption, collection: true + attribute :attrib, ::Sts::IsoSts::Attrib, collection: true + attribute :permissions, ::Sts::IsoSts::Permissions, collection: true + + xml do + element "media" + ordered + + map_attribute "id", to: :id + map_attribute "position", to: :position + map_attribute "orientation", to: :orientation + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "content-type", to: :content_type + map_attribute "mimetype", to: :mimetype + map_attribute "mime-subtype", to: :mime_subtype + map_attribute "xlink:type", to: :xlink_type + map_attribute "xlink:href", to: :xlink_href + map_attribute "xlink:role", to: :xlink_role + map_attribute "xlink:title", to: :xlink_title + map_attribute "xlink:show", to: :xlink_show + map_attribute "xlink:actuate", to: :xlink_actuate + map_attribute "originator", to: :originator + map_element "alt-text", to: :alt_text + map_element "long-desc", to: :long_desc + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "object-id", to: :sts_object_id + map_element "label", to: :label + map_element "caption", to: :caption + map_element "attrib", to: :attrib + map_element "permissions", to: :permissions + end + end + end +end diff --git a/lib/sts/iso_sts/meta_name.rb b/lib/sts/iso_sts/meta_name.rb index c586ef6..6f213cd 100644 --- a/lib/sts/iso_sts/meta_name.rb +++ b/lib/sts/iso_sts/meta_name.rb @@ -3,10 +3,13 @@ module Sts module IsoSts class MetaName < Lutaml::Model::Serializable + attribute :id, :string attribute :content, :string xml do element "meta-name" + + map_attribute "id", to: :id map_content to: :content end end diff --git a/lib/sts/iso_sts/meta_value.rb b/lib/sts/iso_sts/meta_value.rb index c28ba45..ef8cdcf 100644 --- a/lib/sts/iso_sts/meta_value.rb +++ b/lib/sts/iso_sts/meta_value.rb @@ -4,35 +4,82 @@ module Sts module IsoSts class MetaValue < Lutaml::Model::Serializable attribute :id, :string - attribute :specific_use, :string - attribute :xml_lang, :string attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true attribute :bold, ::Sts::IsoSts::Bold, collection: true attribute :italic, ::Sts::IsoSts::Italic, collection: true attribute :monospace, ::Sts::IsoSts::Monospace, collection: true attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true attribute :sc, ::Sts::IsoSts::Sc, collection: true attribute :strike, ::Sts::IsoSts::Strike, collection: true attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true attribute :sub, ::Sts::IsoSts::Sub, collection: true attribute :sup, ::Sts::IsoSts::Sup, collection: true - xml do + xml do # rubocop:disable Metrics/BlockLength element "meta-value" mixed_content map_attribute "id", to: :id - map_attribute "specific-use", to: :specific_use - map_attribute "xml:lang", to: :xml_lang - map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object map_element "bold", to: :bold map_element "italic", to: :italic map_element "monospace", to: :monospace map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif map_element "sc", to: :sc map_element "strike", to: :strike map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "math", to: :math + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref map_element "sub", to: :sub map_element "sup", to: :sup end diff --git a/lib/sts/iso_sts/mixed_citation.rb b/lib/sts/iso_sts/mixed_citation.rb index 8f6a5a8..f65d9a6 100644 --- a/lib/sts/iso_sts/mixed_citation.rb +++ b/lib/sts/iso_sts/mixed_citation.rb @@ -28,11 +28,11 @@ class MixedCitation < Lutaml::Model::Serializable attribute :fn, ::Sts::IsoSts::Fn, collection: true attribute :xref, ::Sts::TbxIsoTml::Xref, collection: true attribute :break, ::Sts::IsoSts::Break, collection: true - attribute :person_group, ::Sts::NisoSts::PersonGroup, collection: true - attribute :collab, ::Sts::NisoSts::Collab, collection: true + attribute :person_group, ::Sts::IsoSts::PersonGroup, collection: true + attribute :collab, ::Sts::IsoSts::Collab, collection: true attribute :year, ::Sts::IsoSts::Year, collection: true - attribute :source, ::Sts::NisoSts::Source - attribute :article_title, ::Sts::NisoSts::ArticleTitle + attribute :source, ::Sts::IsoSts::Source + attribute :article_title, ::Sts::IsoSts::ArticleTitle attribute :volume, ::Sts::IsoSts::Volume attribute :issue, ::Sts::IsoSts::Issue attribute :fpage, ::Sts::IsoSts::Fpage diff --git a/lib/sts/iso_sts/name.rb b/lib/sts/iso_sts/name.rb new file mode 100644 index 0000000..91ec549 --- /dev/null +++ b/lib/sts/iso_sts/name.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Name < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :name_style, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :surname, ::Sts::IsoSts::Surname + attribute :given_names, ::Sts::IsoSts::GivenNames + attribute :prefix, ::Sts::IsoSts::Prefix + attribute :suffix, ::Sts::IsoSts::Suffix + + xml do + element "name" + ordered + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "name-style", to: :name_style + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_element "surname", to: :surname + map_element "given-names", to: :given_names + map_element "prefix", to: :prefix + map_element "suffix", to: :suffix + end + end + end +end diff --git a/lib/sts/iso_sts/name_alternatives.rb b/lib/sts/iso_sts/name_alternatives.rb new file mode 100644 index 0000000..5255475 --- /dev/null +++ b/lib/sts/iso_sts/name_alternatives.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class NameAlternatives < Lutaml::Model::Serializable + attribute :id, :string + attribute :name, ::Sts::IsoSts::Name, collection: true + attribute :string_name, ::Sts::IsoSts::StringName, collection: true + + xml do + element "name-alternatives" + ordered + + map_attribute "id", to: :id + map_element "name", to: :name + map_element "string-name", to: :string_name + end + end + end +end diff --git a/lib/sts/iso_sts/on_behalf_of.rb b/lib/sts/iso_sts/on_behalf_of.rb new file mode 100644 index 0000000..e634ebf --- /dev/null +++ b/lib/sts/iso_sts/on_behalf_of.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class OnBehalfOf < Lutaml::Model::Serializable + attribute :id, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + + xml do + element "on-behalf-of" + mixed_content + + map_attribute "id", to: :id + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "sub", to: :sub + map_element "sup", to: :sup + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + end + end + end +end diff --git a/lib/sts/iso_sts/open_access.rb b/lib/sts/iso_sts/open_access.rb new file mode 100644 index 0000000..8efaa92 --- /dev/null +++ b/lib/sts/iso_sts/open_access.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class OpenAccess < Lutaml::Model::Serializable + attribute :id, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true + attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, + collection: true + attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, + collection: true + + xml do + element "open-access" + ordered + + map_attribute "id", to: :id + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_element "p", to: :paragraph + map_element "non-normative-note", to: :non_normative_note + map_element "non-normative-example", to: :non_normative_example + end + end + end +end diff --git a/lib/sts/iso_sts/overline.rb b/lib/sts/iso_sts/overline.rb new file mode 100644 index 0000000..d3e75ae --- /dev/null +++ b/lib/sts/iso_sts/overline.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Overline < Lutaml::Model::Serializable + attribute :id, :string + attribute :specific_use, :string + attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :element_citation, ::Sts::IsoSts::ElementCitation, + collection: true + attribute :mixed_citation, ::Sts::IsoSts::MixedCitation, collection: true + attribute :std, ::Sts::IsoSts::Std, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + attribute :std_ref, ::Sts::IsoSts::StdRef, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "overline" + mixed_content + + map_attribute "id", to: :id + map_attribute "specific-use", to: :specific_use + map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "element-citation", to: :element_citation + map_element "mixed-citation", to: :mixed_citation + map_element "std", to: :std + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "math", to: :math + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref + map_element "std-ref", to: :std_ref + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/part_title.rb b/lib/sts/iso_sts/part_title.rb new file mode 100644 index 0000000..aa1edf6 --- /dev/null +++ b/lib/sts/iso_sts/part_title.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class PartTitle < Lutaml::Model::Serializable + attribute :id, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do + element "part-title" + mixed_content + + map_attribute "id", to: :id + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/patent.rb b/lib/sts/iso_sts/patent.rb new file mode 100644 index 0000000..990288e --- /dev/null +++ b/lib/sts/iso_sts/patent.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Patent < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :country, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "patent" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "country", to: :country + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/person_group.rb b/lib/sts/iso_sts/person_group.rb new file mode 100644 index 0000000..3e6fac5 --- /dev/null +++ b/lib/sts/iso_sts/person_group.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class PersonGroup < Lutaml::Model::Serializable + attribute :id, :string + attribute :person_group_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :anonymous, ::Sts::IsoSts::Anonymous, collection: true + attribute :collab, ::Sts::IsoSts::Collab, collection: true + attribute :name, ::Sts::IsoSts::Name, collection: true + attribute :name_alternatives, ::Sts::IsoSts::NameAlternatives, + collection: true + attribute :aff, ::Sts::IsoSts::Aff, collection: true + attribute :aff_alternatives, ::Sts::IsoSts::AffAlternatives, + collection: true + attribute :etal, ::Sts::IsoSts::Etal, collection: true + attribute :role, ::Sts::IsoSts::Role, collection: true + attribute :string_name, ::Sts::IsoSts::StringName, collection: true + + xml do + element "person-group" + mixed_content + + map_attribute "id", to: :id + map_attribute "person-group-type", to: :person_group_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "anonymous", to: :anonymous + map_element "collab", to: :collab + map_element "name", to: :name + map_element "name-alternatives", to: :name_alternatives + map_element "aff", to: :aff + map_element "aff-alternatives", to: :aff_alternatives + map_element "etal", to: :etal + map_element "role", to: :role + map_element "string-name", to: :string_name + end + end + end +end diff --git a/lib/sts/iso_sts/prefix.rb b/lib/sts/iso_sts/prefix.rb new file mode 100644 index 0000000..630d905 --- /dev/null +++ b/lib/sts/iso_sts/prefix.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Prefix < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "prefix" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/price.rb b/lib/sts/iso_sts/price.rb new file mode 100644 index 0000000..6a07e4b --- /dev/null +++ b/lib/sts/iso_sts/price.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Price < Lutaml::Model::Serializable + attribute :id, :string + attribute :currency, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + + xml do + element "price" + mixed_content + + map_attribute "id", to: :id + map_attribute "currency", to: :currency + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + end + end + end +end diff --git a/lib/sts/iso_sts/private_char.rb b/lib/sts/iso_sts/private_char.rb new file mode 100644 index 0000000..93c2865 --- /dev/null +++ b/lib/sts/iso_sts/private_char.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class PrivateChar < Lutaml::Model::Serializable + attribute :id, :string + attribute :description, :string + attribute :name, :string + attribute :specific_use, :string + attribute :glyph_data, ::Sts::IsoSts::GlyphData + attribute :glyph_ref, ::Sts::IsoSts::GlyphRef + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + + xml do + element "private-char" + ordered + + map_attribute "id", to: :id + map_attribute "description", to: :description + map_attribute "name", to: :name + map_attribute "specific-use", to: :specific_use + map_element "glyph-data", to: :glyph_data + map_element "glyph-ref", to: :glyph_ref + map_element "inline-graphic", to: :inline_graphic + end + end + end +end diff --git a/lib/sts/iso_sts/ref.rb b/lib/sts/iso_sts/ref.rb index 7b1c7ff..8e0348c 100644 --- a/lib/sts/iso_sts/ref.rb +++ b/lib/sts/iso_sts/ref.rb @@ -9,7 +9,7 @@ class Ref < Lutaml::Model::Serializable attribute :xml_lang, :string attribute :label, ::Sts::IsoSts::Label attribute :mixed_citation, ::Sts::IsoSts::MixedCitation - attribute :element_citation, ::Sts::NisoSts::ElementCitation + attribute :element_citation, ::Sts::IsoSts::ElementCitation attribute :std, ::Sts::IsoSts::Std attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample diff --git a/lib/sts/iso_sts/related_article.rb b/lib/sts/iso_sts/related_article.rb new file mode 100644 index 0000000..941507f --- /dev/null +++ b/lib/sts/iso_sts/related_article.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class RelatedArticle < Lutaml::Model::Serializable + attribute :id, :string + attribute :related_article_type, :string + attribute :ext_link_type, :string + attribute :vol, :string + attribute :page, :string + attribute :issue, :string + attribute :elocation_id, :string + attribute :journal_id, :string + attribute :journal_id_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :xlink_type, :string + attribute :xlink_href, :string + attribute :xlink_role, :string + attribute :xlink_title, :string + attribute :xlink_show, :string + attribute :xlink_actuate, :string + attribute :originator, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :journal_id_element, ::Sts::IsoSts::JournalId, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :annotation, ::Sts::IsoSts::Annotation, collection: true + attribute :article_title, ::Sts::IsoSts::ArticleTitle, collection: true + attribute :chapter_title, ::Sts::IsoSts::ChapterTitle, collection: true + attribute :collab, ::Sts::IsoSts::Collab, collection: true + attribute :comment, ::Sts::IsoSts::Comment, collection: true + attribute :conf_date, ::Sts::IsoSts::ConfDate, collection: true + attribute :conf_loc, ::Sts::IsoSts::ConfLoc, collection: true + attribute :conf_name, ::Sts::IsoSts::ConfName, collection: true + attribute :conf_sponsor, ::Sts::IsoSts::ConfSponsor, collection: true + attribute :date, ::Sts::IsoSts::Date, collection: true + attribute :date_in_citation, ::Sts::IsoSts::DateInCitation, + collection: true + attribute :day, ::Sts::IsoSts::Day, collection: true + attribute :edition, ::Sts::IsoSts::Edition, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :elocation_id_element, ::Sts::IsoSts::ElocationId, + collection: true + attribute :etal, ::Sts::IsoSts::Etal, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :fpage, ::Sts::IsoSts::Fpage, collection: true + attribute :gov, ::Sts::IsoSts::Gov, collection: true + attribute :institution, ::Sts::IsoSts::Institution, collection: true + attribute :isbn, ::Sts::IsoSts::Isbn, collection: true + attribute :issn, ::Sts::IsoSts::Issn, collection: true + attribute :issue_element, ::Sts::IsoSts::Issue, collection: true + attribute :issue_id, ::Sts::IsoSts::IssueId, collection: true + attribute :issue_part, ::Sts::IsoSts::IssuePart, collection: true + attribute :issue_title, ::Sts::IsoSts::IssueTitle, collection: true + attribute :lpage, ::Sts::IsoSts::Lpage, collection: true + attribute :month, ::Sts::IsoSts::Month, collection: true + attribute :name, ::Sts::IsoSts::Name, collection: true + attribute :name_alternatives, ::Sts::IsoSts::NameAlternatives, + collection: true + attribute :sts_object_id, ::Sts::IsoSts::ObjectId, collection: true + attribute :page_range, ::Sts::IsoSts::PageRange, collection: true + attribute :part_title, ::Sts::IsoSts::PartTitle, collection: true + attribute :patent, ::Sts::IsoSts::Patent, collection: true + attribute :person_group, ::Sts::IsoSts::PersonGroup, collection: true + attribute :pub_id, ::Sts::IsoSts::PubId, collection: true + attribute :publisher_loc, ::Sts::IsoSts::PublisherLoc, collection: true + attribute :publisher_name, ::Sts::IsoSts::PublisherName, collection: true + attribute :role, ::Sts::IsoSts::Role, collection: true + attribute :season, ::Sts::IsoSts::Season, collection: true + attribute :series, ::Sts::IsoSts::Series, collection: true + attribute :size, ::Sts::IsoSts::Size, collection: true + attribute :source, ::Sts::IsoSts::Source, collection: true + attribute :std, ::Sts::IsoSts::Std, collection: true + attribute :string_name, ::Sts::IsoSts::StringName, collection: true + attribute :supplement, ::Sts::IsoSts::Supplement, collection: true + attribute :trans_source, ::Sts::IsoSts::TransSource, collection: true + attribute :trans_title, ::Sts::IsoSts::TransTitle, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :volume, ::Sts::IsoSts::Volume, collection: true + attribute :volume_id, ::Sts::IsoSts::VolumeId, collection: true + attribute :volume_series, ::Sts::IsoSts::VolumeSeries, collection: true + attribute :year, ::Sts::IsoSts::Year, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "related-article" + mixed_content + + map_attribute "id", to: :id + map_attribute "related-article-type", to: :related_article_type + map_attribute "ext-link-type", to: :ext_link_type + map_attribute "vol", to: :vol + map_attribute "page", to: :page + map_attribute "issue", to: :issue + map_attribute "elocation-id", to: :elocation_id + map_attribute "journal-id", to: :journal_id + map_attribute "journal-id-type", to: :journal_id_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "xlink:type", to: :xlink_type + map_attribute "xlink:href", to: :xlink_href + map_attribute "xlink:role", to: :xlink_role + map_attribute "xlink:title", to: :xlink_title + map_attribute "xlink:show", to: :xlink_show + map_attribute "xlink:actuate", to: :xlink_actuate + map_attribute "originator", to: :originator + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "journal-id", to: :journal_id_element + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "annotation", to: :annotation + map_element "article-title", to: :article_title + map_element "chapter-title", to: :chapter_title + map_element "collab", to: :collab + map_element "comment", to: :comment + map_element "conf-date", to: :conf_date + map_element "conf-loc", to: :conf_loc + map_element "conf-name", to: :conf_name + map_element "conf-sponsor", to: :conf_sponsor + map_element "date", to: :date + map_element "date-in-citation", to: :date_in_citation + map_element "day", to: :day + map_element "edition", to: :edition + map_element "email", to: :email + map_element "elocation-id", to: :elocation_id_element + map_element "etal", to: :etal + map_element "ext-link", to: :ext_link + map_element "fpage", to: :fpage + map_element "gov", to: :gov + map_element "institution", to: :institution + map_element "isbn", to: :isbn + map_element "issn", to: :issn + map_element "issue", to: :issue_element + map_element "issue-id", to: :issue_id + map_element "issue-part", to: :issue_part + map_element "issue-title", to: :issue_title + map_element "lpage", to: :lpage + map_element "month", to: :month + map_element "name", to: :name + map_element "name-alternatives", to: :name_alternatives + map_element "object-id", to: :sts_object_id + map_element "page-range", to: :page_range + map_element "part-title", to: :part_title + map_element "patent", to: :patent + map_element "person-group", to: :person_group + map_element "pub-id", to: :pub_id + map_element "publisher-loc", to: :publisher_loc + map_element "publisher-name", to: :publisher_name + map_element "role", to: :role + map_element "season", to: :season + map_element "series", to: :series + map_element "size", to: :size + map_element "source", to: :source + map_element "std", to: :std + map_element "string-name", to: :string_name + map_element "supplement", to: :supplement + map_element "trans-source", to: :trans_source + map_element "trans-title", to: :trans_title + map_element "uri", to: :uri + map_element "volume", to: :volume + map_element "volume-id", to: :volume_id + map_element "volume-series", to: :volume_series + map_element "year", to: :year + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/related_object.rb b/lib/sts/iso_sts/related_object.rb new file mode 100644 index 0000000..d390353 --- /dev/null +++ b/lib/sts/iso_sts/related_object.rb @@ -0,0 +1,182 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class RelatedObject < Lutaml::Model::Serializable + attribute :id, :string + attribute :link_type, :string + attribute :source_id, :string + attribute :source_id_type, :string + attribute :source_type, :string + attribute :document_id, :string + attribute :document_id_type, :string + attribute :document_type, :string + attribute :object_id_value, :string + attribute :object_id_type, :string + attribute :object_type, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :originator, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :annotation, ::Sts::IsoSts::Annotation, collection: true + attribute :article_title, ::Sts::IsoSts::ArticleTitle, collection: true + attribute :chapter_title, ::Sts::IsoSts::ChapterTitle, collection: true + attribute :collab, ::Sts::IsoSts::Collab, collection: true + attribute :comment, ::Sts::IsoSts::Comment, collection: true + attribute :conf_date, ::Sts::IsoSts::ConfDate, collection: true + attribute :conf_loc, ::Sts::IsoSts::ConfLoc, collection: true + attribute :conf_name, ::Sts::IsoSts::ConfName, collection: true + attribute :conf_sponsor, ::Sts::IsoSts::ConfSponsor, collection: true + attribute :date, ::Sts::IsoSts::Date, collection: true + attribute :date_in_citation, ::Sts::IsoSts::DateInCitation, + collection: true + attribute :day, ::Sts::IsoSts::Day, collection: true + attribute :edition, ::Sts::IsoSts::Edition, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :elocation_id, ::Sts::IsoSts::ElocationId, collection: true + attribute :etal, ::Sts::IsoSts::Etal, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :fpage, ::Sts::IsoSts::Fpage, collection: true + attribute :gov, ::Sts::IsoSts::Gov, collection: true + attribute :institution, ::Sts::IsoSts::Institution, collection: true + attribute :isbn, ::Sts::IsoSts::Isbn, collection: true + attribute :issn, ::Sts::IsoSts::Issn, collection: true + attribute :issue, ::Sts::IsoSts::Issue, collection: true + attribute :issue_id, ::Sts::IsoSts::IssueId, collection: true + attribute :issue_part, ::Sts::IsoSts::IssuePart, collection: true + attribute :issue_title, ::Sts::IsoSts::IssueTitle, collection: true + attribute :lpage, ::Sts::IsoSts::Lpage, collection: true + attribute :month, ::Sts::IsoSts::Month, collection: true + attribute :name, ::Sts::IsoSts::Name, collection: true + attribute :name_alternatives, ::Sts::IsoSts::NameAlternatives, + collection: true + attribute :sts_object_id, ::Sts::IsoSts::ObjectId, collection: true + attribute :page_range, ::Sts::IsoSts::PageRange, collection: true + attribute :part_title, ::Sts::IsoSts::PartTitle, collection: true + attribute :patent, ::Sts::IsoSts::Patent, collection: true + attribute :person_group, ::Sts::IsoSts::PersonGroup, collection: true + attribute :pub_id, ::Sts::IsoSts::PubId, collection: true + attribute :publisher_loc, ::Sts::IsoSts::PublisherLoc, collection: true + attribute :publisher_name, ::Sts::IsoSts::PublisherName, collection: true + attribute :role, ::Sts::IsoSts::Role, collection: true + attribute :season, ::Sts::IsoSts::Season, collection: true + attribute :series, ::Sts::IsoSts::Series, collection: true + attribute :size, ::Sts::IsoSts::Size, collection: true + attribute :source, ::Sts::IsoSts::Source, collection: true + attribute :std, ::Sts::IsoSts::Std, collection: true + attribute :string_name, ::Sts::IsoSts::StringName, collection: true + attribute :supplement, ::Sts::IsoSts::Supplement, collection: true + attribute :trans_source, ::Sts::IsoSts::TransSource, collection: true + attribute :trans_title, ::Sts::IsoSts::TransTitle, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :volume, ::Sts::IsoSts::Volume, collection: true + attribute :volume_id, ::Sts::IsoSts::VolumeId, collection: true + attribute :volume_series, ::Sts::IsoSts::VolumeSeries, collection: true + attribute :year, ::Sts::IsoSts::Year, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "related-object" + mixed_content + + map_attribute "id", to: :id + map_attribute "link-type", to: :link_type + map_attribute "source-id", to: :source_id + map_attribute "source-id-type", to: :source_id_type + map_attribute "source-type", to: :source_type + map_attribute "document-id", to: :document_id + map_attribute "document-id-type", to: :document_id_type + map_attribute "document-type", to: :document_type + map_attribute "object-id", to: :object_id_value + map_attribute "object-id-type", to: :object_id_type + map_attribute "object-type", to: :object_type + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "originator", to: :originator + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "annotation", to: :annotation + map_element "article-title", to: :article_title + map_element "chapter-title", to: :chapter_title + map_element "collab", to: :collab + map_element "comment", to: :comment + map_element "conf-date", to: :conf_date + map_element "conf-loc", to: :conf_loc + map_element "conf-name", to: :conf_name + map_element "conf-sponsor", to: :conf_sponsor + map_element "date", to: :date + map_element "date-in-citation", to: :date_in_citation + map_element "day", to: :day + map_element "edition", to: :edition + map_element "email", to: :email + map_element "elocation-id", to: :elocation_id + map_element "etal", to: :etal + map_element "ext-link", to: :ext_link + map_element "fpage", to: :fpage + map_element "gov", to: :gov + map_element "institution", to: :institution + map_element "isbn", to: :isbn + map_element "issn", to: :issn + map_element "issue", to: :issue + map_element "issue-id", to: :issue_id + map_element "issue-part", to: :issue_part + map_element "issue-title", to: :issue_title + map_element "lpage", to: :lpage + map_element "month", to: :month + map_element "name", to: :name + map_element "name-alternatives", to: :name_alternatives + map_element "object-id", to: :sts_object_id + map_element "page-range", to: :page_range + map_element "part-title", to: :part_title + map_element "patent", to: :patent + map_element "person-group", to: :person_group + map_element "pub-id", to: :pub_id + map_element "publisher-loc", to: :publisher_loc + map_element "publisher-name", to: :publisher_name + map_element "role", to: :role + map_element "season", to: :season + map_element "series", to: :series + map_element "size", to: :size + map_element "source", to: :source + map_element "std", to: :std + map_element "string-name", to: :string_name + map_element "supplement", to: :supplement + map_element "trans-source", to: :trans_source + map_element "trans-title", to: :trans_title + map_element "uri", to: :uri + map_element "volume", to: :volume + map_element "volume-id", to: :volume_id + map_element "volume-series", to: :volume_series + map_element "year", to: :year + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/role.rb b/lib/sts/iso_sts/role.rb new file mode 100644 index 0000000..353f406 --- /dev/null +++ b/lib/sts/iso_sts/role.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Role < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + + xml do + element "role" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "sub", to: :sub + map_element "sup", to: :sup + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + end + end + end +end diff --git a/lib/sts/iso_sts/roman.rb b/lib/sts/iso_sts/roman.rb new file mode 100644 index 0000000..5aedea6 --- /dev/null +++ b/lib/sts/iso_sts/roman.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Roman < Lutaml::Model::Serializable + attribute :id, :string + attribute :specific_use, :string + attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :element_citation, ::Sts::IsoSts::ElementCitation, + collection: true + attribute :mixed_citation, ::Sts::IsoSts::MixedCitation, collection: true + attribute :std, ::Sts::IsoSts::Std, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + attribute :std_ref, ::Sts::IsoSts::StdRef, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "roman" + mixed_content + + map_attribute "id", to: :id + map_attribute "specific-use", to: :specific_use + map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "element-citation", to: :element_citation + map_element "mixed-citation", to: :mixed_citation + map_element "std", to: :std + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "math", to: :math + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref + map_element "std-ref", to: :std_ref + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/sans_serif.rb b/lib/sts/iso_sts/sans_serif.rb new file mode 100644 index 0000000..817f522 --- /dev/null +++ b/lib/sts/iso_sts/sans_serif.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class SansSerif < Lutaml::Model::Serializable + attribute :id, :string + attribute :specific_use, :string + attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :element_citation, ::Sts::IsoSts::ElementCitation, + collection: true + attribute :mixed_citation, ::Sts::IsoSts::MixedCitation, collection: true + attribute :std, ::Sts::IsoSts::Std, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + attribute :std_ref, ::Sts::IsoSts::StdRef, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "sans-serif" + mixed_content + + map_attribute "id", to: :id + map_attribute "specific-use", to: :specific_use + map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "element-citation", to: :element_citation + map_element "mixed-citation", to: :mixed_citation + map_element "std", to: :std + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "math", to: :math + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref + map_element "std-ref", to: :std_ref + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/series.rb b/lib/sts/iso_sts/series.rb new file mode 100644 index 0000000..2453fd2 --- /dev/null +++ b/lib/sts/iso_sts/series.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Series < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + + xml do + element "series" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "sub", to: :sub + map_element "sup", to: :sup + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + end + end + end +end diff --git a/lib/sts/iso_sts/size.rb b/lib/sts/iso_sts/size.rb new file mode 100644 index 0000000..835e1bc --- /dev/null +++ b/lib/sts/iso_sts/size.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Size < Lutaml::Model::Serializable + attribute :id, :string + attribute :units, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "size" + mixed_content + + map_attribute "id", to: :id + map_attribute "units", to: :units + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/source.rb b/lib/sts/iso_sts/source.rb new file mode 100644 index 0000000..5d8555b --- /dev/null +++ b/lib/sts/iso_sts/source.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Source < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do + element "source" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/speaker.rb b/lib/sts/iso_sts/speaker.rb new file mode 100644 index 0000000..b286c2d --- /dev/null +++ b/lib/sts/iso_sts/speaker.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Speaker < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :degrees, ::Sts::IsoSts::Degrees, collection: true + attribute :given_names, ::Sts::IsoSts::GivenNames, collection: true + attribute :prefix, ::Sts::IsoSts::Prefix, collection: true + attribute :surname, ::Sts::IsoSts::Surname, collection: true + attribute :suffix, ::Sts::IsoSts::Suffix, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + + xml do + element "speaker" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "degrees", to: :degrees + map_element "given-names", to: :given_names + map_element "prefix", to: :prefix + map_element "surname", to: :surname + map_element "suffix", to: :suffix + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref + end + end + end +end diff --git a/lib/sts/iso_sts/speech.rb b/lib/sts/iso_sts/speech.rb new file mode 100644 index 0000000..5bb3339 --- /dev/null +++ b/lib/sts/iso_sts/speech.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Speech < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :originator, :string + attribute :speaker, ::Sts::IsoSts::Speaker + attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true + attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, + collection: true + attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, + collection: true + + xml do + element "speech" + ordered + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "originator", to: :originator + map_element "speaker", to: :speaker + map_element "p", to: :paragraph + map_element "non-normative-note", to: :non_normative_note + map_element "non-normative-example", to: :non_normative_example + end + end + end +end diff --git a/lib/sts/iso_sts/statement.rb b/lib/sts/iso_sts/statement.rb new file mode 100644 index 0000000..bb80a17 --- /dev/null +++ b/lib/sts/iso_sts/statement.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Statement < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :originator, :string + attribute :label, ::Sts::IsoSts::Label + attribute :title, ::Sts::IsoSts::Title + attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true + attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, + collection: true + attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, + collection: true + attribute :attrib, ::Sts::IsoSts::Attrib, collection: true + attribute :permissions, ::Sts::IsoSts::Permissions, collection: true + + xml do + element "statement" + ordered + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "originator", to: :originator + map_element "label", to: :label + map_element "title", to: :title + map_element "p", to: :paragraph + map_element "non-normative-note", to: :non_normative_note + map_element "non-normative-example", to: :non_normative_example + map_element "attrib", to: :attrib + map_element "permissions", to: :permissions + end + end + end +end diff --git a/lib/sts/iso_sts/string_name.rb b/lib/sts/iso_sts/string_name.rb new file mode 100644 index 0000000..b9838e8 --- /dev/null +++ b/lib/sts/iso_sts/string_name.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class StringName < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :name_style, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :degrees, ::Sts::IsoSts::Degrees, collection: true + attribute :given_names, ::Sts::IsoSts::GivenNames, collection: true + attribute :prefix, ::Sts::IsoSts::Prefix, collection: true + attribute :surname, ::Sts::IsoSts::Surname, collection: true + attribute :suffix, ::Sts::IsoSts::Suffix, collection: true + + xml do + element "string-name" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "name-style", to: :name_style + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "degrees", to: :degrees + map_element "given-names", to: :given_names + map_element "prefix", to: :prefix + map_element "surname", to: :surname + map_element "suffix", to: :suffix + end + end + end +end diff --git a/lib/sts/iso_sts/subtitle.rb b/lib/sts/iso_sts/subtitle.rb new file mode 100644 index 0000000..c44511a --- /dev/null +++ b/lib/sts/iso_sts/subtitle.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Subtitle < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + attribute :break, ::Sts::IsoSts::Break, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "subtitle" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "math", to: :math + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref + map_element "sub", to: :sub + map_element "sup", to: :sup + map_element "break", to: :break + end + end + end +end diff --git a/lib/sts/iso_sts/suffix.rb b/lib/sts/iso_sts/suffix.rb new file mode 100644 index 0000000..32c35fa --- /dev/null +++ b/lib/sts/iso_sts/suffix.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Suffix < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "suffix" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/supplement.rb b/lib/sts/iso_sts/supplement.rb new file mode 100644 index 0000000..e426a67 --- /dev/null +++ b/lib/sts/iso_sts/supplement.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Supplement < Lutaml::Model::Serializable + attribute :id, :string + attribute :supplement_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + attribute :contrib_group, ::Sts::IsoSts::ContribGroup, collection: true + attribute :title, ::Sts::IsoSts::Title, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "supplement" + mixed_content + + map_attribute "id", to: :id + map_attribute "supplement-type", to: :supplement_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + map_element "contrib-group", to: :contrib_group + map_element "title", to: :title + end + end + end +end diff --git a/lib/sts/iso_sts/supplementary_material.rb b/lib/sts/iso_sts/supplementary_material.rb new file mode 100644 index 0000000..0d87c11 --- /dev/null +++ b/lib/sts/iso_sts/supplementary_material.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class SupplementaryMaterial < Lutaml::Model::Serializable + attribute :id, :string + attribute :position, :string + attribute :orientation, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content_type, :string + attribute :mimetype, :string + attribute :mime_subtype, :string + attribute :xlink_type, :string + attribute :xlink_href, :string + attribute :xlink_role, :string + attribute :xlink_title, :string + attribute :xlink_show, :string + attribute :xlink_actuate, :string + attribute :originator, :string + attribute :sts_object_id, ::Sts::IsoSts::ObjectId, collection: true + attribute :label, ::Sts::IsoSts::Label + attribute :caption, ::Sts::IsoSts::Caption + attribute :alt_text, ::Sts::IsoSts::AltText, collection: true + attribute :long_desc, ::Sts::IsoSts::LongDesc, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :disp_formula, ::Sts::IsoSts::DispFormula, collection: true + attribute :disp_formula_group, ::Sts::IsoSts::DispFormulaGroup, + collection: true + attribute :chem_struct_wrap, ::Sts::IsoSts::ChemStructWrap, + collection: true + attribute :fn_group, ::Sts::IsoSts::FnGroup, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :disp_quote, ::Sts::IsoSts::DispQuote, collection: true + attribute :speech, ::Sts::IsoSts::Speech, collection: true + attribute :statement, ::Sts::IsoSts::Statement, collection: true + attribute :verse_group, ::Sts::IsoSts::VerseGroup, collection: true + attribute :table_wrap, ::Sts::IsoSts::TableWrap, collection: true + attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true + attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, + collection: true + attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, + collection: true + attribute :def_list, ::Sts::IsoSts::DefList, collection: true + attribute :list, ::Sts::IsoSts::List, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :array, ::Sts::IsoSts::Array, collection: true + attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :media, ::Sts::IsoSts::Media, collection: true + attribute :preformat, ::Sts::IsoSts::Preformat, collection: true + attribute :attrib, ::Sts::IsoSts::Attrib, collection: true + attribute :permissions, ::Sts::IsoSts::Permissions, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "supplementary-material" + ordered + + map_attribute "id", to: :id + map_attribute "position", to: :position + map_attribute "orientation", to: :orientation + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "content-type", to: :content_type + map_attribute "mimetype", to: :mimetype + map_attribute "mime-subtype", to: :mime_subtype + map_attribute "xlink:type", to: :xlink_type + map_attribute "xlink:href", to: :xlink_href + map_attribute "xlink:role", to: :xlink_role + map_attribute "xlink:title", to: :xlink_title + map_attribute "xlink:show", to: :xlink_show + map_attribute "xlink:actuate", to: :xlink_actuate + map_attribute "originator", to: :originator + map_element "object-id", to: :sts_object_id + map_element "label", to: :label + map_element "caption", to: :caption + map_element "alt-text", to: :alt_text + map_element "long-desc", to: :long_desc + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "disp-formula", to: :disp_formula + map_element "disp-formula-group", to: :disp_formula_group + map_element "chem-struct-wrap", to: :chem_struct_wrap + map_element "fn-group", to: :fn_group + map_element "fn", to: :fn + map_element "disp-quote", to: :disp_quote + map_element "speech", to: :speech + map_element "statement", to: :statement + map_element "verse-group", to: :verse_group + map_element "table-wrap", to: :table_wrap + map_element "p", to: :paragraph + map_element "non-normative-note", to: :non_normative_note + map_element "non-normative-example", to: :non_normative_example + map_element "def-list", to: :def_list + map_element "list", to: :list + map_element "alternatives", to: :alternatives + map_element "array", to: :array + map_element "graphic", to: :graphic + map_element "media", to: :media + map_element "preformat", to: :preformat + map_element "attrib", to: :attrib + map_element "permissions", to: :permissions + end + end + end +end diff --git a/lib/sts/iso_sts/surname.rb b/lib/sts/iso_sts/surname.rb new file mode 100644 index 0000000..c250d95 --- /dev/null +++ b/lib/sts/iso_sts/surname.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Surname < Lutaml::Model::Serializable + attribute :id, :string + attribute :initials, :string + attribute :content, :string, collection: true + + xml do + element "surname" + mixed_content + + map_attribute "id", to: :id + map_attribute "initials", to: :initials + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/table_wrap_group.rb b/lib/sts/iso_sts/table_wrap_group.rb new file mode 100644 index 0000000..3944fdb --- /dev/null +++ b/lib/sts/iso_sts/table_wrap_group.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class TableWrapGroup < Lutaml::Model::Serializable + attribute :id, :string + attribute :position, :string + attribute :orientation, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content_type, :string + attribute :originator, :string + attribute :label, ::Sts::IsoSts::Label + attribute :caption, ::Sts::IsoSts::Caption + attribute :alt_text, ::Sts::IsoSts::AltText, collection: true + attribute :long_desc, ::Sts::IsoSts::LongDesc, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :table_wrap, ::Sts::IsoSts::TableWrap, collection: true + + xml do + element "table-wrap-group" + ordered + + map_attribute "id", to: :id + map_attribute "position", to: :position + map_attribute "orientation", to: :orientation + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "content-type", to: :content_type + map_attribute "originator", to: :originator + map_element "label", to: :label + map_element "caption", to: :caption + map_element "alt-text", to: :alt_text + map_element "long-desc", to: :long_desc + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "table-wrap", to: :table_wrap + end + end + end +end diff --git a/lib/sts/iso_sts/target.rb b/lib/sts/iso_sts/target.rb new file mode 100644 index 0000000..95e01da --- /dev/null +++ b/lib/sts/iso_sts/target.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class Target < Lutaml::Model::Serializable + attribute :id, :string + attribute :target_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do + element "target" + mixed_content + + map_attribute "id", to: :id + map_attribute "target-type", to: :target_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/term_display.rb b/lib/sts/iso_sts/term_display.rb new file mode 100644 index 0000000..820d45e --- /dev/null +++ b/lib/sts/iso_sts/term_display.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class TermDisplay < Lutaml::Model::Serializable + attribute :id, :string + attribute :xml_lang, :string + attribute :title, ::Sts::IsoSts::Title, collection: true + attribute :address, ::Sts::IsoSts::Address, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :array, ::Sts::IsoSts::Array, collection: true + attribute :boxed_text, ::Sts::IsoSts::BoxedText, collection: true + attribute :chem_struct_wrap, ::Sts::IsoSts::ChemStructWrap, + collection: true + attribute :fig, ::Sts::IsoSts::Fig, collection: true + attribute :fig_group, ::Sts::IsoSts::FigGroup, collection: true + attribute :graphic, ::Sts::IsoSts::Graphic, collection: true + attribute :media, ::Sts::IsoSts::Media, collection: true + attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, + collection: true + attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, + collection: true + attribute :preformat, ::Sts::IsoSts::Preformat, collection: true + attribute :supplementary_material, ::Sts::IsoSts::SupplementaryMaterial, + collection: true + attribute :table_wrap, ::Sts::IsoSts::TableWrap, collection: true + attribute :table_wrap_group, ::Sts::IsoSts::TableWrapGroup, + collection: true + attribute :disp_formula, ::Sts::IsoSts::DispFormula, collection: true + attribute :disp_formula_group, ::Sts::IsoSts::DispFormulaGroup, + collection: true + attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true + attribute :def_list, ::Sts::IsoSts::DefList, collection: true + attribute :list, ::Sts::IsoSts::List, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :disp_quote, ::Sts::IsoSts::DispQuote, collection: true + attribute :speech, ::Sts::IsoSts::Speech, collection: true + attribute :statement, ::Sts::IsoSts::Statement, collection: true + attribute :verse_group, ::Sts::IsoSts::VerseGroup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "term-display" + ordered + + map_attribute "id", to: :id + map_attribute "xml:lang", to: :xml_lang + map_element "title", to: :title + map_element "address", to: :address + map_element "alternatives", to: :alternatives + map_element "array", to: :array + map_element "boxed-text", to: :boxed_text + map_element "chem-struct-wrap", to: :chem_struct_wrap + map_element "fig", to: :fig + map_element "fig-group", to: :fig_group + map_element "graphic", to: :graphic + map_element "media", to: :media + map_element "non-normative-note", to: :non_normative_note + map_element "non-normative-example", to: :non_normative_example + map_element "preformat", to: :preformat + map_element "supplementary-material", to: :supplementary_material + map_element "table-wrap", to: :table_wrap + map_element "table-wrap-group", to: :table_wrap_group + map_element "disp-formula", to: :disp_formula + map_element "disp-formula-group", to: :disp_formula_group + map_element "p", to: :paragraph + map_element "def-list", to: :def_list + map_element "list", to: :list + map_element "math", to: :math + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "disp-quote", to: :disp_quote + map_element "speech", to: :speech + map_element "statement", to: :statement + map_element "verse-group", to: :verse_group + end + end + end +end diff --git a/lib/sts/iso_sts/term_head.rb b/lib/sts/iso_sts/term_head.rb index d1474e7..0bd8268 100644 --- a/lib/sts/iso_sts/term_head.rb +++ b/lib/sts/iso_sts/term_head.rb @@ -4,24 +4,31 @@ module Sts module IsoSts class TermHead < Lutaml::Model::Serializable attribute :id, :string - attribute :content_type, :string - attribute :specific_use, :string - attribute :xml_lang, :string attribute :content, :string, collection: true attribute :email, ::Sts::IsoSts::Email, collection: true attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true attribute :uri, ::Sts::IsoSts::Uri, collection: true - attribute :mixed_citation, ::Sts::IsoSts::MixedCitation, collection: true - attribute :std, ::Sts::IsoSts::Std, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true attribute :bold, ::Sts::IsoSts::Bold, collection: true attribute :italic, ::Sts::IsoSts::Italic, collection: true attribute :monospace, ::Sts::IsoSts::Monospace, collection: true attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true attribute :sc, ::Sts::IsoSts::Sc, collection: true attribute :strike, ::Sts::IsoSts::Strike, collection: true attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :math, ::Mml::V2::Math, collection: true attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, @@ -29,8 +36,9 @@ class TermHead < Lutaml::Model::Serializable attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true attribute :xref, ::Sts::IsoSts::Xref, collection: true - attribute :std_ref, ::Sts::IsoSts::StdRef, collection: true attribute :sub, ::Sts::IsoSts::Sub, collection: true attribute :sup, ::Sts::IsoSts::Sup, collection: true @@ -39,33 +47,39 @@ class TermHead < Lutaml::Model::Serializable mixed_content map_attribute "id", to: :id - map_attribute "content-type", to: :content_type - map_attribute "specific-use", to: :specific_use - map_attribute "xml:lang", to: :xml_lang - map_content to: :content map_element "email", to: :email map_element "ext-link", to: :ext_link map_element "uri", to: :uri - map_element "mixed-citation", to: :mixed_citation - map_element "std", to: :std + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object map_element "bold", to: :bold map_element "italic", to: :italic map_element "monospace", to: :monospace map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif map_element "sc", to: :sc map_element "strike", to: :strike map_element "underline", to: :underline + map_element "alternatives", to: :alternatives map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct map_element "inline-formula", to: :inline_formula + map_element "math", to: :math map_element "abbrev", to: :abbrev map_element "milestone-end", to: :milestone_end map_element "milestone-start", to: :milestone_start map_element "named-content", to: :named_content map_element "styled-content", to: :styled_content map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term map_element "xref", to: :xref - map_element "std-ref", to: :std_ref map_element "sub", to: :sub map_element "sup", to: :sup end diff --git a/lib/sts/iso_sts/term_sec.rb b/lib/sts/iso_sts/term_sec.rb index 258a23d..71f64ae 100644 --- a/lib/sts/iso_sts/term_sec.rb +++ b/lib/sts/iso_sts/term_sec.rb @@ -10,7 +10,7 @@ class TermSec < Lutaml::Model::Serializable attribute :originator, :string attribute :label, ::Sts::IsoSts::Label attribute :term_entry, ::Sts::TbxIsoTml::TermEntry - attribute :term_display, ::Sts::NisoSts::TermDisplay, collection: true + attribute :term_display, ::Sts::IsoSts::TermDisplay, collection: true attribute :paragraph, ::Sts::IsoSts::Paragraph, collection: true attribute :list, ::Sts::IsoSts::List, collection: true attribute :def_list, ::Sts::IsoSts::DefList, collection: true diff --git a/lib/sts/iso_sts/textual_form.rb b/lib/sts/iso_sts/textual_form.rb new file mode 100644 index 0000000..98149fb --- /dev/null +++ b/lib/sts/iso_sts/textual_form.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class TextualForm < Lutaml::Model::Serializable + attribute :id, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do + element "textual-form" + mixed_content + + map_attribute "id", to: :id + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "math", to: :math + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/trans_source.rb b/lib/sts/iso_sts/trans_source.rb new file mode 100644 index 0000000..63c7def --- /dev/null +++ b/lib/sts/iso_sts/trans_source.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class TransSource < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do + element "trans-source" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/trans_title.rb b/lib/sts/iso_sts/trans_title.rb new file mode 100644 index 0000000..c135ec0 --- /dev/null +++ b/lib/sts/iso_sts/trans_title.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class TransTitle < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :email, ::Sts::IsoSts::Email, collection: true + attribute :ext_link, ::Sts::IsoSts::ExtLink, collection: true + attribute :uri, ::Sts::IsoSts::Uri, collection: true + attribute :inline_supplementary_material, ::Sts::IsoSts::InlineSupplementaryMaterial, + collection: true + attribute :related_article, ::Sts::IsoSts::RelatedArticle, + collection: true + attribute :related_object, ::Sts::IsoSts::RelatedObject, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :math, ::Mml::V2::Math, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :fn, ::Sts::IsoSts::Fn, collection: true + attribute :target, ::Sts::IsoSts::Target, collection: true + attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm, collection: true + attribute :xref, ::Sts::IsoSts::Xref, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + attribute :break, ::Sts::IsoSts::Break, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "trans-title" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "email", to: :email + map_element "ext-link", to: :ext_link + map_element "uri", to: :uri + map_element "inline-supplementary-material", + to: :inline_supplementary_material + map_element "related-article", to: :related_article + map_element "related-object", to: :related_object + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "math", to: :math + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "fn", to: :fn + map_element "target", to: :target + map_element "entailedTerm", to: :entailed_term + map_element "xref", to: :xref + map_element "sub", to: :sub + map_element "sup", to: :sup + map_element "break", to: :break + end + end + end +end diff --git a/lib/sts/iso_sts/verse_group.rb b/lib/sts/iso_sts/verse_group.rb new file mode 100644 index 0000000..fabf2e0 --- /dev/null +++ b/lib/sts/iso_sts/verse_group.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class VerseGroup < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :originator, :string + attribute :label, ::Sts::IsoSts::Label + attribute :title, ::Sts::IsoSts::Title + attribute :subtitle, ::Sts::IsoSts::Subtitle + attribute :verse_line, ::Sts::IsoSts::VerseLine, collection: true + attribute :verse_group, ::Sts::IsoSts::VerseGroup, collection: true + attribute :attrib, ::Sts::IsoSts::Attrib, collection: true + attribute :permissions, ::Sts::IsoSts::Permissions, collection: true + + xml do + element "verse-group" + ordered + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_attribute "originator", to: :originator + map_element "label", to: :label + map_element "title", to: :title + map_element "subtitle", to: :subtitle + map_element "verse-line", to: :verse_line + map_element "verse-group", to: :verse_group + map_element "attrib", to: :attrib + map_element "permissions", to: :permissions + end + end + end +end diff --git a/lib/sts/iso_sts/verse_line.rb b/lib/sts/iso_sts/verse_line.rb new file mode 100644 index 0000000..42027fe --- /dev/null +++ b/lib/sts/iso_sts/verse_line.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class VerseLine < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + attribute :bold, ::Sts::IsoSts::Bold, collection: true + attribute :italic, ::Sts::IsoSts::Italic, collection: true + attribute :monospace, ::Sts::IsoSts::Monospace, collection: true + attribute :num, ::Sts::IsoSts::Num, collection: true + attribute :overline, ::Sts::IsoSts::Overline, collection: true + attribute :roman, ::Sts::IsoSts::Roman, collection: true + attribute :sans_serif, ::Sts::IsoSts::SansSerif, collection: true + attribute :sc, ::Sts::IsoSts::Sc, collection: true + attribute :strike, ::Sts::IsoSts::Strike, collection: true + attribute :underline, ::Sts::IsoSts::Underline, collection: true + attribute :alternatives, ::Sts::IsoSts::Alternatives, collection: true + attribute :inline_graphic, ::Sts::IsoSts::InlineGraphic, collection: true + attribute :private_char, ::Sts::IsoSts::PrivateChar, collection: true + attribute :chem_struct, ::Sts::IsoSts::ChemStruct, collection: true + attribute :inline_formula, ::Sts::IsoSts::InlineFormula, collection: true + attribute :abbrev, ::Sts::IsoSts::Abbrev, collection: true + attribute :milestone_end, ::Sts::IsoSts::MilestoneEnd, collection: true + attribute :milestone_start, ::Sts::IsoSts::MilestoneStart, + collection: true + attribute :named_content, ::Sts::IsoSts::NamedContent, collection: true + attribute :styled_content, ::Sts::IsoSts::StyledContent, collection: true + attribute :sub, ::Sts::IsoSts::Sub, collection: true + attribute :sup, ::Sts::IsoSts::Sup, collection: true + + xml do # rubocop:disable Metrics/BlockLength + element "verse-line" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + map_element "bold", to: :bold + map_element "italic", to: :italic + map_element "monospace", to: :monospace + map_element "num", to: :num + map_element "overline", to: :overline + map_element "roman", to: :roman + map_element "sans-serif", to: :sans_serif + map_element "sc", to: :sc + map_element "strike", to: :strike + map_element "underline", to: :underline + map_element "alternatives", to: :alternatives + map_element "inline-graphic", to: :inline_graphic + map_element "private-char", to: :private_char + map_element "chem-struct", to: :chem_struct + map_element "inline-formula", to: :inline_formula + map_element "abbrev", to: :abbrev + map_element "milestone-end", to: :milestone_end + map_element "milestone-start", to: :milestone_start + map_element "named-content", to: :named_content + map_element "styled-content", to: :styled_content + map_element "sub", to: :sub + map_element "sup", to: :sup + end + end + end +end diff --git a/lib/sts/iso_sts/volume_id.rb b/lib/sts/iso_sts/volume_id.rb new file mode 100644 index 0000000..1c90b1a --- /dev/null +++ b/lib/sts/iso_sts/volume_id.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class VolumeId < Lutaml::Model::Serializable + attribute :id, :string + attribute :pub_id_type, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "volume-id" + mixed_content + + map_attribute "id", to: :id + map_attribute "pub-id-type", to: :pub_id_type + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/lib/sts/iso_sts/volume_series.rb b/lib/sts/iso_sts/volume_series.rb new file mode 100644 index 0000000..9b5a6b7 --- /dev/null +++ b/lib/sts/iso_sts/volume_series.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Sts + module IsoSts + class VolumeSeries < Lutaml::Model::Serializable + attribute :id, :string + attribute :content_type, :string + attribute :specific_use, :string + attribute :xml_lang, :string + attribute :content, :string, collection: true + + xml do + element "volume-series" + mixed_content + + map_attribute "id", to: :id + map_attribute "content-type", to: :content_type + map_attribute "specific-use", to: :specific_use + map_attribute "xml:lang", to: :xml_lang + map_content to: :content + end + end + end +end diff --git a/spec/iso_sts/iso_sts_element_spec.rb b/spec/iso_sts/iso_sts_element_spec.rb index bc202dd..bcef939 100644 --- a/spec/iso_sts/iso_sts_element_spec.rb +++ b/spec/iso_sts/iso_sts_element_spec.rb @@ -961,32 +961,9 @@ # ISOSTS and are modelled from ISOSTS.xsd, not # copied from NisoSts (which disagrees — NisoSts::DispQuote lacks xml_lang # and title; NisoSts::BoxedText has form_type/is_form that ISOSTS does not - # define). Children limited to the IsoSts classes that currently exist; - # omitted children (attrib, speech, statement, verse-group, etc.) are - # tracked in TODO.sts-refactor/03-namespace-coupling.md. + # define). Their exhaustive XSD surfaces and round-trips are covered in + # iso_sts_recursive_content_closure_spec.rb. describe "IsoSts::DispQuote and BoxedText are modelled from ISOSTS.xsd" do - it "DispQuote models its configured attribute set" do - expect(described_class::DispQuote.attributes.keys) - .to match_array(%i[ - id content_type specific_use xml_lang originator - label title paragraph list def_list non_normative_note - non_normative_example preformat fig graphic - disp_formula disp_quote attrib permissions - ]) - end - - it "BoxedText models its configured attribute set" do - expect(described_class::BoxedText.attributes.keys) - .to match_array(%i[ - id position orientation specific_use xml_lang - content_type originator sts_object_id label caption - paragraph list def_list non_normative_note - non_normative_example preformat fig graphic - disp_formula disp_quote boxed_text sec term_sec - fn_group ref_list attrib permissions - ]) - end - it "BoxedText exposes :sts_object_id, not :object_id" do # Object#object_id is Ruby's built-in; redefining it via lutaml-model # accessor clashes. Follow the NisoSts::Graphic precedent. @@ -1047,24 +1024,10 @@ end end - # ISOSTS is mixed content with many inline children. Modelled from - # ISOSTS.xsd with the subset of inline-element children that have IsoSts - # classes today; omitted children (inline-supplementary-material, - # related-article, related-object, element-citation, overline, roman, - # sans-serif, alternatives, private-char, chem-struct, mml:math, target, - # tbx:entailedTerm) tracked in TODO.sts-refactor/03-namespace-coupling.md. + # ISOSTS is mixed content with the complete XSD inline child set. + # Its exhaustive XSD surface and round-trips are covered in + # iso_sts_recursive_content_closure_spec.rb. describe "IsoSts::Attrib is modelled from ISOSTS.xsd" do - it "models its configured attribute set" do - expect(described_class::Attrib.attributes.keys) - .to match_array(%i[ - id specific_use xml_lang content email ext_link uri - mixed_citation std bold italic monospace num sc - strike underline inline_graphic inline_formula abbrev - milestone_end milestone_start named_content - styled_content fn xref std_ref sub sup - ]) - end - it "Array#attrib is IsoSts::Attrib" do expect(described_class::Array.attributes[:attrib].type) .to eq(described_class::Attrib) @@ -1103,31 +1066,9 @@ end # Issue #40 child-bearing roots: License, TermHead, CustomMetaGroup. - # Each modelled from ISOSTS.xsd; closes 5 IsoSts->NisoSts refs. + # Each is modelled from ISOSTS.xsd; their exhaustive XSD surfaces and + # round-trips are covered in iso_sts_recursive_content_closure_spec.rb. describe "IsoSts::License closure" do - it "License models its configured attribute set" do - expect(described_class::License.attributes.keys) - .to match_array(%i[ - license_type specific_use xml_lang xlink_type - xlink_href xlink_role xlink_title xlink_show - xlink_actuate license_p - ]) - end - - it "LicenseP models its configured attribute set" do - expect(described_class::LicenseP.attributes.keys) - .to match_array(%i[ - id specific_use xml_lang content_type content email - ext_link uri mixed_citation std bold italic - monospace num sc strike underline inline_graphic - inline_formula abbrev milestone_end milestone_start - named_content styled_content list def_list - non_normative_note non_normative_example preformat - fig graphic disp_formula disp_quote boxed_text fn - xref std_ref sub sup - ]) - end - it "License#license_p uses IsoSts::LicenseP" do expect(described_class::License.attributes[:license_p].type) .to eq(described_class::LicenseP) @@ -1162,17 +1103,6 @@ end describe "IsoSts::TermHead" do - it "models its configured attribute set" do - expect(described_class::TermHead.attributes.keys) - .to match_array(%i[ - id content_type specific_use xml_lang content email - ext_link uri mixed_citation std bold italic - monospace num sc strike underline inline_graphic - inline_formula abbrev milestone_end milestone_start - named_content styled_content fn xref std_ref sub sup - ]) - end - it "DefList#term_head is IsoSts::TermHead" do expect(described_class::DefList.attributes[:term_head].type) .to eq(described_class::TermHead) @@ -1180,11 +1110,6 @@ end describe "IsoSts::CustomMetaGroup closure" do - it "CustomMetaGroup models its configured attribute set" do - expect(described_class::CustomMetaGroup.attributes.keys) - .to match_array(%i[custom_meta]) - end - it "CustomMeta models its configured attribute set" do expect(described_class::CustomMeta.attributes.keys) .to match_array(%i[ @@ -1194,19 +1119,6 @@ ]) end - it "MetaName models its configured attribute set" do - expect(described_class::MetaName.attributes.keys) - .to match_array(%i[content]) - end - - it "MetaValue models its configured attribute set" do - expect(described_class::MetaValue.attributes.keys) - .to match_array(%i[ - id specific_use xml_lang content bold italic - monospace num sc strike underline sub sup - ]) - end - it "CustomMetaGroup#custom_meta uses IsoSts::CustomMeta" do expect(described_class::CustomMetaGroup.attributes[:custom_meta].type) .to eq(described_class::CustomMeta) diff --git a/spec/sts/iso_sts_recursive_content_closure_spec.rb b/spec/sts/iso_sts_recursive_content_closure_spec.rb new file mode 100644 index 0000000..ffb1730 --- /dev/null +++ b/spec/sts/iso_sts_recursive_content_closure_spec.rb @@ -0,0 +1,420 @@ +# frozen_string_literal: true + +RSpec.describe Sts::IsoSts do + let(:registry_source) do + File.read(File.join(repository_root, "lib/sts/iso_sts.rb")) + end + let(:xsd) do + Nokogiri::XML( + File.read( + File.join( + repository_root, + "reference-docs/isosts-v1/xsd/ISOSTS.xsd", + ), + ), + ) + end + let(:recursive_registry) do + registry_source + .split(" # Recursive content closure\n", 2) + .fetch(1) + .split("\n # List elements", 2) + .first + .scan(%r{autoload :(\w+),\s+"[^"]+/iso_sts/([^"]+)"}m) + .to_h + end + let(:element_classes) do + full_registry = registry_source + .scan(%r{autoload :(\w+),\s+"[^"]+/iso_sts/([^"]+)"}m) + .to_h + full_registry.each_key.with_object({}) do |class_name, result| + model = described_class.const_get(class_name, false) + next unless model.respond_to?(:mappings_for) + + element = model.mappings_for(:xml).root_element + result[element] ||= model if element + end + end + + def repository_root + File.expand_path("../..", __dir__) + end + + def xsd_namespaces + { "xs" => "http://www.w3.org/2001/XMLSchema" } + end + + def ruby_xml_attribute(xml_name) + return "object_id_value" if xml_name == "object-id" + + xml_name.tr(":-", "__") + end + + def base_child_name(xml_name) + { + "p" => "paragraph", + "mml:math" => "math", + "tbx:entailedTerm" => "entailed_term", + "object-id" => "sts_object_id", + }.fetch(xml_name, xml_name.tr(":-", "__")) + end + + def collection?(element_node, complex_type) + current = element_node + until current == complex_type + max_occurs = current["maxOccurs"] + return true if max_occurs && max_occurs != "1" + + current = current.parent + end + false + end + + def child_type(reference) + return Mml::V2::Math if reference == "mml:math" + return Sts::IsoSts::StdRef if reference == "std-ref" + if reference == "tbx:entailedTerm" + return Sts::TbxIsoTml::EntailedTerm + end + + element_classes.fetch(reference) + end + + def xml_attributes_for(complex_type) + attributes = complex_type.xpath( + "./xs:attribute", + xsd_namespaces, + ).map { |attribute| attribute["name"] || attribute["ref"] } + ["id", *attributes.reject { |name| name == "id" }] + end + + def expected_child(reference, occurrences, complex_type, ruby_attributes) + name = base_child_name(reference) + name = "#{name}_element" if ruby_attributes.include?(name) + { + name: name, + type: child_type(reference), + collection: occurrences.any? do |child| + collection?(child, complex_type) + end, + } + end + + def expected_children_for(complex_type, ruby_attributes) + children = complex_type.xpath(".//xs:element[@ref]", xsd_namespaces) + children.group_by { |child| child["ref"] } + .to_h do |reference, occurrences| + child = expected_child( + reference, + occurrences, + complex_type, + ruby_attributes, + ) + [reference, child] + end + end + + def simple_schema + { + xml_attributes: ["id"], + ruby_attributes: %w[id content], + children: {}, + mixed: false, + content: true, + } + end + + def complex_schema(complex_type) + xml_attributes = xml_attributes_for(complex_type) + ruby_attributes = xml_attributes.map { |name| ruby_xml_attribute(name) } + mixed = complex_type["mixed"] == "true" + ruby_attributes << "content" if mixed + { + xml_attributes: xml_attributes, + ruby_attributes: ruby_attributes, + children: expected_children_for(complex_type, ruby_attributes), + mixed: mixed, + content: mixed, + } + end + + def expected_schema(node) + complex_type = node.at_xpath("./xs:complexType", xsd_namespaces) + complex_type ? complex_schema(complex_type) : simple_schema + end + + def xml_attribute_value(name, index) + { + "id" => "closure-#{index}", + "xml:lang" => "en", + "xlink:type" => "simple", + "xlink:href" => "https://example.com/#{index}", + "xlink:show" => "replace", + "xlink:actuate" => "onRequest", + "continued-from" => "closure-source", + "rid" => "closure-target", + }.fetch(name, "value-#{index}") + end + + def element_xml(element, attributes: {}, content: "") + namespaces = [ + 'xmlns:xlink="http://www.w3.org/1999/xlink"', + 'xmlns:mml="http://www.w3.org/1998/Math/MathML"', + 'xmlns:tbx="urn:iso:std:iso:30042:ed-1"', + ] + mapped = attributes.map { |name, value| %(#{name}="#{value}") } + "<#{element} #{[*namespaces, *mapped].join(' ')}>#{content}" + end + + def mapped_child(instance, child) + value = instance.public_send(child[:name]) + child[:collection] ? value.first : value + end + + def mapped_element_names(children) + children.keys.map { |reference| reference.split(":").last } + end + + it "registers all 90 closure models one-to-one with their files" do + expect(recursive_registry.size).to eq(90) + + recursive_registry.each do |class_name, relative_path| + expect(described_class.const_defined?(class_name, false)).to be(true) + expect(File).to exist( + File.join( + repository_root, + "lib/sts/iso_sts/#{relative_path}.rb", + ), + ) + end + end + + it "models the complete XSD surface and mandatory id" do + recursive_registry.each do |class_name, relative_path| + model = described_class.const_get(class_name, false) + mapping = model.mappings_for(:xml) + element = mapping.root_element + node = xsd.at_xpath( + "/xs:schema/xs:element[@name='#{element}']", + xsd_namespaces, + ) + expected = expected_schema(node) + + aggregate_failures(class_name) do + expected_keys = expected[:ruby_attributes].map(&:to_sym) + + expected[:children].values.map { |child| child[:name].to_sym } + expect(model.attributes.keys).to match_array(expected_keys) + expect(mapping.attributes.map(&:name)) + .to match_array(expected[:xml_attributes]) + expect(mapping.elements.map(&:name)) + .to match_array(mapped_element_names(expected[:children])) + expect(mapping.mixed_content?).to eq(expected[:mixed]) + expect(!!mapping.ordered?) + .to eq(expected[:mixed] || expected[:children].any?) + expect(mapping.content_mapping.nil?).to eq(!expected[:content]) + + expected[:children].each_value do |child| + attribute = model.attributes.fetch(child[:name].to_sym) + expect(attribute.type).to eq(child[:type]) + expect(attribute.collection?).to eq(child[:collection]) + end + + parsed = model.from_xml(%(<#{element} id="closure-1"/>)) + expect(parsed.id).to eq("closure-1") + expect(model.to_xml(parsed)).to include('id="closure-1"') + + source = File.read( + File.join( + repository_root, + "lib/sts/iso_sts/#{relative_path}.rb", + ), + ) + expect(source).not_to include("Sts::NisoSts::") + expect(source).not_to include("required: true") + end + end + end + + it "round-trips every XML attribute on every closure model" do + recursive_registry.each_with_index do |(class_name, _relative_path), index| + model = described_class.const_get(class_name, false) + mapping = model.mappings_for(:xml) + node = xsd.at_xpath( + "/xs:schema/xs:element[@name='#{mapping.root_element}']", + xsd_namespaces, + ) + expected = expected_schema(node) + values = expected[:xml_attributes].to_h do |name| + [name, xml_attribute_value(name, index)] + end + reparsed = model.from_xml( + model.to_xml( + model.from_xml(element_xml(mapping.root_element, attributes: values)), + ), + ) + + aggregate_failures(class_name) do + expected[:xml_attributes] + .zip(expected[:ruby_attributes]) + .each do |xml_name, ruby_name| + expect(reparsed.public_send(ruby_name)) + .to eq(values.fetch(xml_name)) + end + end + end + end + + it "round-trips text content and every child on every closure model" do + recursive_registry.each_key do |class_name| + model = described_class.const_get(class_name, false) + mapping = model.mappings_for(:xml) + node = xsd.at_xpath( + "/xs:schema/xs:element[@name='#{mapping.root_element}']", + xsd_namespaces, + ) + expected = expected_schema(node) + + if expected[:content] + xml = element_xml( + mapping.root_element, + attributes: { "id" => "content-1" }, + content: "round-trip text", + ) + reparsed = model.from_xml(model.to_xml(model.from_xml(xml))) + expect(Array(reparsed.content).join).to include("round-trip text") + end + + expected[:children].each do |reference, child| + xml = element_xml( + mapping.root_element, + attributes: { "id" => "parent-1" }, + content: "<#{reference}/>", + ) + serialized = model.to_xml(model.from_xml(xml)) + reparsed = model.from_xml(serialized) + + aggregate_failures("#{class_name}##{child[:name]}") do + expect(mapped_child(reparsed, child)).not_to be_nil + names = Nokogiri::XML(serialized).root.element_children.map(&:name) + expect(names).to include(reference.split(":").last) + end + end + end + end + + it "removes every Niso type from IsoSts" do + expect(Sts::IsoSts::Array.attributes[:attrib].type) + .to eq(Sts::IsoSts::Attrib) + expect(Sts::IsoSts::Body.attributes[:disp_quote].type) + .to eq(Sts::IsoSts::DispQuote) + expect(Sts::IsoSts::Sec.attributes[:disp_quote].type) + .to eq(Sts::IsoSts::DispQuote) + expect(Sts::IsoSts::Sec.attributes[:boxed_text].type) + .to eq(Sts::IsoSts::BoxedText) + expect(Sts::IsoSts::Ref.attributes[:element_citation].type) + .to eq(Sts::IsoSts::ElementCitation) + expect(Sts::IsoSts::TableWrapFoot.attributes[:attrib].type) + .to eq(Sts::IsoSts::Attrib) + expect(Sts::IsoSts::DefList.attributes[:term_head].type) + .to eq(Sts::IsoSts::TermHead) + expect(Sts::IsoSts::Permissions.attributes[:license].type) + .to eq(Sts::IsoSts::License) + expect(Sts::IsoSts::TermSec.attributes[:term_display].type) + .to eq(Sts::IsoSts::TermDisplay) + + { + person_group: Sts::IsoSts::PersonGroup, + collab: Sts::IsoSts::Collab, + source: Sts::IsoSts::Source, + article_title: Sts::IsoSts::ArticleTitle, + }.each do |attribute, type| + expect(Sts::IsoSts::MixedCitation.attributes[attribute].type) + .to eq(type) + end + + { + iso_meta: Sts::IsoSts::IsoMeta, + nat_meta: Sts::IsoSts::NatMeta, + reg_meta: Sts::IsoSts::RegMeta, + }.each_value do |model| + expect(model.attributes[:custom_meta_group].type) + .to eq(Sts::IsoSts::CustomMetaGroup) + end + + source = Dir[File.join(repository_root, "lib/sts/iso_sts/**/*.rb")] + .map { |path| File.read(path) } + .join + expect(source).not_to include("Sts::NisoSts::") + end + + it "round-trips a nested recursive citation closure" do + xml = <<~XML + + + Recursive closure + + +

Nested quote

+ + + + + Doe + Jane + + + Title + Journal + + +
+
+ Attribution +
+ XML + + parsed = Sts::IsoSts::DispQuote.from_xml(xml) + expect(Sts::IsoSts::DispQuote.to_xml(parsed)) + .to be_xml_equivalent_to(xml) + end + + it "round-trips the final bounded closures" do + custom_meta = <<~XML + + + key + value + + + XML + license = <<~XML + + Terms + Agency + A-1 + $5 +

Open

+
+
+ XML + term_display = <<~XML + + Term +

Definition

+
+ XML + term_head = <<~XML + Terms header + XML + examples = { + Sts::IsoSts::CustomMetaGroup => custom_meta, + Sts::IsoSts::License => license, + Sts::IsoSts::TermDisplay => term_display, + Sts::IsoSts::TermHead => term_head, + } + + examples.each do |model, xml| + expect(model.to_xml(model.from_xml(xml))).to be_xml_equivalent_to(xml) + end + end +end From 08c48536ed2f7c2440b5169ddfa5014a961cec9d Mon Sep 17 00:00:00 2001 From: HassanAkbar Date: Mon, 27 Jul 2026 15:15:40 +0500 Subject: [PATCH 2/4] add ids to remaining isosts models --- TODO.sts-refactor/00-overview.md | 13 ++++++------- lib/sts/iso_sts/monospace.rb | 2 ++ lib/sts/iso_sts/sc.rb | 2 ++ lib/sts/iso_sts/standard_ref.rb | 2 ++ lib/sts/iso_sts/strike.rb | 2 ++ lib/sts/iso_sts/underline.rb | 2 ++ lib/sts/iso_sts/uri.rb | 2 ++ spec/iso_sts/iso_sts_element_spec.rb | 26 ++++++++++++++++++++++---- 8 files changed, 40 insertions(+), 11 deletions(-) diff --git a/TODO.sts-refactor/00-overview.md b/TODO.sts-refactor/00-overview.md index ed02964..fdd3383 100644 --- a/TODO.sts-refactor/00-overview.md +++ b/TODO.sts-refactor/00-overview.md @@ -184,15 +184,14 @@ the **NISO** XSD and applied the result to IsoSts. name. (`meta-date` was NOT lossy — it already maps `type`.) - **Not a bug — the conventional `@id`.** IsoSts models carry an `@id` that ISOSTS does not itself define; this is the deliberate 86948b9 convention - (NISO-XSD-verified), not dead surface. + (NISO-XSD-verified), not dead surface. All 220 registered IsoSts models now + expose and map it. - **Remaining follow-up (separate change).** 7 spurious attributes on 5 models (model carries an attr ISOSTS does not define: `graphic` `type`, `body`/`back` - `content-type`, `content-language`/`language` extras), and the 6 classes left - without `@id` in 86948b9 (`monospace`, `sc`, `strike`, `underline`, `uri`, - `standard_ref`). + `content-type`, `content-language`/`language` extras). ## Next Action `03` is complete: the 90-model closure removes every IsoSts→NisoSts reference. -Continue with the remaining schema-conformance follow-up above — the 7 spurious -attributes on 5 models and the 6 classes without `@id`. (The dropped-attribute -data loss is now fixed.) +Continue with the remaining schema-conformance follow-up above: the 7 spurious +attributes on 5 models. (The dropped-attribute data loss and mandatory `@id` +surface are now fixed.) diff --git a/lib/sts/iso_sts/monospace.rb b/lib/sts/iso_sts/monospace.rb index 6f74c61..6e11656 100644 --- a/lib/sts/iso_sts/monospace.rb +++ b/lib/sts/iso_sts/monospace.rb @@ -3,6 +3,7 @@ module Sts module IsoSts class Monospace < Lutaml::Model::Serializable + attribute :id, :string attribute :specific_use, :string attribute :content, :string, collection: true attribute :bold, ::Sts::IsoSts::Bold, collection: true @@ -14,6 +15,7 @@ class Monospace < Lutaml::Model::Serializable element "monospace" mixed_content + map_attribute "id", to: :id map_attribute "specific-use", to: :specific_use map_content to: :content map_element "bold", to: :bold diff --git a/lib/sts/iso_sts/sc.rb b/lib/sts/iso_sts/sc.rb index 7f6a3d4..eb363ce 100644 --- a/lib/sts/iso_sts/sc.rb +++ b/lib/sts/iso_sts/sc.rb @@ -3,6 +3,7 @@ module Sts module IsoSts class Sc < Lutaml::Model::Serializable + attribute :id, :string attribute :specific_use, :string attribute :content, :string, collection: true attribute :bold, ::Sts::IsoSts::Bold, collection: true @@ -14,6 +15,7 @@ class Sc < Lutaml::Model::Serializable element "sc" mixed_content + map_attribute "id", to: :id map_attribute "specific-use", to: :specific_use map_content to: :content map_element "bold", to: :bold diff --git a/lib/sts/iso_sts/standard_ref.rb b/lib/sts/iso_sts/standard_ref.rb index cf66041..11cb1fd 100644 --- a/lib/sts/iso_sts/standard_ref.rb +++ b/lib/sts/iso_sts/standard_ref.rb @@ -3,11 +3,13 @@ module Sts module IsoSts class StandardRef < Lutaml::Model::Serializable + attribute :id, :string attribute :type, :string attribute :value, :string xml do element "std-ref" + map_attribute "id", to: :id map_attribute "type", to: :type map_content to: :value end diff --git a/lib/sts/iso_sts/strike.rb b/lib/sts/iso_sts/strike.rb index c6c7e74..9da0f11 100644 --- a/lib/sts/iso_sts/strike.rb +++ b/lib/sts/iso_sts/strike.rb @@ -3,6 +3,7 @@ module Sts module IsoSts class Strike < Lutaml::Model::Serializable + attribute :id, :string attribute :specific_use, :string attribute :content, :string, collection: true attribute :bold, ::Sts::IsoSts::Bold, collection: true @@ -14,6 +15,7 @@ class Strike < Lutaml::Model::Serializable element "strike" mixed_content + map_attribute "id", to: :id map_attribute "specific-use", to: :specific_use map_content to: :content map_element "bold", to: :bold diff --git a/lib/sts/iso_sts/underline.rb b/lib/sts/iso_sts/underline.rb index 23759f7..11968d1 100644 --- a/lib/sts/iso_sts/underline.rb +++ b/lib/sts/iso_sts/underline.rb @@ -3,6 +3,7 @@ module Sts module IsoSts class Underline < Lutaml::Model::Serializable + attribute :id, :string attribute :underline_style, :string attribute :specific_use, :string attribute :content, :string, collection: true @@ -15,6 +16,7 @@ class Underline < Lutaml::Model::Serializable element "underline" mixed_content + map_attribute "id", to: :id map_attribute "underline-style", to: :underline_style map_attribute "specific-use", to: :specific_use map_content to: :content diff --git a/lib/sts/iso_sts/uri.rb b/lib/sts/iso_sts/uri.rb index 47e28ad..27e52f6 100644 --- a/lib/sts/iso_sts/uri.rb +++ b/lib/sts/iso_sts/uri.rb @@ -3,6 +3,7 @@ module Sts module IsoSts class Uri < Lutaml::Model::Serializable + attribute :id, :string attribute :content_type, :string attribute :specific_use, :string attribute :xml_lang, :string @@ -18,6 +19,7 @@ class Uri < Lutaml::Model::Serializable element "uri" mixed_content + map_attribute "id", to: :id map_attribute "content-type", to: :content_type map_attribute "specific-use", to: :specific_use map_attribute "xml:lang", to: :xml_lang diff --git a/spec/iso_sts/iso_sts_element_spec.rb b/spec/iso_sts/iso_sts_element_spec.rb index bcef939..15e32c2 100644 --- a/spec/iso_sts/iso_sts_element_spec.rb +++ b/spec/iso_sts/iso_sts_element_spec.rb @@ -790,8 +790,9 @@ describe "@id round-trips through parse and serialise" do %i[ DocNumber DocType Fpage Ics IsProof Issue Lpage Originator PageRange - PartNumber ProjId PubDate PubId ReleaseVersion Sdo SupplNumber SupplType - SupplVersion Urn Version Volume Year Secretariat + Monospace PartNumber ProjId PubDate PubId ReleaseVersion Sc Sdo + Secretariat StandardRef Strike SupplNumber SupplType SupplVersion + Underline Uri Urn Version Volume Year ].each do |klass| it "IsoSts::#{klass} preserves @id through a round-trip" do model = described_class.const_get(klass) @@ -806,6 +807,21 @@ expect(model.to_xml(parsed)).to include('id="x-1"') end end + + it "maps @id on every registered IsoSts model" do + registry = described_class.constants(false) + expect(registry.size).to eq(220) + + registry.each do |class_name| + model = described_class.const_get(class_name, false) + mapping = model.mappings_for(:xml) + + aggregate_failures(class_name) do + expect(model.attributes).to have_key(:id) + expect(mapping.attributes.map(&:name)).to include("id") + end + end + end end # xlink:type is dropped on parse and omitted on serialise when unmapped. A @@ -931,7 +947,7 @@ styled_content ext_link uri named_content ], Uri: %i[ - content_type specific_use xml_lang xlink_href xlink_type xlink_role + id content_type specific_use xml_lang xlink_href xlink_type xlink_role xlink_title xlink_show xlink_actuate content ], NamedContent: %i[ @@ -944,7 +960,9 @@ mime_subtype xlink_href xlink_type xlink_role xlink_title xlink_show xlink_actuate graphic_type originator label caption alt_text long_desc ], - Underline: %i[underline_style specific_use content bold italic sub sup], + Underline: %i[ + id underline_style specific_use content bold italic sub sup + ], Body: %i[ id content_type specific_use paragraph sec term_sec list def_list disp_formula table_wrap fig non_normative_note non_normative_example From b3e67f1a85d7037f22d10e1335815e617ddba82e Mon Sep 17 00:00:00 2001 From: HassanAkbar Date: Mon, 27 Jul 2026 16:05:25 +0500 Subject: [PATCH 3/4] resolve copilot comments --- spec/iso_sts/iso_sts_element_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/iso_sts/iso_sts_element_spec.rb b/spec/iso_sts/iso_sts_element_spec.rb index 15e32c2..5f513df 100644 --- a/spec/iso_sts/iso_sts_element_spec.rb +++ b/spec/iso_sts/iso_sts_element_spec.rb @@ -980,7 +980,7 @@ # copied from NisoSts (which disagrees — NisoSts::DispQuote lacks xml_lang # and title; NisoSts::BoxedText has form_type/is_form that ISOSTS does not # define). Their exhaustive XSD surfaces and round-trips are covered in - # iso_sts_recursive_content_closure_spec.rb. + # spec/sts/iso_sts_recursive_content_closure_spec.rb. describe "IsoSts::DispQuote and BoxedText are modelled from ISOSTS.xsd" do it "BoxedText exposes :sts_object_id, not :object_id" do # Object#object_id is Ruby's built-in; redefining it via lutaml-model @@ -1044,7 +1044,7 @@ # ISOSTS is mixed content with the complete XSD inline child set. # Its exhaustive XSD surface and round-trips are covered in - # iso_sts_recursive_content_closure_spec.rb. + # spec/sts/iso_sts_recursive_content_closure_spec.rb. describe "IsoSts::Attrib is modelled from ISOSTS.xsd" do it "Array#attrib is IsoSts::Attrib" do expect(described_class::Array.attributes[:attrib].type) @@ -1085,7 +1085,8 @@ # Issue #40 child-bearing roots: License, TermHead, CustomMetaGroup. # Each is modelled from ISOSTS.xsd; their exhaustive XSD surfaces and - # round-trips are covered in iso_sts_recursive_content_closure_spec.rb. + # round-trips are covered in + # spec/sts/iso_sts_recursive_content_closure_spec.rb. describe "IsoSts::License closure" do it "License#license_p uses IsoSts::LicenseP" do expect(described_class::License.attributes[:license_p].type) From 0197eab47edd5388dde87cc1119a9ad36f8a6a7e Mon Sep 17 00:00:00 2001 From: HassanAkbar Date: Mon, 27 Jul 2026 16:39:41 +0500 Subject: [PATCH 4/4] fix mixed-citation and ref cardinality data loss --- lib/sts/iso_sts/mixed_citation.rb | 14 ++++++------- lib/sts/iso_sts/ref.rb | 13 +++++++----- .../iso_sts_recursive_content_closure_spec.rb | 21 +++++++++++++++++++ 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/lib/sts/iso_sts/mixed_citation.rb b/lib/sts/iso_sts/mixed_citation.rb index f65d9a6..aca344d 100644 --- a/lib/sts/iso_sts/mixed_citation.rb +++ b/lib/sts/iso_sts/mixed_citation.rb @@ -31,13 +31,13 @@ class MixedCitation < Lutaml::Model::Serializable attribute :person_group, ::Sts::IsoSts::PersonGroup, collection: true attribute :collab, ::Sts::IsoSts::Collab, collection: true attribute :year, ::Sts::IsoSts::Year, collection: true - attribute :source, ::Sts::IsoSts::Source - attribute :article_title, ::Sts::IsoSts::ArticleTitle - attribute :volume, ::Sts::IsoSts::Volume - attribute :issue, ::Sts::IsoSts::Issue - attribute :fpage, ::Sts::IsoSts::Fpage - attribute :lpage, ::Sts::IsoSts::Lpage - attribute :page_range, ::Sts::IsoSts::PageRange + attribute :source, ::Sts::IsoSts::Source, collection: true + attribute :article_title, ::Sts::IsoSts::ArticleTitle, collection: true + attribute :volume, ::Sts::IsoSts::Volume, collection: true + attribute :issue, ::Sts::IsoSts::Issue, collection: true + attribute :fpage, ::Sts::IsoSts::Fpage, collection: true + attribute :lpage, ::Sts::IsoSts::Lpage, collection: true + attribute :page_range, ::Sts::IsoSts::PageRange, collection: true attribute :publisher, ::Sts::IsoSts::Publisher attribute :pub_id, ::Sts::IsoSts::PubId, collection: true diff --git a/lib/sts/iso_sts/ref.rb b/lib/sts/iso_sts/ref.rb index 8e0348c..4e5ff6d 100644 --- a/lib/sts/iso_sts/ref.rb +++ b/lib/sts/iso_sts/ref.rb @@ -8,11 +8,14 @@ class Ref < Lutaml::Model::Serializable attribute :specific_use, :string attribute :xml_lang, :string attribute :label, ::Sts::IsoSts::Label - attribute :mixed_citation, ::Sts::IsoSts::MixedCitation - attribute :element_citation, ::Sts::IsoSts::ElementCitation - attribute :std, ::Sts::IsoSts::Std - attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote - attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample + attribute :mixed_citation, ::Sts::IsoSts::MixedCitation, collection: true + attribute :element_citation, ::Sts::IsoSts::ElementCitation, + collection: true + attribute :std, ::Sts::IsoSts::Std, collection: true + attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote, + collection: true + attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample, + collection: true xml do element "ref" diff --git a/spec/sts/iso_sts_recursive_content_closure_spec.rb b/spec/sts/iso_sts_recursive_content_closure_spec.rb index ffb1730..ff01eff 100644 --- a/spec/sts/iso_sts_recursive_content_closure_spec.rb +++ b/spec/sts/iso_sts_recursive_content_closure_spec.rb @@ -347,6 +347,27 @@ def mapped_element_names(children) expect(source).not_to include("Sts::NisoSts::") end + # mixed-citation and ref sit outside the recursive_registry, so their children + # escaped the cardinality check above. Their content is an unbounded choice, + # so every child must be a collection or repeated nodes are silently dropped. + it "models mixed-citation and ref unbounded children as collections" do + { + Sts::IsoSts::MixedCitation => %i[ + source article_title volume issue fpage lpage page_range + person_group collab year + ], + Sts::IsoSts::Ref => %i[ + mixed_citation element_citation std non_normative_note + non_normative_example + ], + }.each do |model, attrs| + attrs.each do |attr| + expect(model.attributes[attr].collection?) + .to be(true), "#{model}##{attr} must be a collection" + end + end + end + it "round-trips a nested recursive citation closure" do xml = <<~XML