sts 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +7 -1
  3. data/.gitignore +2 -0
  4. data/.rubocop_todo.yml +10 -28
  5. data/Gemfile +4 -2
  6. data/lib/sts/namespaces.rb +13 -0
  7. data/lib/sts/niso_sts/adoption.rb +8 -12
  8. data/lib/sts/niso_sts/adoption_front.rb +1 -3
  9. data/lib/sts/niso_sts/app.rb +11 -22
  10. data/lib/sts/niso_sts/app_group.rb +1 -5
  11. data/lib/sts/niso_sts/back.rb +5 -12
  12. data/lib/sts/niso_sts/body.rb +2 -6
  13. data/lib/sts/niso_sts/caption.rb +6 -10
  14. data/lib/sts/niso_sts/custom_meta.rb +3 -7
  15. data/lib/sts/niso_sts/custom_meta_group.rb +2 -6
  16. data/lib/sts/niso_sts/def.rb +2 -6
  17. data/lib/sts/niso_sts/def_item.rb +3 -8
  18. data/lib/sts/niso_sts/def_list.rb +3 -7
  19. data/lib/sts/niso_sts/display_formula.rb +4 -7
  20. data/lib/sts/niso_sts/document_identification.rb +1 -3
  21. data/lib/sts/niso_sts/ext_link.rb +3 -7
  22. data/lib/sts/niso_sts/figure.rb +6 -13
  23. data/lib/sts/niso_sts/fn.rb +3 -8
  24. data/lib/sts/niso_sts/fn_group.rb +2 -6
  25. data/lib/sts/niso_sts/front.rb +4 -10
  26. data/lib/sts/niso_sts/graphic.rb +5 -11
  27. data/lib/sts/niso_sts/inline_formula.rb +3 -6
  28. data/lib/sts/niso_sts/label.rb +1 -5
  29. data/lib/sts/niso_sts/list.rb +3 -6
  30. data/lib/sts/niso_sts/list_item.rb +8 -13
  31. data/lib/sts/niso_sts/meta_date.rb +1 -3
  32. data/lib/sts/niso_sts/meta_note.rb +3 -6
  33. data/lib/sts/niso_sts/metadata_iso.rb +11 -22
  34. data/lib/sts/niso_sts/metadata_std.rb +12 -19
  35. data/lib/sts/niso_sts/mixed_citation.rb +4 -8
  36. data/lib/sts/{tbx_iso_tml → niso_sts}/named_content.rb +2 -5
  37. data/lib/sts/niso_sts/non_normative_example.rb +4 -9
  38. data/lib/sts/niso_sts/non_normative_note.rb +4 -7
  39. data/lib/sts/niso_sts/object_id.rb +1 -3
  40. data/lib/sts/niso_sts/page_count.rb +1 -3
  41. data/lib/sts/niso_sts/paragraph.rb +15 -32
  42. data/lib/sts/niso_sts/permissions.rb +1 -3
  43. data/lib/sts/niso_sts/reference.rb +4 -7
  44. data/lib/sts/niso_sts/reference_list.rb +3 -5
  45. data/lib/sts/niso_sts/reference_standard.rb +10 -15
  46. data/lib/sts/niso_sts/section.rb +16 -29
  47. data/lib/sts/niso_sts/section_array.rb +2 -6
  48. data/lib/sts/niso_sts/standard.rb +11 -15
  49. data/lib/sts/niso_sts/standard_identification.rb +3 -6
  50. data/lib/sts/niso_sts/standard_ref.rb +1 -3
  51. data/lib/sts/niso_sts/std_cross_reference.rb +2 -4
  52. data/lib/sts/niso_sts/std_id.rb +1 -3
  53. data/lib/sts/niso_sts/std_id_group.rb +2 -6
  54. data/lib/sts/niso_sts/term.rb +68 -0
  55. data/lib/sts/niso_sts/term_display.rb +4 -8
  56. data/lib/sts/niso_sts/term_section.rb +6 -13
  57. data/lib/sts/niso_sts/title.rb +2 -6
  58. data/lib/sts/niso_sts/title_compl.rb +14 -0
  59. data/lib/sts/niso_sts/title_full.rb +18 -0
  60. data/lib/sts/niso_sts/title_wrap.rb +12 -17
  61. data/lib/sts/niso_sts.rb +56 -18
  62. data/lib/sts/tbx_iso_tml/bold.rb +1 -3
  63. data/lib/sts/tbx_iso_tml/caption.rb +1 -3
  64. data/lib/sts/tbx_iso_tml/col.rb +1 -3
  65. data/lib/sts/tbx_iso_tml/cross_reference.rb +17 -0
  66. data/lib/sts/tbx_iso_tml/definition.rb +14 -22
  67. data/lib/sts/tbx_iso_tml/entailed_term.rb +6 -10
  68. data/lib/sts/tbx_iso_tml/example.rb +6 -10
  69. data/lib/sts/tbx_iso_tml/external_graphic.rb +2 -4
  70. data/lib/sts/tbx_iso_tml/external_source.rb +2 -4
  71. data/lib/sts/tbx_iso_tml/fn.rb +2 -4
  72. data/lib/sts/tbx_iso_tml/fn_group.rb +2 -6
  73. data/lib/sts/tbx_iso_tml/geographical_usage.rb +2 -4
  74. data/lib/sts/tbx_iso_tml/grammatical_gender.rb +2 -4
  75. data/lib/sts/tbx_iso_tml/grammatical_number.rb +2 -4
  76. data/lib/sts/tbx_iso_tml/italic.rb +2 -3
  77. data/lib/sts/tbx_iso_tml/lang_set.rb +16 -30
  78. data/lib/sts/tbx_iso_tml/math.rb +12 -25
  79. data/lib/sts/tbx_iso_tml/mfenced.rb +7 -13
  80. data/lib/sts/tbx_iso_tml/mfrac.rb +5 -8
  81. data/lib/sts/tbx_iso_tml/mi.rb +2 -3
  82. data/lib/sts/tbx_iso_tml/mrow.rb +10 -15
  83. data/lib/sts/tbx_iso_tml/mspace.rb +2 -4
  84. data/lib/sts/tbx_iso_tml/mstyle.rb +5 -5
  85. data/lib/sts/tbx_iso_tml/msub.rb +6 -11
  86. data/lib/sts/tbx_iso_tml/msup.rb +4 -9
  87. data/lib/sts/tbx_iso_tml/munder.rb +3 -7
  88. data/lib/sts/tbx_iso_tml/munderover.rb +4 -7
  89. data/lib/sts/tbx_iso_tml/normative_authorization.rb +2 -4
  90. data/lib/sts/tbx_iso_tml/note.rb +18 -30
  91. data/lib/sts/tbx_iso_tml/part_of_speech.rb +2 -4
  92. data/lib/sts/tbx_iso_tml/pronunciation.rb +16 -0
  93. data/lib/sts/tbx_iso_tml/see.rb +2 -4
  94. data/lib/sts/tbx_iso_tml/semantics.rb +5 -9
  95. data/lib/sts/tbx_iso_tml/source.rb +5 -7
  96. data/lib/sts/tbx_iso_tml/subject_field.rb +17 -0
  97. data/lib/sts/tbx_iso_tml/sup.rb +3 -6
  98. data/lib/sts/tbx_iso_tml/table.rb +4 -10
  99. data/lib/sts/tbx_iso_tml/table_break.rb +0 -2
  100. data/lib/sts/tbx_iso_tml/table_wrap.rb +4 -10
  101. data/lib/sts/tbx_iso_tml/table_wrap_foot.rb +2 -6
  102. data/lib/sts/tbx_iso_tml/tbody.rb +2 -6
  103. data/lib/sts/tbx_iso_tml/td.rb +9 -20
  104. data/lib/sts/tbx_iso_tml/term.rb +13 -29
  105. data/lib/sts/tbx_iso_tml/term_entry.rb +5 -9
  106. data/lib/sts/tbx_iso_tml/term_information_group.rb +11 -20
  107. data/lib/sts/tbx_iso_tml/term_type.rb +2 -4
  108. data/lib/sts/tbx_iso_tml/th.rb +8 -16
  109. data/lib/sts/tbx_iso_tml/thead.rb +2 -6
  110. data/lib/sts/tbx_iso_tml/tr.rb +3 -8
  111. data/lib/sts/tbx_iso_tml/xref.rb +2 -3
  112. data/lib/sts/tbx_iso_tml.rb +52 -25
  113. data/lib/sts/version.rb +1 -1
  114. data/lib/sts.rb +4 -12
  115. data/sts.gemspec +1 -1
  116. metadata +12 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4c33b0d9e555f39d6325c27b46bc0557bd21699c1c050f1f5aa7eaa322082df
4
- data.tar.gz: 4427f44d8745804697c0d2a9a4f78f08c0552caa69079b88b50834a8645490bd
3
+ metadata.gz: d455b48722cdfb0fffba31a558bdb9a05780be424faf35ce94f7a67392d7b79f
4
+ data.tar.gz: 781388c40c4493ce7d0c8c1762f346fd231d42a7f9c8742721365d42561b2eaa
5
5
  SHA512:
6
- metadata.gz: c450defe1889541f576c21ba203d09b872722583ef1f9843f5b9afea44d9b970ccd8a0deb99627c6f186643d188c1e77379dc62f6b634a3096d7c199a4e56c4d
7
- data.tar.gz: 152d2ec43794d41885c5f8172f29b6cebf6039384808555c8b157349b1337df9e4e0b4c2a18a472dbab04d3dd8fe7fcdbfe81cd4f4981932765784f7f5232fab
6
+ metadata.gz: 71faa9669cef2e0f5d5f6143996e3654393edd8afd555d1bb1ae599a10a7bff58a21b31eb69d615e6bbb25de105747c430d20023f41016e11d4bf24bf7728d98
7
+ data.tar.gz: 82c5b2715f2d46894fde9bf9ef8a8b904df869d5cdf220ecca5ff094d3e4cdee93295f1f0416caaa66efd94b43051b60900c1748f6170ea0f23fbdd4624ceda9
@@ -2,12 +2,18 @@
2
2
  # See https://github.com/metanorma/cimas
3
3
  name: release
4
4
 
5
+ permissions:
6
+ contents: write
7
+ packages: write
8
+ id-token: write
9
+
5
10
  on:
6
11
  workflow_dispatch:
7
12
  inputs:
8
13
  next_version:
9
14
  description: |
10
- Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
15
+ Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
16
+ Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
11
17
  required: true
12
18
  default: 'skip'
13
19
  repository_dispatch:
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ Gemfile.lock
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-03-19 17:00:15 UTC using RuboCop version 1.74.0.
3
+ # on 2026-04-01 11:46:24 UTC using RuboCop version 1.86.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -8,35 +8,17 @@
8
8
 
9
9
  # Offense count: 6
10
10
  # This cop supports safe autocorrection (--autocorrect).
11
- # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
12
- # SupportedHashRocketStyles: key, separator, table
13
- # SupportedColonStyles: key, separator, table
14
- # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
15
- Layout/HashAlignment:
16
- Exclude:
17
- - 'lib/sts/niso_sts/metadata_iso.rb'
18
- - 'lib/sts/niso_sts/metadata_std.rb'
19
- - 'lib/sts/niso_sts/standard_identification.rb'
20
- - 'lib/sts/tbx_iso_tml/mfenced.rb'
21
-
22
- # Offense count: 7
23
- # This cop supports safe autocorrection (--autocorrect).
24
- # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
11
+ # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
25
12
  # URISchemes: http, https
26
13
  Layout/LineLength:
27
14
  Exclude:
28
- - 'lib/sts/niso_sts/metadata_iso.rb'
29
- - 'lib/sts/niso_sts/metadata_std.rb'
30
- - 'lib/sts/niso_sts/standard_identification.rb'
31
- - 'lib/sts/tbx_iso_tml/mfenced.rb'
15
+ - 'lib/sts/niso_sts/term.rb'
16
+ - 'lib/sts/tbx_iso_tml/lang_set.rb'
32
17
  - 'lib/sts/tbx_iso_tml/term_type.rb'
18
+ - 'spec/spec_helper.rb'
33
19
 
34
- # Offense count: 6
35
- # This cop supports safe autocorrection (--autocorrect).
36
- # Configuration parameters: AllowInHeredoc.
37
- Layout/TrailingWhitespace:
38
- Exclude:
39
- - 'lib/sts/niso_sts/metadata_iso.rb'
40
- - 'lib/sts/niso_sts/metadata_std.rb'
41
- - 'lib/sts/niso_sts/standard_identification.rb'
42
- - 'lib/sts/tbx_iso_tml/mfenced.rb'
20
+ # Offense count: 1
21
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
22
+ # AllowedMethods: refine
23
+ Metrics/BlockLength:
24
+ Max: 27
data/Gemfile CHANGED
@@ -5,10 +5,12 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in sts.gemspec
6
6
  gemspec
7
7
 
8
- gem "equivalent-xml"
8
+ gem "canon"
9
+ gem "lutaml-model", github: "lutaml/lutaml-model", branch: "main"
9
10
  gem "pry"
10
11
  gem "rake"
11
12
  gem "rspec"
12
13
  gem "rubocop"
13
14
  gem "rubocop-performance"
14
- gem "xml-c14n"
15
+ gem "rubocop-rake"
16
+ gem "rubocop-rspec"
@@ -0,0 +1,13 @@
1
+ module Sts
2
+ module Namespaces
3
+ class MathmlNamespace < Lutaml::Xml::Namespace
4
+ uri "http://www.w3.org/1998/Math/MathML"
5
+ prefix_default "mml"
6
+ end
7
+
8
+ class TbxNamespace < Lutaml::Xml::Namespace
9
+ uri "urn:iso:std:iso:30042:ed-1"
10
+ prefix_default "tbx"
11
+ end
12
+ end
13
+ end
@@ -1,25 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "standard"
4
- require_relative "adoption_front"
5
-
6
3
  module Sts
7
4
  module NisoSts
8
5
  class Adoption < Lutaml::Model::Serializable
9
- attribute :front, AdoptionFront
10
- attribute :back, Back
6
+ attribute :front, ::Sts::NisoSts::AdoptionFront
7
+ attribute :back, ::Sts::NisoSts::Back
11
8
  attribute :id, :string
12
- attribute :lang, :string
13
- attribute :adoptions, Adoption, collection: true
14
- attribute :standard, Standard
9
+ attribute :lang, Lutaml::Xml::W3c::XmlLangType
10
+ attribute :adoptions, ::Sts::NisoSts::Adoption, collection: true
11
+ attribute :standard, ::Sts::NisoSts::Standard
15
12
 
16
13
  xml do
17
- root "adoption", mixed: true
14
+ element "adoption"
15
+ mixed_content
18
16
 
19
17
  map_attribute "id", to: :id
20
- map_attribute "lang", to: :lang,
21
- namespace: "http://www.w3.org/XML/1998/namespace",
22
- prefix: "xml"
18
+ map_attribute "lang", to: :lang
23
19
  map_element "adoption-front", to: :front
24
20
  map_element "back", to: :back
25
21
  map_element "adoption", to: :adoptions
@@ -1,12 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "front"
4
-
5
3
  module Sts
6
4
  module NisoSts
7
5
  class AdoptionFront < Front
8
6
  xml do
9
- root "adoption-front"
7
+ element "adoption-front"
10
8
  map_element "iso-meta", to: :iso_meta
11
9
  map_element "std-meta", to: :std_meta
12
10
  map_element "sec", to: :sec
@@ -1,35 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "section"
6
- require_relative "title"
7
- require_relative "paragraph"
8
- require_relative "non_normative_note"
9
- require_relative "figure"
10
- require_relative "reference_list"
11
- require_relative "../tbx_iso_tml/table_wrap"
12
-
13
3
  module Sts
14
4
  module NisoSts
15
- class Title < Lutaml::Model::Serializable; end
16
- class ReferenceList < Lutaml::Model::Serializable; end
17
-
18
5
  class App < Lutaml::Model::Serializable
19
6
  attribute :id, :string
20
7
  attribute :content_type, :string
21
- attribute :label, Label
8
+ attribute :label, ::Sts::NisoSts::Label
22
9
  attribute :annex_type, :string
23
- attribute :title, Title
24
- attribute :fig, Figure, collection: true
25
- attribute :sec, Section, collection: true
26
- attribute :paragraph, Paragraph, collection: true
27
- attribute :ref_list, ReferenceList, collection: true
28
- attribute :non_normative_note, NonNormativeNote, collection: true
29
- attribute :table_wrap, Sts::TbxIsoTml::TableWrap, collection: true
10
+ attribute :title, ::Sts::NisoSts::Title
11
+ attribute :fig, ::Sts::NisoSts::Figure, collection: true
12
+ attribute :sec, ::Sts::NisoSts::Section, collection: true
13
+ attribute :paragraph, ::Sts::NisoSts::Paragraph, collection: true
14
+ attribute :ref_list, ::Sts::NisoSts::ReferenceList, collection: true
15
+ attribute :non_normative_note, ::Sts::NisoSts::NonNormativeNote,
16
+ collection: true
17
+ attribute :table_wrap, ::Sts::TbxIsoTml::TableWrap, collection: true
30
18
 
31
19
  xml do
32
- root "app", mixed: true
20
+ element "app"
21
+ mixed_content
33
22
 
34
23
  map_attribute "id", to: :id
35
24
  map_attribute "content-type", to: :content_type
@@ -1,16 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "app"
6
-
7
3
  module Sts
8
4
  module NisoSts
9
5
  class AppGroup < Lutaml::Model::Serializable
10
6
  attribute :app, Sts::NisoSts::App, collection: true
11
7
 
12
8
  xml do
13
- root "app-group"
9
+ element "app-group"
14
10
 
15
11
  map_element "app", to: :app
16
12
  end
@@ -1,22 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "reference_list"
6
- require_relative "section"
7
- require_relative "app_group"
8
- require_relative "fn_group"
9
-
10
3
  module Sts
11
4
  module NisoSts
12
5
  class Back < Lutaml::Model::Serializable
13
- attribute :ref_list, ReferenceList
14
- attribute :app_group, AppGroup
15
- attribute :sec, Section
16
- attribute :fn_group, FnGroup
6
+ attribute :ref_list, ::Sts::NisoSts::ReferenceList
7
+ attribute :app_group, ::Sts::NisoSts::AppGroup
8
+ attribute :sec, ::Sts::NisoSts::Section
9
+ attribute :fn_group, ::Sts::NisoSts::FnGroup
17
10
 
18
11
  xml do
19
- root "back"
12
+ element "back"
20
13
 
21
14
  map_element "ref-list", to: :ref_list
22
15
  map_element "app-group", to: :app_group
@@ -1,16 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "section"
6
-
7
3
  module Sts
8
4
  module NisoSts
9
5
  class Body < Lutaml::Model::Serializable
10
- attribute :sec, Section, collection: true
6
+ attribute :sec, ::Sts::NisoSts::Section, collection: true
11
7
 
12
8
  xml do
13
- root "body"
9
+ element "body"
14
10
  map_element "sec", to: :sec
15
11
  end
16
12
  end
@@ -1,9 +1,3 @@
1
- require "lutaml/model"
2
-
3
- require_relative "paragraph"
4
- require_relative "title"
5
- require_relative "non_normative_note"
6
-
7
1
  # rubocop:disable Layout/LineLength
8
2
  # <caption>
9
3
  # <title>Overview of risk assessment/risk reduction</title>
@@ -31,12 +25,14 @@ require_relative "non_normative_note"
31
25
  module Sts
32
26
  module NisoSts
33
27
  class Caption < Lutaml::Model::Serializable
34
- attribute :title, Title
35
- attribute :paragraphs, Paragraph, collection: true
36
- attribute :non_normative_note, NonNormativeNote, collection: true
28
+ attribute :title, ::Sts::NisoSts::Title
29
+ attribute :paragraphs, ::Sts::NisoSts::Paragraph, collection: true
30
+ attribute :non_normative_note, ::Sts::NisoSts::NonNormativeNote,
31
+ collection: true
37
32
 
38
33
  xml do
39
- root "caption", mixed: true
34
+ element "caption"
35
+ mixed_content
40
36
 
41
37
  map_element "p", to: :paragraphs
42
38
  map_element "non-normative-note", to: :non_normative_note
@@ -1,20 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
3
  module Sts
6
4
  module NisoSts
7
5
  class CustomMeta < Lutaml::Model::Serializable
8
- attribute :lang, :string
6
+ attribute :lang, Lutaml::Xml::W3c::XmlLangType
9
7
  attribute :meta_name, :string
10
8
  attribute :meta_value, :string
11
9
 
12
10
  xml do
13
- root "custom-meta"
11
+ element "custom-meta"
14
12
 
15
- map_attribute "lang", to: :lang,
16
- namespace: "http://www.w3.org/XML/1998/namespace",
17
- prefix: "xml"
13
+ map_attribute "lang", to: :lang
18
14
  map_element "meta-name", to: :meta_name
19
15
  map_element "meta-value", to: :meta_value
20
16
  end
@@ -1,16 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "custom_meta"
6
-
7
3
  module Sts
8
4
  module NisoSts
9
5
  class CustomMetaGroup < Lutaml::Model::Serializable
10
- attribute :custom_meta, CustomMeta, collection: true
6
+ attribute :custom_meta, ::Sts::NisoSts::CustomMeta, collection: true
11
7
 
12
8
  xml do
13
- root "custom-meta-group"
9
+ element "custom-meta-group"
14
10
 
15
11
  map_element "custom-meta", to: :custom_meta
16
12
  end
@@ -1,16 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "paragraph"
6
-
7
3
  module Sts
8
4
  module NisoSts
9
5
  class Def < Lutaml::Model::Serializable
10
- attribute :paragraph, Paragraph
6
+ attribute :paragraph, ::Sts::NisoSts::Paragraph
11
7
 
12
8
  xml do
13
- root "def"
9
+ element "def"
14
10
 
15
11
  map_element "p", to: :paragraph
16
12
  end
@@ -1,19 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "def"
6
- require_relative "../tbx_iso_tml/term"
7
-
8
3
  module Sts
9
4
  module NisoSts
10
5
  class DefItem < Lutaml::Model::Serializable
11
6
  attribute :specific_use, :string
12
- attribute :term, TbxIsoTml::Term
13
- attribute :definition, Def
7
+ attribute :term, ::Sts::NisoSts::Term
8
+ attribute :definition, ::Sts::NisoSts::Def
14
9
 
15
10
  xml do
16
- root "def-item"
11
+ element "def-item"
17
12
 
18
13
  map_attribute "specific-use", to: :specific_use
19
14
  map_element "term", to: :term, render_nil: true
@@ -1,20 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "def_item"
6
-
7
3
  module Sts
8
4
  module NisoSts
9
5
  class DefList < Lutaml::Model::Serializable
10
6
  attribute :title, :string
11
7
  attribute :specific_use, :string
12
8
  attribute :list_type, :string
13
- attribute :def_item, DefItem, collection: true
14
- attribute :def_list, DefList
9
+ attribute :def_item, ::Sts::NisoSts::DefItem, collection: true
10
+ attribute :def_list, ::Sts::NisoSts::DefList
15
11
 
16
12
  xml do
17
- root "def-list"
13
+ element "def-list"
18
14
 
19
15
  map_attribute "list-type", to: :list_type
20
16
  map_attribute "specific-use", to: :specific_use
@@ -1,24 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "lutaml/model"
4
- require_relative "../tbx_iso_tml/math"
5
4
 
6
5
  module Sts
7
6
  module NisoSts
8
7
  class DisplayFormula < Lutaml::Model::Serializable
9
8
  attribute :id, :string
10
- attribute :label, Label
11
- attribute :math, TbxIsoTml::Math
9
+ attribute :label, ::Sts::NisoSts::Label
10
+ attribute :math, ::Sts::TbxIsoTml::Math
12
11
 
13
12
  xml do
14
- root "disp-formula"
13
+ element "disp-formula"
15
14
 
16
15
  map_attribute "id", to: :id
17
16
 
18
17
  map_element "label", to: :label
19
- map_element "math", to: :math,
20
- namespace: "http://www.w3.org/1998/Math/MathML",
21
- prefix: "mml"
18
+ map_element "math", to: :math
22
19
  end
23
20
  end
24
21
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
3
  module Sts
6
4
  module NisoSts
7
5
  class DocumentIdentification < Lutaml::Model::Serializable
@@ -12,7 +10,7 @@ module Sts
12
10
  attribute :urn, :string
13
11
 
14
12
  xml do
15
- root "doc-ident"
13
+ element "doc-ident"
16
14
 
17
15
  map_element "sdo", to: :sdo
18
16
  map_element "proj-id", to: :proj_id
@@ -1,23 +1,19 @@
1
1
  # frozen_striing_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
3
  module Sts
6
4
  module NisoSts
7
5
  class ExtLink < Lutaml::Model::Serializable
8
6
  attribute :ext_link_type, :string
9
- attribute :href, :string
7
+ attribute :href, :xlink_href
10
8
  attribute :content, :string
11
9
 
12
10
  xml do
13
- root "ext-link"
11
+ element "ext-link"
14
12
 
15
13
  map_content to: :content
16
14
 
17
15
  map_attribute "ext-link-type", to: :ext_link_type
18
- map_attribute "href", to: :href,
19
- namespace: "http://www.w3.org/1999/xlink",
20
- prefix: "xlink"
16
+ map_attribute "href", to: :href
21
17
  end
22
18
  end
23
19
  end
@@ -1,11 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "caption"
6
- require_relative "graphic"
7
- require_relative "def_list"
8
-
9
3
  # <fig id="fig-1" orientation="portrait">
10
4
  # <label>Figure 1</label>
11
5
  # <caption...>
@@ -14,18 +8,17 @@ require_relative "def_list"
14
8
 
15
9
  module Sts
16
10
  module NisoSts
17
- class Caption < Lutaml::Model::Serializable; end
18
-
19
11
  class Figure < Lutaml::Model::Serializable
20
12
  attribute :id, :string
21
13
  attribute :orientation, :string
22
- attribute :caption, Caption
23
- attribute :def_list, DefList
24
- attribute :label, Label
25
- attribute :graphic, Graphic, collection: true
14
+ attribute :caption, ::Sts::NisoSts::Caption
15
+ attribute :def_list, ::Sts::NisoSts::DefList
16
+ attribute :label, ::Sts::NisoSts::Label
17
+ attribute :graphic, ::Sts::NisoSts::Graphic, collection: true
26
18
 
27
19
  xml do
28
- root "fig", mixed: true
20
+ element "fig"
21
+ mixed_content
29
22
 
30
23
  map_attribute "id", to: :id
31
24
  map_attribute "orientation", to: :orientation
@@ -1,19 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "label"
6
- require_relative "paragraph"
7
-
8
3
  module Sts
9
4
  module NisoSts
10
5
  class Fn < Lutaml::Model::Serializable
11
6
  attribute :id, :string
12
- attribute :label, Label
13
- attribute :paragraph, Paragraph
7
+ attribute :label, ::Sts::NisoSts::Label
8
+ attribute :paragraph, ::Sts::NisoSts::Paragraph
14
9
 
15
10
  xml do
16
- root "fn"
11
+ element "fn"
17
12
 
18
13
  map_attribute "id", to: :id
19
14
 
@@ -1,16 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "fn"
6
-
7
3
  module Sts
8
4
  module NisoSts
9
5
  class FnGroup < Lutaml::Model::Serializable
10
- attribute :fn, Fn, collection: true
6
+ attribute :fn, ::Sts::NisoSts::Fn, collection: true
11
7
 
12
8
  xml do
13
- root "fn-group"
9
+ element "fn-group"
14
10
 
15
11
  map_element "fn", to: :fn
16
12
  end
@@ -1,20 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "metadata_iso"
6
- require_relative "metadata_std"
7
- require_relative "section"
8
-
9
3
  module Sts
10
4
  module NisoSts
11
5
  class Front < Lutaml::Model::Serializable
12
- attribute :iso_meta, MetadataIso
13
- attribute :std_meta, MetadataStd
14
- attribute :sec, Section, collection: true
6
+ attribute :iso_meta, ::Sts::NisoSts::MetadataIso
7
+ attribute :std_meta, ::Sts::NisoSts::MetadataStd
8
+ attribute :sec, ::Sts::NisoSts::Section, collection: true
15
9
 
16
10
  xml do
17
- root "front"
11
+ element "front"
18
12
  map_element "iso-meta", to: :iso_meta
19
13
  map_element "std-meta", to: :std_meta
20
14
  map_element "sec", to: :sec
@@ -1,7 +1,3 @@
1
- require "lutaml/model"
2
-
3
- require_relative "object_id"
4
-
5
1
  # rubocop:disable Layout/LineLength
6
2
  # <graphic xlink:href="e1d18be9.001.gif">
7
3
  # <object-id pub-id-type="fpi">+//ISO 9070/RA::A00007::GE::DIN German Institute for
@@ -13,16 +9,14 @@ require_relative "object_id"
13
9
  module Sts
14
10
  module NisoSts
15
11
  class Graphic < Lutaml::Model::Serializable
16
- attribute :href, :string
17
- attribute :object_id, ObjectId, collection: true
12
+ attribute :href, :xlink_href
13
+ attribute :sts_object_id, ::Sts::NisoSts::ObjectId, collection: true
18
14
 
19
15
  xml do
20
- root "graphic"
16
+ element "graphic"
21
17
 
22
- map_attribute "href", to: :href,
23
- namespace: "http://www.w3.org/1999/xlink",
24
- prefix: "xlink"
25
- map_element "object-id", to: :object_id
18
+ map_attribute "href", to: :href
19
+ map_element "object-id", to: :sts_object_id
26
20
  end
27
21
  end
28
22
  end