sts 0.3.3 → 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 (117) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +7 -1
  3. data/.gitignore +2 -0
  4. data/.rubocop-https---raw-githubusercontent-com-riboseinc-oss-guides-master-ci-rubocop-yml +1 -0
  5. data/.rubocop_todo.yml +12 -15
  6. data/Gemfile +9 -13
  7. data/lib/sts/namespaces.rb +13 -0
  8. data/lib/sts/niso_sts/adoption.rb +9 -13
  9. data/lib/sts/niso_sts/adoption_front.rb +1 -3
  10. data/lib/sts/niso_sts/app.rb +14 -25
  11. data/lib/sts/niso_sts/app_group.rb +1 -5
  12. data/lib/sts/niso_sts/back.rb +5 -12
  13. data/lib/sts/niso_sts/body.rb +2 -6
  14. data/lib/sts/niso_sts/caption.rb +6 -10
  15. data/lib/sts/niso_sts/custom_meta.rb +5 -9
  16. data/lib/sts/niso_sts/custom_meta_group.rb +2 -6
  17. data/lib/sts/niso_sts/def.rb +2 -6
  18. data/lib/sts/niso_sts/def_item.rb +4 -9
  19. data/lib/sts/niso_sts/def_list.rb +6 -10
  20. data/lib/sts/niso_sts/display_formula.rb +5 -8
  21. data/lib/sts/niso_sts/document_identification.rb +6 -8
  22. data/lib/sts/niso_sts/ext_link.rb +5 -9
  23. data/lib/sts/niso_sts/figure.rb +8 -15
  24. data/lib/sts/niso_sts/fn.rb +4 -9
  25. data/lib/sts/niso_sts/fn_group.rb +2 -6
  26. data/lib/sts/niso_sts/front.rb +4 -10
  27. data/lib/sts/niso_sts/graphic.rb +5 -11
  28. data/lib/sts/niso_sts/inline_formula.rb +3 -6
  29. data/lib/sts/niso_sts/label.rb +2 -6
  30. data/lib/sts/niso_sts/list.rb +5 -8
  31. data/lib/sts/niso_sts/list_item.rb +8 -13
  32. data/lib/sts/niso_sts/meta_date.rb +3 -5
  33. data/lib/sts/niso_sts/meta_note.rb +6 -9
  34. data/lib/sts/niso_sts/metadata_iso.rb +20 -30
  35. data/lib/sts/niso_sts/metadata_std.rb +25 -30
  36. data/lib/sts/niso_sts/mixed_citation.rb +8 -12
  37. data/lib/sts/{tbx_iso_tml → niso_sts}/named_content.rb +4 -7
  38. data/lib/sts/niso_sts/non_normative_example.rb +5 -10
  39. data/lib/sts/niso_sts/non_normative_note.rb +6 -9
  40. data/lib/sts/niso_sts/object_id.rb +3 -5
  41. data/lib/sts/niso_sts/page_count.rb +2 -4
  42. data/lib/sts/niso_sts/paragraph.rb +20 -37
  43. data/lib/sts/niso_sts/permissions.rb +4 -6
  44. data/lib/sts/niso_sts/reference.rb +6 -9
  45. data/lib/sts/niso_sts/reference_list.rb +7 -9
  46. data/lib/sts/niso_sts/reference_standard.rb +14 -19
  47. data/lib/sts/niso_sts/section.rb +19 -32
  48. data/lib/sts/niso_sts/section_array.rb +3 -7
  49. data/lib/sts/niso_sts/standard.rb +15 -19
  50. data/lib/sts/niso_sts/standard_identification.rb +13 -14
  51. data/lib/sts/niso_sts/standard_ref.rb +3 -5
  52. data/lib/sts/niso_sts/std_cross_reference.rb +3 -5
  53. data/lib/sts/niso_sts/std_id.rb +5 -7
  54. data/lib/sts/niso_sts/std_id_group.rb +2 -6
  55. data/lib/sts/niso_sts/term.rb +68 -0
  56. data/lib/sts/niso_sts/term_display.rb +4 -8
  57. data/lib/sts/niso_sts/term_section.rb +8 -15
  58. data/lib/sts/niso_sts/title.rb +3 -7
  59. data/lib/sts/niso_sts/title_compl.rb +14 -0
  60. data/lib/sts/niso_sts/title_full.rb +18 -0
  61. data/lib/sts/niso_sts/title_wrap.rb +15 -20
  62. data/lib/sts/niso_sts.rb +56 -18
  63. data/lib/sts/tbx_iso_tml/bold.rb +2 -4
  64. data/lib/sts/tbx_iso_tml/caption.rb +2 -4
  65. data/lib/sts/tbx_iso_tml/col.rb +6 -8
  66. data/lib/sts/tbx_iso_tml/cross_reference.rb +17 -0
  67. data/lib/sts/tbx_iso_tml/definition.rb +16 -24
  68. data/lib/sts/tbx_iso_tml/entailed_term.rb +9 -13
  69. data/lib/sts/tbx_iso_tml/example.rb +8 -12
  70. data/lib/sts/tbx_iso_tml/external_graphic.rb +3 -5
  71. data/lib/sts/tbx_iso_tml/external_source.rb +4 -6
  72. data/lib/sts/tbx_iso_tml/fn.rb +4 -6
  73. data/lib/sts/tbx_iso_tml/fn_group.rb +2 -6
  74. data/lib/sts/tbx_iso_tml/geographical_usage.rb +3 -5
  75. data/lib/sts/tbx_iso_tml/grammatical_gender.rb +3 -5
  76. data/lib/sts/tbx_iso_tml/grammatical_number.rb +3 -5
  77. data/lib/sts/tbx_iso_tml/italic.rb +4 -5
  78. data/lib/sts/tbx_iso_tml/lang_set.rb +16 -30
  79. data/lib/sts/tbx_iso_tml/math.rb +19 -32
  80. data/lib/sts/tbx_iso_tml/mfenced.rb +16 -21
  81. data/lib/sts/tbx_iso_tml/mfrac.rb +9 -12
  82. data/lib/sts/tbx_iso_tml/mi.rb +3 -4
  83. data/lib/sts/tbx_iso_tml/mrow.rb +15 -20
  84. data/lib/sts/tbx_iso_tml/mspace.rb +3 -5
  85. data/lib/sts/tbx_iso_tml/mstyle.rb +9 -9
  86. data/lib/sts/tbx_iso_tml/msub.rb +10 -15
  87. data/lib/sts/tbx_iso_tml/msup.rb +6 -11
  88. data/lib/sts/tbx_iso_tml/munder.rb +3 -7
  89. data/lib/sts/tbx_iso_tml/munderover.rb +6 -9
  90. data/lib/sts/tbx_iso_tml/normative_authorization.rb +3 -5
  91. data/lib/sts/tbx_iso_tml/note.rb +20 -32
  92. data/lib/sts/tbx_iso_tml/part_of_speech.rb +3 -5
  93. data/lib/sts/tbx_iso_tml/pronunciation.rb +16 -0
  94. data/lib/sts/tbx_iso_tml/see.rb +4 -6
  95. data/lib/sts/tbx_iso_tml/semantics.rb +8 -12
  96. data/lib/sts/tbx_iso_tml/source.rb +6 -8
  97. data/lib/sts/tbx_iso_tml/subject_field.rb +17 -0
  98. data/lib/sts/tbx_iso_tml/sup.rb +4 -7
  99. data/lib/sts/tbx_iso_tml/table.rb +8 -14
  100. data/lib/sts/tbx_iso_tml/table_break.rb +0 -2
  101. data/lib/sts/tbx_iso_tml/table_wrap.rb +8 -14
  102. data/lib/sts/tbx_iso_tml/table_wrap_foot.rb +2 -6
  103. data/lib/sts/tbx_iso_tml/tbody.rb +6 -10
  104. data/lib/sts/tbx_iso_tml/td.rb +20 -31
  105. data/lib/sts/tbx_iso_tml/term.rb +18 -34
  106. data/lib/sts/tbx_iso_tml/term_entry.rb +6 -10
  107. data/lib/sts/tbx_iso_tml/term_information_group.rb +13 -22
  108. data/lib/sts/tbx_iso_tml/term_type.rb +3 -5
  109. data/lib/sts/tbx_iso_tml/th.rb +19 -27
  110. data/lib/sts/tbx_iso_tml/thead.rb +6 -10
  111. data/lib/sts/tbx_iso_tml/tr.rb +3 -8
  112. data/lib/sts/tbx_iso_tml/xref.rb +5 -6
  113. data/lib/sts/tbx_iso_tml.rb +52 -25
  114. data/lib/sts/version.rb +1 -1
  115. data/lib/sts.rb +4 -12
  116. data/sts.gemspec +1 -1
  117. metadata +17 -10
@@ -1,35 +1,30 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "lutaml/model"
4
- require_relative "standard_ref"
5
- require_relative "std_id_group"
6
- require_relative "fn"
7
- require_relative "../tbx_iso_tml/xref"
8
4
 
9
5
  module Sts
10
6
  module NisoSts
11
7
  class ReferenceStandard < Lutaml::Model::Serializable
12
- attribute :type, Lutaml::Model::Type::String
13
- attribute :std_id, Lutaml::Model::Type::String
14
- attribute :content, Lutaml::Model::Type::String
15
- attribute :std_ref, StandardRef
16
- attribute :title, Lutaml::Model::Type::String
17
- attribute :fn, Fn, collection: true
18
- attribute :std_id_group, StdIdGroup, collection: true
19
- attribute :xref, Sts::TbxIsoTml::Xref, collection: true
8
+ attribute :type, :string
9
+ attribute :std_id, :string
10
+ attribute :content, :string
11
+ attribute :std_ref, ::Sts::NisoSts::StandardRef
12
+ attribute :title, :string
13
+ attribute :fn, ::Sts::NisoSts::Fn, collection: true
14
+ attribute :std_id_group, ::Sts::NisoSts::StdIdGroup, collection: true
15
+ attribute :xref, ::Sts::TbxIsoTml::Xref, collection: true
20
16
 
21
17
  xml do
22
- root "std", mixed: true
18
+ element "std"
19
+ mixed_content
23
20
 
24
21
  map_attribute "type", to: :type
25
22
  map_attribute "std-id", to: :std_id
26
23
 
27
- map_element "std-ref", to: :std_ref, namespace: nil, prefix: nil
28
- map_element "fn", to: :fn, namespace: nil, prefix: nil
29
- map_element "title", to: :title, namespace: nil, prefix: nil
30
- map_element "std-id-group", to: :std_id_group,
31
- namespace: nil,
32
- prefix: nil
24
+ map_element "std-ref", to: :std_ref
25
+ map_element "fn", to: :fn
26
+ map_element "title", to: :title
27
+ map_element "std-id-group", to: :std_id_group
33
28
  map_element "xref", to: :xref
34
29
 
35
30
  map_content to: :content
@@ -1,44 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "paragraph"
6
- require_relative "list"
7
- require_relative "term_section"
8
- require_relative "reference_list"
9
- require_relative "non_normative_note"
10
- require_relative "non_normative_example"
11
- require_relative "figure"
12
- require_relative "title"
13
- require_relative "section_array"
14
-
15
- require_relative "../tbx_iso_tml/table_wrap"
16
-
17
3
  module Sts
18
4
  module NisoSts
19
- class Title < Lutaml::Model::Serializable; end
20
-
21
5
  class Section < Lutaml::Model::Serializable
22
- attribute :id, Lutaml::Model::Type::String
23
- attribute :specific_use, Lutaml::Model::Type::String
24
- attribute :label, Label
25
- attribute :title, Title
26
- attribute :type, Lutaml::Model::Type::String
27
- attribute :array, SectionArray
28
- attribute :paragraphs, Paragraph, collection: true
29
- attribute :list, List, collection: true
30
- attribute :term_sec, TermSection, collection: true
31
- attribute :ref_list, ReferenceList, collection: true
32
- attribute :non_normative_note, NonNormativeNote, collection: true
33
- attribute :non_normative_example, NonNormativeExample, collection: true
34
- attribute :sec, Section, collection: true
35
- attribute :figures, Figure, collection: true
36
- attribute :fig, Figure, collection: true
6
+ attribute :id, :string
7
+ attribute :specific_use, :string
8
+ attribute :label, ::Sts::NisoSts::Label
9
+ attribute :title, ::Sts::NisoSts::Title
10
+ attribute :type, :string
11
+ attribute :array, ::Sts::NisoSts::SectionArray
12
+ attribute :paragraphs, ::Sts::NisoSts::Paragraph, collection: true
13
+ attribute :list, ::Sts::NisoSts::List, collection: true
14
+ attribute :term_sec, ::Sts::NisoSts::TermSection, collection: true
15
+ attribute :ref_list, ::Sts::NisoSts::ReferenceList, collection: true
16
+ attribute :non_normative_note, ::Sts::NisoSts::NonNormativeNote,
17
+ collection: true
18
+ attribute :non_normative_example, ::Sts::NisoSts::NonNormativeExample,
19
+ collection: true
20
+ attribute :sec, ::Sts::NisoSts::Section, collection: true
21
+ attribute :figures, ::Sts::NisoSts::Figure, collection: true
22
+ attribute :fig, ::Sts::NisoSts::Figure, collection: true
37
23
 
38
24
  attribute :table_wrap, ::Sts::TbxIsoTml::TableWrap, collection: true
39
25
 
40
26
  xml do
41
- root "sec", mixed: true
27
+ element "sec"
28
+ mixed_content
42
29
 
43
30
  map_attribute "id", to: :id
44
31
  map_attribute "sec-type", to: :type
@@ -1,17 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "../tbx_iso_tml/table"
6
-
7
3
  module Sts
8
4
  module NisoSts
9
5
  class SectionArray < Lutaml::Model::Serializable
10
- attribute :id, Lutaml::Model::Type::String
11
- attribute :table, Sts::TbxIsoTml::Table
6
+ attribute :id, :string
7
+ attribute :table, ::Sts::TbxIsoTml::Table
12
8
 
13
9
  xml do
14
- root "array"
10
+ element "array"
15
11
 
16
12
  map_attribute "id", to: :id
17
13
  map_element "table", to: :table
@@ -1,31 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "front"
4
- require_relative "body"
5
- require_relative "back"
6
-
7
3
  module Sts
8
4
  module NisoSts
9
5
  class Standard < Lutaml::Model::Serializable
10
- attribute :front, Front
11
- attribute :body, Body
12
- attribute :back, Back
13
- attribute :id, Lutaml::Model::Type::String
14
- attribute :lang, Lutaml::Model::Type::String
15
- attribute :mml, Lutaml::Model::Type::String
16
- attribute :tbx, Lutaml::Model::Type::String
17
- attribute :xlink, Lutaml::Model::Type::String
6
+ attribute :front, ::Sts::NisoSts::Front
7
+ attribute :body, ::Sts::NisoSts::Body
8
+ attribute :back, ::Sts::NisoSts::Back
9
+ attribute :id, :string
10
+ attribute :lang, Lutaml::Xml::W3c::XmlLangType
11
+ attribute :mml, :string
12
+ attribute :tbx, :string
13
+ attribute :xlink, :string
18
14
 
19
15
  xml do
20
- root "standard"
21
- # namespace "urn:iso:std:iso:30042:ed-1", "tbx"
22
- # namespace "http://www.w3.org/1998/Math/MathML", "mml"
23
- # namespace "http://www.w3.org/1999/xlink", "xlink"
16
+ element "standard"
17
+ namespace_scope [
18
+ ::Sts::Namespaces::MathmlNamespace,
19
+ ::Sts::Namespaces::TbxNamespace,
20
+ ::Lutaml::Xml::W3c::XlinkNamespace,
21
+ ]
24
22
 
25
23
  map_attribute "id", to: :id
26
- map_attribute "lang", to: :lang,
27
- namespace: "http://www.w3.org/XML/1998/namespace",
28
- prefix: "xml"
24
+ map_attribute "lang", to: :lang
29
25
  map_element "front", to: :front
30
26
  map_element "body", to: :body
31
27
  map_element "back", to: :back
@@ -1,28 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "std_id_group"
6
-
7
3
  module Sts
8
4
  module NisoSts
9
5
  class StandardIdentification < Lutaml::Model::Serializable
10
- attribute :originator, Lutaml::Model::Type::String
11
- attribute :doc_type, Lutaml::Model::Type::String
12
- attribute :doc_number, Lutaml::Model::Type::String
13
- attribute :edition, Lutaml::Model::Type::String
14
- attribute :version, Lutaml::Model::Type::String
15
- attribute :part_number, Lutaml::Model::Type::String
16
- attribute :std_id_group, StdIdGroup
6
+ attribute :originator, :string
7
+ attribute :doc_type, :string
8
+ attribute :doc_number, :string
9
+ attribute :edition, :string
10
+ attribute :version, :string
11
+ attribute :part_number, :string
12
+ attribute :std_id_group, ::Sts::NisoSts::StdIdGroup
17
13
 
18
14
  xml do
19
- root "std-ident", mixed: true
15
+ element "std-ident"
16
+ mixed_content
20
17
 
21
18
  map_element "originator", to: :originator
22
19
  map_element "doc-type", to: :doc_type
23
20
  map_element "doc-number", to: :doc_number
24
- map_element "edition", to: :edition, render_nil: true
25
- map_element "version", to: :version, render_nil: true
21
+ map_element "edition", to: :edition,
22
+ value_map: { to: { empty: :empty } }
23
+ map_element "version", to: :version,
24
+ value_map: { to: { empty: :empty } }
26
25
  map_element "part-number", to: :part_number
27
26
  map_element "std-id-group", to: :std_id_group
28
27
  end
@@ -1,15 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
3
  module Sts
6
4
  module NisoSts
7
5
  class StandardRef < Lutaml::Model::Serializable
8
- attribute :type, Lutaml::Model::Type::String
9
- attribute :value, Lutaml::Model::Type::String
6
+ attribute :type, :string
7
+ attribute :value, :string
10
8
 
11
9
  xml do
12
- root "std-ref"
10
+ element "std-ref"
13
11
  map_attribute "type", to: :type
14
12
  map_content to: :value
15
13
  end
@@ -1,15 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
3
  module Sts
6
4
  module NisoSts
7
5
  class StdCrossReference < Lutaml::Model::Serializable
8
- attribute :type, Lutaml::Model::Type::String
9
- attribute :std_ref, StandardRef, collection: true
6
+ attribute :type, :string
7
+ attribute :std_ref, ::Sts::NisoSts::StandardRef, collection: true
10
8
 
11
9
  xml do
12
- root "std-xref"
10
+ element "std-xref"
13
11
 
14
12
  map_attribute "type", to: :type
15
13
  map_element "std-ref", to: :std_ref
@@ -1,17 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
3
  module Sts
6
4
  module NisoSts
7
5
  class StdId < Lutaml::Model::Serializable
8
- attribute :std_id_link_type, Lutaml::Model::Type::String
9
- attribute :std_id_type, Lutaml::Model::Type::String
10
- attribute :specific_use, Lutaml::Model::Type::String
11
- attribute :content, Lutaml::Model::Type::String
6
+ attribute :std_id_link_type, :string
7
+ attribute :std_id_type, :string
8
+ attribute :specific_use, :string
9
+ attribute :content, :string
12
10
 
13
11
  xml do
14
- root "std-id"
12
+ element "std-id"
15
13
 
16
14
  map_attribute "std-id-link-type", to: :std_id_link_type
17
15
  map_attribute "std-id-type", to: :std_id_type
@@ -1,16 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "std_id"
6
-
7
3
  module Sts
8
4
  module NisoSts
9
5
  class StdIdGroup < Lutaml::Model::Serializable
10
- attribute :std_id, StdId, collection: true
6
+ attribute :std_id, ::Sts::NisoSts::StdId, collection: true
11
7
 
12
8
  xml do
13
- root "std-id-group"
9
+ element "std-id-group"
14
10
 
15
11
  map_element "std-id", to: :std_id
16
12
  end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sts
4
+ module NisoSts
5
+ class Term < Lutaml::Model::Serializable
6
+ attribute :id, :string
7
+ attribute :rid, :string
8
+ attribute :text, :string
9
+ attribute :italic, :string, collection: true
10
+ attribute :bold, :string, collection: true
11
+ attribute :uri, :string
12
+ attribute :list, ::Sts::NisoSts::List
13
+ attribute :def_list, ::Sts::NisoSts::DefList
14
+ attribute :non_normative_note, ::Sts::NisoSts::NonNormativeNote
15
+ attribute :non_normative_example, ::Sts::NisoSts::NonNormativeExample
16
+ attribute :inline_formula, ::Sts::NisoSts::InlineFormula, collection: true
17
+ attribute :disp_formula, ::Sts::NisoSts::DisplayFormula, collection: true
18
+ attribute :xref, ::Sts::TbxIsoTml::Xref, collection: true
19
+ attribute :std, ::Sts::NisoSts::ReferenceStandard, collection: true
20
+ attribute :ext_link, ::Sts::NisoSts::ExtLink
21
+ attribute :entailed_term, ::Sts::TbxIsoTml::EntailedTerm
22
+ attribute :specific_use, :string,
23
+ values: ["abbreviation", "acronym", "equation", "formula", "fullForm", "symbol", "variant"]
24
+ attribute :term_status, :string,
25
+ values: ["admitted", "non-preferred", "preferred"], collection: true
26
+ attribute :term_type, :string,
27
+ values: ["abbreviation", "acronym", "equation", "formula", "fullForm", "symbol", "variant"]
28
+ attribute :vocab, :string
29
+ attribute :vocab_identifier, :string
30
+ attribute :vocab_term, :string
31
+ attribute :vocab_term_identifier, :string
32
+ # attribute :lang, :string
33
+ attribute :named_content, ::Sts::NisoSts::NamedContent, collection: true
34
+
35
+ xml do
36
+ element "term"
37
+ mixed_content
38
+
39
+ map_attribute "id", to: :id
40
+ map_attribute "rid", to: :rid
41
+ map_attribute "specific-use", to: :specific_use
42
+ map_attribute "term-status", to: :term_status
43
+ map_attribute "term-type", to: :term_type
44
+ map_attribute "vocab", to: :vocab
45
+ map_attribute "vocab-identifier", to: :vocab_identifier
46
+ map_attribute "vocab-term", to: :vocab_term
47
+ map_attribute "vocab-term-identifier", to: :vocab_term_identifier
48
+ # map_attribute "xml:lang", to: :lang
49
+
50
+ map_content to: :text
51
+ map_element "bold", to: :bold
52
+ map_element "italic", to: :italic
53
+ map_element "list", to: :list
54
+ map_element "def-list", to: :def_list
55
+ map_element "named-content", to: :named_content
56
+ map_element "non-normative-note", to: :non_normative_note
57
+ map_element "non-normative-example", to: :non_normative_example
58
+ map_element "inline-formula", to: :inline_formula
59
+ map_element "disp-formula", to: :disp_formula
60
+ map_element "ext-link", to: :ext_link
61
+ map_element "entailedTerm", to: :entailed_term
62
+ map_element "uri", to: :uri
63
+ map_element "std", to: :std
64
+ map_element "xref", to: :xref
65
+ end
66
+ end
67
+ end
68
+ end
@@ -1,18 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "paragraph"
6
- require_relative "non_normative_note"
7
-
8
3
  module Sts
9
4
  module NisoSts
10
5
  class TermDisplay < Lutaml::Model::Serializable
11
- attribute :p, Paragraph, collection: true
12
- attribute :non_normative_note, NonNormativeNote, collection: true
6
+ attribute :p, ::Sts::NisoSts::Paragraph, collection: true
7
+ attribute :non_normative_note, ::Sts::NisoSts::NonNormativeNote,
8
+ collection: true
13
9
 
14
10
  xml do
15
- root "term-display"
11
+ element "term-display"
16
12
 
17
13
  map_element "p", to: :p
18
14
  map_element "non-normative-note", to: :non_normative_note
@@ -1,30 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "../tbx_iso_tml"
6
- require_relative "term_display"
7
- require_relative "../tbx_iso_tml/term_entry"
8
-
9
3
  module Sts
10
4
  module NisoSts
11
5
  class TermSection < Lutaml::Model::Serializable
12
- attribute :id, Lutaml::Model::Type::String
13
- attribute :sec_type, Lutaml::Model::Type::String
14
- attribute :label, Label
15
- attribute :term_entry, Sts::TbxIsoTml::TermEntry # , collection: true
16
- attribute :term_display, TermDisplay # , collection: true
6
+ attribute :id, :string
7
+ attribute :sec_type, :string
8
+ attribute :label, ::Sts::NisoSts::Label
9
+ attribute :term_entry, ::Sts::TbxIsoTml::TermEntry # , collection: true
10
+ attribute :term_display, ::Sts::NisoSts::TermDisplay # , collection: true
17
11
 
18
12
  xml do
19
- root "term-sec", mixed: true
13
+ element "term-sec"
14
+ mixed_content
20
15
  map_attribute "id", to: :id
21
16
  map_attribute "sec-type", to: :sec_type
22
17
 
23
18
  map_element "label", to: :label
24
19
  map_element "term-display", to: :term_display
25
- map_element "termEntry", to: :term_entry,
26
- namespace: "urn:iso:std:iso:30042:ed-1",
27
- prefix: "tbx"
20
+ map_element "termEntry", to: :term_entry
28
21
  end
29
22
  end
30
23
  end
@@ -1,18 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "section"
6
- require_relative "inline_formula"
7
-
8
3
  module Sts
9
4
  module NisoSts
10
5
  class Title < Lutaml::Model::Serializable
11
- attribute :content, Lutaml::Model::Type::String
6
+ attribute :content, :string
12
7
  attribute :inline_formula, Sts::NisoSts::InlineFormula, collection: true
13
8
 
14
9
  xml do
15
- root "title", mixed: true
10
+ element "title"
11
+ mixed_content
16
12
 
17
13
  map_content to: :content
18
14
  map_element "inline-formula", to: :inline_formula
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sts
4
+ module NisoSts
5
+ class TitleCompl < TitleFull
6
+ xml do
7
+ element "compl"
8
+
9
+ map_content to: :content
10
+ map_element "std", to: :std
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sts
4
+ module NisoSts
5
+ class TitleFull < Lutaml::Model::Serializable
6
+ attribute :content, :string
7
+ attribute :std, ::Sts::NisoSts::ReferenceStandard
8
+
9
+ xml do
10
+ element "full"
11
+ mixed_content
12
+
13
+ map_content to: :content
14
+ map_element "std", to: :std
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,45 +1,40 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
- require_relative "reference_list"
6
- require_relative "reference_standard"
7
-
8
3
  module Sts
9
4
  module NisoSts
10
5
  class TitleFull < Lutaml::Model::Serializable
11
- attribute :content, Lutaml::Model::Type::String
12
- attribute :std, ReferenceStandard
6
+ attribute :content, :string
7
+ attribute :std, ::Sts::NisoSts::ReferenceStandard
13
8
 
14
9
  xml do
15
- root "full", mixed: true
10
+ element "full"
11
+ mixed_content
16
12
 
17
13
  map_content to: :content
18
- map_element "std", to: :std, namespace: nil, prefix: nil
14
+ map_element "std", to: :std
19
15
  end
20
16
  end
21
17
 
22
18
  class TitleCompl < TitleFull
23
19
  xml do
24
- root "compl"
20
+ element "compl"
25
21
 
26
22
  map_content to: :content
27
- map_element "std", to: :std, namespace: nil, prefix: nil
23
+ map_element "std", to: :std
28
24
  end
29
25
  end
30
26
 
31
27
  class TitleWrap < Lutaml::Model::Serializable
32
- attribute :intro, Lutaml::Model::Type::String
33
- attribute :main, Lutaml::Model::Type::String
34
- attribute :full, TitleFull
35
- attribute :compl, TitleCompl
36
- attribute :lang, Lutaml::Model::Type::String
28
+ attribute :intro, :string
29
+ attribute :main, :string
30
+ attribute :full, ::Sts::NisoSts::TitleFull
31
+ attribute :compl, ::Sts::NisoSts::TitleCompl
32
+ attribute :lang, Lutaml::Xml::W3c::XmlLangType
37
33
 
38
34
  xml do
39
- root "title-wrap", mixed: true
40
- map_attribute "lang", to: :lang,
41
- namespace: "http://www.w3.org/XML/1998/namespace",
42
- prefix: "xml"
35
+ element "title-wrap"
36
+ mixed_content
37
+ map_attribute "lang", to: :lang
43
38
 
44
39
  map_element "intro", to: :intro
45
40
  map_element "main", to: :main
data/lib/sts/niso_sts.rb CHANGED
@@ -2,23 +2,61 @@
2
2
 
3
3
  module Sts
4
4
  module NisoSts
5
+ autoload :Adoption, "#{__dir__}/niso_sts/adoption"
6
+ autoload :AdoptionFront, "#{__dir__}/niso_sts/adoption_front"
7
+ autoload :App, "#{__dir__}/niso_sts/app"
8
+ autoload :AppGroup, "#{__dir__}/niso_sts/app_group"
9
+ autoload :Back, "#{__dir__}/niso_sts/back"
10
+ autoload :Body, "#{__dir__}/niso_sts/body"
11
+ autoload :Caption, "#{__dir__}/niso_sts/caption"
12
+ autoload :CustomMeta, "#{__dir__}/niso_sts/custom_meta"
13
+ autoload :CustomMetaGroup, "#{__dir__}/niso_sts/custom_meta_group"
14
+ autoload :Def, "#{__dir__}/niso_sts/def"
15
+ autoload :DefItem, "#{__dir__}/niso_sts/def_item"
16
+ autoload :DefList, "#{__dir__}/niso_sts/def_list"
17
+ autoload :DisplayFormula, "#{__dir__}/niso_sts/display_formula"
18
+ autoload :DocumentIdentification,
19
+ "#{__dir__}/niso_sts/document_identification"
20
+ autoload :ExtLink, "#{__dir__}/niso_sts/ext_link"
21
+ autoload :Figure, "#{__dir__}/niso_sts/figure"
22
+ autoload :Fn, "#{__dir__}/niso_sts/fn"
23
+ autoload :FnGroup, "#{__dir__}/niso_sts/fn_group"
24
+ autoload :Front, "#{__dir__}/niso_sts/front"
25
+ autoload :Graphic, "#{__dir__}/niso_sts/graphic"
26
+ autoload :InlineFormula, "#{__dir__}/niso_sts/inline_formula"
27
+ autoload :Label, "#{__dir__}/niso_sts/label"
28
+ autoload :List, "#{__dir__}/niso_sts/list"
29
+ autoload :ListItem, "#{__dir__}/niso_sts/list_item"
30
+ autoload :MetadataIso, "#{__dir__}/niso_sts/metadata_iso"
31
+ autoload :MetadataStd, "#{__dir__}/niso_sts/metadata_std"
32
+ autoload :MetaDate, "#{__dir__}/niso_sts/meta_date"
33
+ autoload :MetaNote, "#{__dir__}/niso_sts/meta_note"
34
+ autoload :MixedCitation, "#{__dir__}/niso_sts/mixed_citation"
35
+ autoload :NamedContent, "#{__dir__}/niso_sts/named_content"
36
+ autoload :NonNormativeExample, "#{__dir__}/niso_sts/non_normative_example"
37
+ autoload :NonNormativeNote, "#{__dir__}/niso_sts/non_normative_note"
38
+ autoload :ObjectId, "#{__dir__}/niso_sts/object_id"
39
+ autoload :PageCount, "#{__dir__}/niso_sts/page_count"
40
+ autoload :Paragraph, "#{__dir__}/niso_sts/paragraph"
41
+ autoload :Permissions, "#{__dir__}/niso_sts/permissions"
42
+ autoload :Reference, "#{__dir__}/niso_sts/reference"
43
+ autoload :ReferenceList, "#{__dir__}/niso_sts/reference_list"
44
+ autoload :ReferenceStandard, "#{__dir__}/niso_sts/reference_standard"
45
+ autoload :Section, "#{__dir__}/niso_sts/section"
46
+ autoload :SectionArray, "#{__dir__}/niso_sts/section_array"
47
+ autoload :Standard, "#{__dir__}/niso_sts/standard"
48
+ autoload :StandardIdentification,
49
+ "#{__dir__}/niso_sts/standard_identification"
50
+ autoload :StandardRef, "#{__dir__}/niso_sts/standard_ref"
51
+ autoload :StdCrossReference, "#{__dir__}/niso_sts/std_cross_reference"
52
+ autoload :StdId, "#{__dir__}/niso_sts/std_id"
53
+ autoload :StdIdGroup, "#{__dir__}/niso_sts/std_id_group"
54
+ autoload :Term, "#{__dir__}/niso_sts/term"
55
+ autoload :TermDisplay, "#{__dir__}/niso_sts/term_display"
56
+ autoload :TermSection, "#{__dir__}/niso_sts/term_section"
57
+ autoload :Title, "#{__dir__}/niso_sts/title"
58
+ autoload :TitleCompl, "#{__dir__}/niso_sts/title_compl"
59
+ autoload :TitleFull, "#{__dir__}/niso_sts/title_full"
60
+ autoload :TitleWrap, "#{__dir__}/niso_sts/title_wrap"
5
61
  end
6
62
  end
7
-
8
- require_relative "niso_sts/back"
9
- require_relative "niso_sts/body"
10
- require_relative "niso_sts/front"
11
- require_relative "niso_sts/list"
12
- require_relative "niso_sts/metadata_iso"
13
- require_relative "niso_sts/non_normative_note"
14
- require_relative "niso_sts/list_item"
15
- require_relative "niso_sts/paragraph"
16
- require_relative "niso_sts/reference"
17
- require_relative "niso_sts/reference_list"
18
- require_relative "niso_sts/reference_standard"
19
- require_relative "niso_sts/section"
20
- require_relative "niso_sts/standard"
21
- require_relative "niso_sts/adoption"
22
- require_relative "niso_sts/adoption_front"
23
- require_relative "niso_sts/term_display"
24
- require_relative "niso_sts/term_section"
@@ -1,14 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "lutaml/model"
4
-
5
3
  module Sts
6
4
  module TbxIsoTml
7
5
  class Bold < Lutaml::Model::Serializable
8
- attribute :value, Lutaml::Model::Type::String
6
+ attribute :value, :string
9
7
 
10
8
  xml do
11
- root "bold"
9
+ element "bold"
12
10
  namespace nil, nil
13
11
 
14
12
  map_content to: :value