sts 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +1 -1
  3. data/.rubocop.yml +12 -0
  4. data/Gemfile +6 -0
  5. data/lib/sts/mapper.rb +442 -0
  6. data/lib/sts/niso_sts/adoption.rb +30 -0
  7. data/lib/sts/niso_sts/adoption_front.rb +16 -0
  8. data/lib/sts/niso_sts/app.rb +49 -0
  9. data/lib/sts/niso_sts/app_group.rb +19 -0
  10. data/lib/sts/niso_sts/back.rb +12 -2
  11. data/lib/sts/niso_sts/body.rb +2 -2
  12. data/lib/sts/niso_sts/caption.rb +47 -0
  13. data/lib/sts/niso_sts/custom_meta.rb +23 -0
  14. data/lib/sts/niso_sts/custom_meta_group.rb +18 -0
  15. data/lib/sts/niso_sts/def.rb +19 -0
  16. data/lib/sts/niso_sts/def_item.rb +24 -0
  17. data/lib/sts/niso_sts/def_list.rb +28 -0
  18. data/lib/sts/niso_sts/display_formula.rb +27 -0
  19. data/lib/sts/niso_sts/document_identification.rb +7 -7
  20. data/lib/sts/niso_sts/ext_link.rb +20 -0
  21. data/lib/sts/niso_sts/figure.rb +40 -0
  22. data/lib/sts/niso_sts/fn.rb +24 -0
  23. data/lib/sts/niso_sts/fn_group.rb +19 -0
  24. data/lib/sts/niso_sts/front.rb +8 -2
  25. data/lib/sts/niso_sts/graphic.rb +29 -0
  26. data/lib/sts/niso_sts/inline_formula.rb +22 -0
  27. data/lib/sts/niso_sts/list.rb +9 -1
  28. data/lib/sts/niso_sts/list_item.rb +25 -0
  29. data/lib/sts/niso_sts/meta_note.rb +24 -0
  30. data/lib/sts/niso_sts/metadata_iso.rb +2 -2
  31. data/lib/sts/niso_sts/metadata_std.rb +59 -0
  32. data/lib/sts/niso_sts/mixed_citation.rb +27 -0
  33. data/lib/sts/niso_sts/non_normative_example.rb +22 -0
  34. data/lib/sts/niso_sts/non_normative_note.rb +8 -2
  35. data/lib/sts/niso_sts/object_id.rb +23 -0
  36. data/lib/sts/niso_sts/page_count.rb +2 -2
  37. data/lib/sts/niso_sts/paragraph.rb +36 -2
  38. data/lib/sts/niso_sts/permissions.rb +20 -0
  39. data/lib/sts/niso_sts/reference.rb +4 -1
  40. data/lib/sts/niso_sts/reference_list.rb +6 -1
  41. data/lib/sts/niso_sts/reference_standard.rb +17 -6
  42. data/lib/sts/niso_sts/section.rb +37 -9
  43. data/lib/sts/niso_sts/standard.rb +14 -1
  44. data/lib/sts/niso_sts/standard_identification.rb +13 -7
  45. data/lib/sts/niso_sts/standard_ref.rb +2 -2
  46. data/lib/sts/niso_sts/std_cross_reference.rb +18 -0
  47. data/lib/sts/niso_sts/std_id.rb +24 -0
  48. data/lib/sts/niso_sts/std_id_group.rb +19 -0
  49. data/lib/sts/niso_sts/term_display.rb +2 -2
  50. data/lib/sts/niso_sts/term_section.rb +10 -3
  51. data/lib/sts/niso_sts/title.rb +22 -0
  52. data/lib/sts/niso_sts/title_wrap.rb +27 -3
  53. data/lib/sts/niso_sts.rb +3 -0
  54. data/lib/sts/tbx_iso_tml/bold.rb +18 -0
  55. data/lib/sts/tbx_iso_tml/caption.rb +17 -0
  56. data/lib/sts/tbx_iso_tml/col.rb +23 -0
  57. data/lib/sts/tbx_iso_tml/definition.rb +24 -1
  58. data/lib/sts/tbx_iso_tml/entailed_term.rb +26 -0
  59. data/lib/sts/tbx_iso_tml/example.rb +16 -1
  60. data/lib/sts/tbx_iso_tml/external_graphic.rb +2 -2
  61. data/lib/sts/tbx_iso_tml/external_source.rb +2 -2
  62. data/lib/sts/tbx_iso_tml/fn.rb +23 -0
  63. data/lib/sts/tbx_iso_tml/fn_group.rb +19 -0
  64. data/lib/sts/tbx_iso_tml/geographical_usage.rb +2 -2
  65. data/lib/sts/tbx_iso_tml/grammatical_gender.rb +2 -2
  66. data/lib/sts/tbx_iso_tml/grammatical_number.rb +2 -2
  67. data/lib/sts/tbx_iso_tml/italic.rb +20 -0
  68. data/lib/sts/tbx_iso_tml/lang_set.rb +11 -7
  69. data/lib/sts/tbx_iso_tml/math.rb +62 -0
  70. data/lib/sts/tbx_iso_tml/mfenced.rb +43 -0
  71. data/lib/sts/tbx_iso_tml/mfrac.rb +33 -0
  72. data/lib/sts/tbx_iso_tml/mi.rb +19 -0
  73. data/lib/sts/tbx_iso_tml/mrow.rb +46 -0
  74. data/lib/sts/tbx_iso_tml/mspace.rb +18 -0
  75. data/lib/sts/tbx_iso_tml/mstyle.rb +29 -0
  76. data/lib/sts/tbx_iso_tml/msub.rb +34 -0
  77. data/lib/sts/tbx_iso_tml/msup.rb +27 -0
  78. data/lib/sts/tbx_iso_tml/munder.rb +20 -0
  79. data/lib/sts/tbx_iso_tml/munderover.rb +24 -0
  80. data/lib/sts/tbx_iso_tml/named_content.rb +20 -0
  81. data/lib/sts/tbx_iso_tml/normative_authorization.rb +2 -2
  82. data/lib/sts/tbx_iso_tml/note.rb +31 -2
  83. data/lib/sts/tbx_iso_tml/part_of_speech.rb +2 -2
  84. data/lib/sts/tbx_iso_tml/see.rb +2 -2
  85. data/lib/sts/tbx_iso_tml/semantics.rb +29 -0
  86. data/lib/sts/tbx_iso_tml/source.rb +6 -1
  87. data/lib/sts/tbx_iso_tml/sup.rb +24 -0
  88. data/lib/sts/tbx_iso_tml/table.rb +32 -0
  89. data/lib/sts/tbx_iso_tml/table_wrap.rb +33 -0
  90. data/lib/sts/tbx_iso_tml/table_wrap_foot.rb +19 -0
  91. data/lib/sts/tbx_iso_tml/tbody.rb +26 -0
  92. data/lib/sts/tbx_iso_tml/td.rb +60 -0
  93. data/lib/sts/tbx_iso_tml/term.rb +31 -2
  94. data/lib/sts/tbx_iso_tml/term_entry.rb +2 -3
  95. data/lib/sts/tbx_iso_tml/term_information_group.rb +5 -2
  96. data/lib/sts/tbx_iso_tml/term_type.rb +2 -2
  97. data/lib/sts/tbx_iso_tml/th.rb +50 -0
  98. data/lib/sts/tbx_iso_tml/thead.rb +26 -0
  99. data/lib/sts/tbx_iso_tml/tr.rb +22 -0
  100. data/lib/sts/tbx_iso_tml/xref.rb +26 -0
  101. data/lib/sts/tbx_iso_tml.rb +8 -0
  102. data/lib/sts/version.rb +1 -1
  103. data/lib/sts.rb +1 -0
  104. data/sts.gemspec +2 -8
  105. metadata +67 -63
@@ -2,16 +2,31 @@
2
2
 
3
3
  require "shale"
4
4
 
5
+ require_relative "../mapper"
6
+ require_relative "entailed_term"
7
+
8
+ require_relative "../niso_sts/inline_formula"
9
+
5
10
  module Sts
6
11
  module TbxIsoTml
7
- class Example < Shale::Mapper
12
+ class Example < Sts::Mapper
13
+ attribute :id, Shale::Type::String
8
14
  attribute :value, Shale::Type::String
15
+ attribute :entailed_term, EntailedTerm
16
+ attribute :inline_formula, Sts::NisoSts::InlineFormula
9
17
 
10
18
  xml do
11
19
  root "example"
12
20
  namespace "urn:iso:std:iso:30042:ed-1", "tbx"
13
21
 
14
22
  map_content to: :value
23
+
24
+ map_attribute "id", to: :id
25
+
26
+ map_element "entailedTerm", to: :entailed_term
27
+ map_element "inline-formula", to: :inline_formula,
28
+ namespace: nil,
29
+ prefix: nil
15
30
  end
16
31
  end
17
32
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  module Sts
6
6
  module TbxIsoTml
7
- class ExternalGraphic < Shale::Mapper
7
+ class ExternalGraphic < Sts::Mapper
8
8
  attribute :target, Shale::Type::String
9
9
 
10
10
  xml do
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  module Sts
6
6
  module TbxIsoTml
7
- class ExternalSource < Shale::Mapper
7
+ class ExternalSource < Sts::Mapper
8
8
  attribute :target, Shale::Type::String
9
9
  attribute :value, Shale::Type::String
10
10
 
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "../niso_sts/paragraph"
6
+
7
+ module Sts
8
+ module TbxIsoTml
9
+ class Fn < Sts::Mapper
10
+ attribute :id, Shale::Type::String
11
+ attribute :label, Shale::Type::String
12
+ attribute :p, Sts::NisoSts::Paragraph
13
+
14
+ xml do
15
+ root "fn"
16
+
17
+ map_attribute "id", to: :id
18
+ map_element "label", to: :label
19
+ map_element "p", to: :p
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "fn"
6
+
7
+ module Sts
8
+ module TbxIsoTml
9
+ class FnGroup < Sts::Mapper
10
+ attribute :fn, Sts::TbxIsoTml::Fn, collection: true
11
+
12
+ xml do
13
+ root "fn-group"
14
+
15
+ map_element "fn", to: :fn
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  module Sts
6
6
  module TbxIsoTml
7
- class GeographicalUsage < Shale::Mapper
7
+ class GeographicalUsage < Sts::Mapper
8
8
  attribute :value, Shale::Type::String
9
9
 
10
10
  xml do
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  module Sts
6
6
  module TbxIsoTml
7
- class GrammaticalGender < Shale::Mapper
7
+ class GrammaticalGender < Sts::Mapper
8
8
  # TODO: can be masculine, feminine, singular
9
9
  attribute :value, Shale::Type::String
10
10
 
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  module Sts
6
6
  module TbxIsoTml
7
- class GrammaticalNumber < Shale::Mapper
7
+ class GrammaticalNumber < Sts::Mapper
8
8
  # TODO: can be singular | plural
9
9
  attribute :value, Shale::Type::String
10
10
 
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module TbxIsoTml
7
+ class Italic < Sts::Mapper
8
+ attribute :value, Shale::Type::String
9
+ attribute :sub, Shale::Type::String
10
+
11
+ xml do
12
+ root "italic"
13
+ namespace nil, nil
14
+
15
+ map_content to: :value
16
+ map_element "sub", to: :sub
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  require_relative "note"
6
6
  require_relative "example"
@@ -12,11 +12,15 @@ require_relative "term_information_group"
12
12
 
13
13
  module Sts
14
14
  module TbxIsoTml
15
- class LangSet < Shale::Mapper
15
+ class Definition < Sts::Mapper; end
16
+ class Note < Sts::Mapper; end
17
+ class Caption < Sts::Mapper; end
18
+
19
+ class LangSet < Sts::Mapper
16
20
  attribute :lang, Shale::Type::String
21
+ attribute :definition, Sts::TbxIsoTml::Definition, collection: true
17
22
  attribute :note, Note, collection: true
18
23
  attribute :example, Example, collection: true
19
- attribute :definition, Definition
20
24
  attribute :tig, TermInformationGroup, collection: true
21
25
  attribute :see, See, collection: true
22
26
  attribute :source, Source, collection: true
@@ -32,12 +36,12 @@ module Sts
32
36
  map_attribute "lang", to: :lang,
33
37
  namespace: "http://www.w3.org/XML/1998/namespace",
34
38
  prefix: "xml"
35
- map_element "note", to: :note
36
- map_element "example", to: :example
37
39
  map_element "definition", to: :definition
38
- map_element "tig", to: :tig
39
- map_element "see", to: :see
40
40
  map_element "source", to: :source
41
+ map_element "example", to: :example
42
+ map_element "see", to: :see
43
+ map_element "note", to: :note
44
+ map_element "tig", to: :tig
41
45
  map_element "xSource", to: :x_source
42
46
  map_element "crossReference", to: :cross_reference
43
47
  map_element "subjectField", to: :subject_field
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "semantics"
6
+ require_relative "mrow"
7
+ require_relative "msub"
8
+ require_relative "msup"
9
+ require_relative "mstyle"
10
+ require_relative "mspace"
11
+ require_relative "mfrac"
12
+ require_relative "mfenced"
13
+ require_relative "munderover"
14
+
15
+ module Sts
16
+ module TbxIsoTml
17
+ class Mfenced < Sts::Mapper; end
18
+
19
+ class Math < Sts::Mapper
20
+ attribute :id, Shale::Type::String
21
+ attribute :content, Shale::Type::String
22
+ attribute :display, Shale::Type::String
23
+ attribute :mrow, Mrow
24
+ attribute :msub, Msub
25
+ attribute :msup, Msup
26
+ attribute :mn, Shale::Type::String
27
+ attribute :mo, Shale::Type::String
28
+ attribute :mi, Shale::Type::String
29
+ attribute :mtext, Shale::Type::String
30
+ attribute :semantics, Semantics
31
+ attribute :mstyle, Mstyle, collection: true
32
+ attribute :mfenced, Mfenced, collection: true
33
+ attribute :mspace, Mspace, collection: true
34
+ attribute :mfrac, Mfrac, collection: true
35
+ attribute :munderover, Munderover, collection: true
36
+
37
+ xml do
38
+ root "math"
39
+ namespace "http://www.w3.org/1998/Math/MathML", "mml"
40
+
41
+ map_attribute "id", to: :id
42
+
43
+ map_element "mrow", to: :mrow # , render_nil: true
44
+ map_element "msub", to: :msub # , render_nil: true
45
+ map_element "msup", to: :msup # , render_nil: true
46
+ map_element "semantics", to: :semantics
47
+ map_element "mn", to: :mn
48
+ map_element "mi", to: :mi
49
+ map_element "mtext", to: :mtext
50
+ map_element "mo", to: :mo # , render_nil: true
51
+ map_element "mstyle", to: :mstyle
52
+ map_element "mspace", to: :mspace
53
+ map_element "mfrac", to: :mfrac
54
+ map_element "mfenced", to: :mfenced
55
+ map_element "munderover", to: :munderover
56
+
57
+ map_content to: :content
58
+ map_attribute "display", to: :display
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "mspace"
6
+ require_relative "msub"
7
+ require_relative "mstyle"
8
+ require_relative "mfrac"
9
+
10
+ module Sts
11
+ module TbxIsoTml
12
+ class Mfenced < Sts::Mapper
13
+ attribute :separators, Shale::Type::String
14
+ attribute :open, Shale::Type::String
15
+ attribute :close, Shale::Type::String
16
+ attribute :mo, Shale::Type::String
17
+ attribute :mn, Shale::Type::String
18
+ attribute :mi, Shale::Type::String
19
+ attribute :mtext, Shale::Type::String
20
+ attribute :mspace, Mspace, collection: true
21
+ attribute :msub, Msub, collection: true
22
+ attribute :mstyle, Mstyle, collection: true
23
+ attribute :mfrac, Mfrac, collection: true
24
+
25
+ xml do
26
+ root "math"
27
+ namespace "http://www.w3.org/1998/Math/MathML", "mml"
28
+
29
+ map_attribute "separators", to: :separators
30
+ map_attribute "open", to: :open
31
+ map_attribute "close", to: :close
32
+
33
+ map_element "mo", to: :mo
34
+ map_element "mn", to: :mn
35
+ map_element "mi", to: :mi
36
+ map_element "mspace", to: :mspace
37
+ map_element "msub", to: :msub
38
+ map_element "mstyle", to: :mstyle
39
+ map_element "mfrac", to: :mfrac
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+ require_relative "mrow"
5
+ require_relative "mstyle"
6
+
7
+ module Sts
8
+ module TbxIsoTml
9
+ class Mrow < Sts::Mapper; end
10
+
11
+ class Mfrac < Sts::Mapper
12
+ attribute :mrow, Mrow, collection: true
13
+ attribute :mstyle, Mstyle, collection: true
14
+ attribute :bevelled, Shale::Type::String
15
+ attribute :linethickness, Shale::Type::String
16
+ attribute :mn, Shale::Type::String
17
+ attribute :mtext, Shale::Type::String
18
+
19
+ xml do
20
+ root "math"
21
+ namespace "http://www.w3.org/1998/Math/MathML", "mml"
22
+
23
+ map_attribute "bevelled", to: :bevelled
24
+ map_attribute "linethickness", to: :linethickness
25
+
26
+ map_element "mrow", to: :mrow
27
+ map_element "mn", to: :mn
28
+ map_element "mtext", to: :mtext
29
+ map_element "mstyle", to: :mstyle
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+ require_relative "mstyle"
5
+
6
+ module Sts
7
+ module TbxIsoTml
8
+ class Mi < Sts::Mapper
9
+ attribute :content, Shale::Type::String
10
+
11
+ xml do
12
+ root "mi"
13
+ namespace "http://www.w3.org/1998/Math/MathML", "mml"
14
+
15
+ map_content to: :content
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+ require_relative "mfrac"
5
+ require_relative "mstyle"
6
+ require_relative "msub"
7
+ require_relative "msup"
8
+ require_relative "mspace"
9
+ require_relative "mfenced"
10
+
11
+ module Sts
12
+ module TbxIsoTml
13
+ class Mrow < Sts::Mapper
14
+ attribute :content, Shale::Type::String
15
+ attribute :mo, Shale::Type::String
16
+ attribute :mi, Shale::Type::String
17
+ attribute :mn, Shale::Type::String
18
+ attribute :mtext, Shale::Type::String
19
+ attribute :mrow, Mrow
20
+ attribute :mfrac, Mfrac
21
+ attribute :mstyle, Mstyle
22
+ attribute :msub, Msub
23
+ attribute :msup, Msup
24
+ attribute :mfenced, Mfenced, collection: true
25
+ attribute :mspace, Mspace, collection: true
26
+
27
+ xml do
28
+ root "math"
29
+ namespace "http://www.w3.org/1998/Math/MathML", "mml"
30
+
31
+ map_element "mo", to: :mo
32
+ map_element "mi", to: :mi
33
+ map_element "mn", to: :mn
34
+ map_element "mtext", to: :mtext
35
+ map_element "mrow", to: :mrow
36
+ map_element "mfrac", to: :mfrac
37
+ map_element "mstyle", to: :mstyle
38
+ map_element "msub", to: :msub
39
+ map_element "msup", to: :msup
40
+ map_element "mspace", to: :mspace
41
+ map_element "mfenced", to: :mfenced
42
+ map_content to: :content
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module TbxIsoTml
7
+ class Mspace < Sts::Mapper
8
+ attribute :width, Shale::Type::String
9
+
10
+ xml do
11
+ root "mspace"
12
+ namespace "http://www.w3.org/1998/Math/MathML", "mml"
13
+
14
+ map_attribute "width", to: :width
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+ require_relative "mspace"
5
+
6
+ module Sts
7
+ module TbxIsoTml
8
+ class Mstyle < Sts::Mapper
9
+ attribute :mathvariant, Shale::Type::String
10
+ attribute :mstyle, Mstyle
11
+ attribute :mspace, Mspace
12
+ attribute :mi, Shale::Type::String, collection: true
13
+ attribute :mn, Shale::Type::String, collection: true
14
+ attribute :mo, Shale::Type::String, collection: true
15
+
16
+ xml do
17
+ root "math"
18
+ namespace "http://www.w3.org/1998/Math/MathML", "mml"
19
+
20
+ map_attribute "mathvariant", to: :mathvariant
21
+ map_element "mi", to: :mi
22
+ map_element "mn", to: :mn
23
+ map_element "mo", to: :mo
24
+ map_element "mstyle", to: :mstyle
25
+ map_element "mspace", to: :mspace
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "mstyle"
6
+ require_relative "mrow"
7
+ require_relative "mspace"
8
+
9
+ module Sts
10
+ module TbxIsoTml
11
+ class Msub < Sts::Mapper
12
+ attribute :mstyle, Mstyle, collection: true
13
+ attribute :mrow, Mrow
14
+ attribute :mspace, Mspace
15
+ attribute :mo, Shale::Type::String, collection: true
16
+ attribute :mi, Shale::Type::String, collection: true
17
+ attribute :mn, Shale::Type::String, collection: true
18
+ attribute :mtext, Shale::Type::String, collection: true
19
+
20
+ xml do
21
+ root "mstyle"
22
+ namespace "http://www.w3.org/1998/Math/MathML", "mml"
23
+
24
+ map_element "mstyle", to: :mstyle
25
+ map_element "mo", to: :mo
26
+ map_element "mi", to: :mi
27
+ map_element "mn", to: :mn
28
+ map_element "mrow", to: :mrow
29
+ map_element "mtext", to: :mtext
30
+ map_element "mspace", to: :mspace
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "mstyle"
6
+ require_relative "mrow"
7
+
8
+ module Sts
9
+ module TbxIsoTml
10
+ class Msup < Sts::Mapper
11
+ attribute :mstyle, Mstyle
12
+ attribute :mrow, Mrow
13
+ attribute :mi, Shale::Type::String
14
+ attribute :mn, Shale::Type::String
15
+
16
+ xml do
17
+ root "mstyle"
18
+ namespace "http://www.w3.org/1998/Math/MathML", "mml"
19
+
20
+ map_element "mstyle", to: :mstyle
21
+ map_element "mi", to: :mi
22
+ map_element "mn", to: :mn
23
+ map_element "mrow", to: :mrow
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "mrow"
6
+
7
+ module Sts
8
+ module TbxIsoTml
9
+ class Munder < Sts::Mapper
10
+ attribute :mrow, Mrow, collection: true
11
+
12
+ xml do
13
+ root "math"
14
+ namespace "http://www.w3.org/1998/Math/MathML", "mml"
15
+
16
+ map_element "mrow", to: :mrow
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "mrow"
6
+
7
+ module Sts
8
+ module TbxIsoTml
9
+ class Munderover < Sts::Mapper
10
+ attribute :mo, Shale::Type::String
11
+ attribute :mi, Shale::Type::String
12
+ attribute :mrow, Mrow, collection: true
13
+
14
+ xml do
15
+ root "math"
16
+ namespace "http://www.w3.org/1998/Math/MathML", "mml"
17
+
18
+ map_element "mo", to: :mo
19
+ map_element "mi", to: :mi
20
+ map_element "mrow", to: :mrow
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module TbxIsoTml
7
+ class NamedContent < Sts::Mapper
8
+ attribute :content_type, Shale::Type::String
9
+ attribute :content, Shale::Type::String
10
+
11
+ xml do
12
+ root "named-content"
13
+
14
+ map_attribute "content-type", to: :content_type
15
+
16
+ map_content to: :content
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  module Sts
6
6
  module TbxIsoTml
7
- class NormativeAuthorization < Shale::Mapper
7
+ class NormativeAuthorization < Sts::Mapper
8
8
  # TODO: can be: admittedTerm, preferredTerm, deprecatedTerm
9
9
  attribute :value, Shale::Type::String
10
10
 
@@ -1,17 +1,46 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
+
5
+ require_relative "table_wrap"
6
+ require_relative "entailed_term"
7
+ require_relative "math"
8
+ require_relative "sup"
9
+ require_relative "italic"
10
+ require_relative "xref"
11
+ require_relative "../niso_sts/list"
12
+ require_relative "../niso_sts/reference_standard"
4
13
 
5
14
  module Sts
6
15
  module TbxIsoTml
7
- class Note < Shale::Mapper
16
+ class Note < Sts::Mapper
17
+ attribute :id, Shale::Type::String
8
18
  attribute :value, Shale::Type::String
19
+ attribute :table_wrap, Sts::TbxIsoTml::TableWrap
20
+ attribute :entailed_term, EntailedTerm
21
+ attribute :math, Sts::TbxIsoTml::Math
22
+ attribute :xref, Sts::TbxIsoTml::Xref
23
+ attribute :list, Sts::NisoSts::List
24
+ attribute :std, Sts::NisoSts::ReferenceStandard
25
+ attribute :sup, Sup
26
+ attribute :italic, Italic
9
27
 
10
28
  xml do
11
29
  root "note"
12
30
  namespace "urn:iso:std:iso:30042:ed-1", "tbx"
13
31
 
32
+ map_attribute "id", to: :id
14
33
  map_content to: :value
34
+ map_element "entailedTerm", to: :entailed_term
35
+ map_element "list", to: :list, namespace: nil, prefix: nil
36
+ map_element "table-wrap", to: :table_wrap, namespace: nil, prefix: nil
37
+ map_element "std", to: :std, namespace: nil, prefix: nil
38
+ map_element "sup", to: :sup, namespace: nil, prefix: nil
39
+ map_element "italic", to: :italic, namespace: nil, prefix: nil
40
+ map_element "xref", to: :xref, namespace: nil, prefix: nil
41
+ map_element "math", to: :math,
42
+ namespace: "http://www.w3.org/1998/Math/MathML",
43
+ prefix: "mml"
15
44
  end
16
45
  end
17
46
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  module Sts
6
6
  module TbxIsoTml
7
- class PartOfSpeech < Shale::Mapper
7
+ class PartOfSpeech < Sts::Mapper
8
8
  # TODO: can be `noun`, `verb`, `adj`, `adv`
9
9
  attribute :value, Shale::Type::String
10
10