sts 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +1 -1
- data/.rubocop.yml +12 -0
- data/Gemfile +6 -0
- data/lib/sts/mapper.rb +442 -0
- data/lib/sts/niso_sts/adoption.rb +30 -0
- data/lib/sts/niso_sts/adoption_front.rb +16 -0
- data/lib/sts/niso_sts/app.rb +49 -0
- data/lib/sts/niso_sts/app_group.rb +19 -0
- data/lib/sts/niso_sts/back.rb +12 -2
- data/lib/sts/niso_sts/body.rb +2 -2
- data/lib/sts/niso_sts/caption.rb +47 -0
- data/lib/sts/niso_sts/custom_meta.rb +23 -0
- data/lib/sts/niso_sts/custom_meta_group.rb +18 -0
- data/lib/sts/niso_sts/def.rb +19 -0
- data/lib/sts/niso_sts/def_item.rb +24 -0
- data/lib/sts/niso_sts/def_list.rb +28 -0
- data/lib/sts/niso_sts/display_formula.rb +27 -0
- data/lib/sts/niso_sts/document_identification.rb +7 -7
- data/lib/sts/niso_sts/ext_link.rb +20 -0
- data/lib/sts/niso_sts/figure.rb +40 -0
- data/lib/sts/niso_sts/fn.rb +24 -0
- data/lib/sts/niso_sts/fn_group.rb +19 -0
- data/lib/sts/niso_sts/front.rb +8 -2
- data/lib/sts/niso_sts/graphic.rb +29 -0
- data/lib/sts/niso_sts/inline_formula.rb +22 -0
- data/lib/sts/niso_sts/list.rb +9 -1
- data/lib/sts/niso_sts/list_item.rb +25 -0
- data/lib/sts/niso_sts/meta_note.rb +24 -0
- data/lib/sts/niso_sts/metadata_iso.rb +2 -2
- data/lib/sts/niso_sts/metadata_std.rb +59 -0
- data/lib/sts/niso_sts/mixed_citation.rb +27 -0
- data/lib/sts/niso_sts/non_normative_example.rb +22 -0
- data/lib/sts/niso_sts/non_normative_note.rb +8 -2
- data/lib/sts/niso_sts/object_id.rb +23 -0
- data/lib/sts/niso_sts/page_count.rb +2 -2
- data/lib/sts/niso_sts/paragraph.rb +36 -2
- data/lib/sts/niso_sts/permissions.rb +20 -0
- data/lib/sts/niso_sts/reference.rb +4 -1
- data/lib/sts/niso_sts/reference_list.rb +6 -1
- data/lib/sts/niso_sts/reference_standard.rb +17 -6
- data/lib/sts/niso_sts/section.rb +37 -9
- data/lib/sts/niso_sts/standard.rb +14 -1
- data/lib/sts/niso_sts/standard_identification.rb +13 -7
- data/lib/sts/niso_sts/standard_ref.rb +2 -2
- data/lib/sts/niso_sts/std_cross_reference.rb +18 -0
- data/lib/sts/niso_sts/std_id.rb +24 -0
- data/lib/sts/niso_sts/std_id_group.rb +19 -0
- data/lib/sts/niso_sts/term_display.rb +2 -2
- data/lib/sts/niso_sts/term_section.rb +10 -3
- data/lib/sts/niso_sts/title.rb +22 -0
- data/lib/sts/niso_sts/title_wrap.rb +27 -3
- data/lib/sts/niso_sts.rb +3 -0
- data/lib/sts/tbx_iso_tml/bold.rb +18 -0
- data/lib/sts/tbx_iso_tml/caption.rb +17 -0
- data/lib/sts/tbx_iso_tml/col.rb +23 -0
- data/lib/sts/tbx_iso_tml/definition.rb +24 -1
- data/lib/sts/tbx_iso_tml/entailed_term.rb +26 -0
- data/lib/sts/tbx_iso_tml/example.rb +16 -1
- data/lib/sts/tbx_iso_tml/external_graphic.rb +2 -2
- data/lib/sts/tbx_iso_tml/external_source.rb +2 -2
- data/lib/sts/tbx_iso_tml/fn.rb +23 -0
- data/lib/sts/tbx_iso_tml/fn_group.rb +19 -0
- data/lib/sts/tbx_iso_tml/geographical_usage.rb +2 -2
- data/lib/sts/tbx_iso_tml/grammatical_gender.rb +2 -2
- data/lib/sts/tbx_iso_tml/grammatical_number.rb +2 -2
- data/lib/sts/tbx_iso_tml/italic.rb +20 -0
- data/lib/sts/tbx_iso_tml/lang_set.rb +11 -7
- data/lib/sts/tbx_iso_tml/math.rb +62 -0
- data/lib/sts/tbx_iso_tml/mfenced.rb +43 -0
- data/lib/sts/tbx_iso_tml/mfrac.rb +33 -0
- data/lib/sts/tbx_iso_tml/mi.rb +19 -0
- data/lib/sts/tbx_iso_tml/mrow.rb +46 -0
- data/lib/sts/tbx_iso_tml/mspace.rb +18 -0
- data/lib/sts/tbx_iso_tml/mstyle.rb +29 -0
- data/lib/sts/tbx_iso_tml/msub.rb +34 -0
- data/lib/sts/tbx_iso_tml/msup.rb +27 -0
- data/lib/sts/tbx_iso_tml/munder.rb +20 -0
- data/lib/sts/tbx_iso_tml/munderover.rb +24 -0
- data/lib/sts/tbx_iso_tml/named_content.rb +20 -0
- data/lib/sts/tbx_iso_tml/normative_authorization.rb +2 -2
- data/lib/sts/tbx_iso_tml/note.rb +31 -2
- data/lib/sts/tbx_iso_tml/part_of_speech.rb +2 -2
- data/lib/sts/tbx_iso_tml/see.rb +2 -2
- data/lib/sts/tbx_iso_tml/semantics.rb +29 -0
- data/lib/sts/tbx_iso_tml/source.rb +6 -1
- data/lib/sts/tbx_iso_tml/sup.rb +24 -0
- data/lib/sts/tbx_iso_tml/table.rb +32 -0
- data/lib/sts/tbx_iso_tml/table_wrap.rb +33 -0
- data/lib/sts/tbx_iso_tml/table_wrap_foot.rb +19 -0
- data/lib/sts/tbx_iso_tml/tbody.rb +26 -0
- data/lib/sts/tbx_iso_tml/td.rb +60 -0
- data/lib/sts/tbx_iso_tml/term.rb +31 -2
- data/lib/sts/tbx_iso_tml/term_entry.rb +2 -3
- data/lib/sts/tbx_iso_tml/term_information_group.rb +5 -2
- data/lib/sts/tbx_iso_tml/term_type.rb +2 -2
- data/lib/sts/tbx_iso_tml/th.rb +50 -0
- data/lib/sts/tbx_iso_tml/thead.rb +26 -0
- data/lib/sts/tbx_iso_tml/tr.rb +22 -0
- data/lib/sts/tbx_iso_tml/xref.rb +26 -0
- data/lib/sts/tbx_iso_tml.rb +8 -0
- data/lib/sts/version.rb +1 -1
- data/lib/sts.rb +1 -0
- data/sts.gemspec +2 -8
- metadata +67 -63
@@ -0,0 +1,47 @@
|
|
1
|
+
require_relative "../mapper"
|
2
|
+
|
3
|
+
require_relative "paragraph"
|
4
|
+
require_relative "title"
|
5
|
+
require_relative "non_normative_note"
|
6
|
+
|
7
|
+
# rubocop:disable Layout/LineLength
|
8
|
+
# <caption>
|
9
|
+
# <title>Overview of risk assessment/risk reduction</title>
|
10
|
+
# <p><def-list list-type="footnotes">
|
11
|
+
# <def-item>
|
12
|
+
# <term>a</term>
|
13
|
+
# <def>
|
14
|
+
# <p>Refers to <std><std-id-group>
|
15
|
+
# <std-id std-id-link-type="internal-pub-id" std-id-type="dated">e1d167f5</std-id>
|
16
|
+
# <std-id std-id-link-type="fpi" std-id-type="dated">+//ISO 9070/RA::A00007::GE::DIN German
|
17
|
+
# Institute for Standardization::Standards//DOCUMENT ISO 12100-1:2003-11-00//EN</std-id>
|
18
|
+
# </std-id-group>ISO 12100-1:2003</std>.</p>
|
19
|
+
# </def>
|
20
|
+
# </def-item>
|
21
|
+
# <def-item>
|
22
|
+
# <term>b</term>
|
23
|
+
# <def>
|
24
|
+
# <p>Refers to this part of ISO 13849.</p>
|
25
|
+
# </def>
|
26
|
+
# </def-item>
|
27
|
+
# </def-list></p>
|
28
|
+
# </caption>
|
29
|
+
# rubocop:enable Layout/LineLength
|
30
|
+
|
31
|
+
module Sts
|
32
|
+
module NisoSts
|
33
|
+
class Caption < Sts::Mapper
|
34
|
+
attribute :title, Title
|
35
|
+
attribute :paragraphs, Paragraph, collection: true
|
36
|
+
attribute :non_normative_note, NonNormativeNote, collection: true
|
37
|
+
|
38
|
+
xml do
|
39
|
+
root "caption"
|
40
|
+
|
41
|
+
map_element "p", to: :paragraphs
|
42
|
+
map_element "non-normative-note", to: :non_normative_note
|
43
|
+
map_element "title", to: :title
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
module Sts
|
6
|
+
module NisoSts
|
7
|
+
class CustomMeta < Sts::Mapper
|
8
|
+
attribute :lang, Shale::Type::String
|
9
|
+
attribute :meta_name, Shale::Type::String
|
10
|
+
attribute :meta_value, Shale::Type::String
|
11
|
+
|
12
|
+
xml do
|
13
|
+
root "custom-meta"
|
14
|
+
|
15
|
+
map_attribute "lang", to: :lang,
|
16
|
+
namespace: "http://www.w3.org/XML/1998/namespace",
|
17
|
+
prefix: "xml"
|
18
|
+
map_element "meta-name", to: :meta_name
|
19
|
+
map_element "meta-value", to: :meta_value
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "custom_meta"
|
6
|
+
|
7
|
+
module Sts
|
8
|
+
module NisoSts
|
9
|
+
class CustomMetaGroup < Sts::Mapper
|
10
|
+
attribute :custom_meta, CustomMeta, collection: true
|
11
|
+
|
12
|
+
xml do
|
13
|
+
root "custom-meta-group"
|
14
|
+
map_element "custom-meta", to: :custom_meta
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "paragraph"
|
6
|
+
|
7
|
+
module Sts
|
8
|
+
module NisoSts
|
9
|
+
class Def < Sts::Mapper
|
10
|
+
attribute :paragraph, Paragraph
|
11
|
+
|
12
|
+
xml do
|
13
|
+
root "def"
|
14
|
+
|
15
|
+
map_element "p", to: :paragraph
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "def"
|
6
|
+
require_relative "../tbx_iso_tml/term"
|
7
|
+
|
8
|
+
module Sts
|
9
|
+
module NisoSts
|
10
|
+
class DefItem < Sts::Mapper
|
11
|
+
attribute :specific_use, Shale::Type::String
|
12
|
+
attribute :term, TbxIsoTml::Term
|
13
|
+
attribute :definition, Def
|
14
|
+
|
15
|
+
xml do
|
16
|
+
root "def-item"
|
17
|
+
|
18
|
+
map_attribute "specific-use", to: :specific_use
|
19
|
+
map_element "term", to: :term, render_nil: true
|
20
|
+
map_element "def", to: :definition
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "def_item"
|
6
|
+
|
7
|
+
module Sts
|
8
|
+
module NisoSts
|
9
|
+
class DefList < Sts::Mapper
|
10
|
+
attribute :title, Shale::Type::String
|
11
|
+
attribute :specific_use, Shale::Type::String
|
12
|
+
attribute :list_type, Shale::Type::String
|
13
|
+
attribute :def_item, DefItem, collection: true
|
14
|
+
attribute :def_list, DefList
|
15
|
+
|
16
|
+
xml do
|
17
|
+
root "def-list"
|
18
|
+
|
19
|
+
map_attribute "list-type", to: :list_type
|
20
|
+
map_attribute "specific-use", to: :specific_use
|
21
|
+
|
22
|
+
map_element "title", to: :title
|
23
|
+
map_element "def-item", to: :def_item
|
24
|
+
map_element "def-list", to: :def_list
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
|
5
|
+
require_relative "../mapper"
|
6
|
+
require_relative "../tbx_iso_tml/math"
|
7
|
+
|
8
|
+
module Sts
|
9
|
+
module NisoSts
|
10
|
+
class DisplayFormula < Sts::Mapper
|
11
|
+
attribute :id, Shale::Type::String
|
12
|
+
attribute :label, Shale::Type::String
|
13
|
+
attribute :math, TbxIsoTml::Math
|
14
|
+
|
15
|
+
xml do
|
16
|
+
root "disp-formula"
|
17
|
+
|
18
|
+
map_attribute "id", to: :id
|
19
|
+
|
20
|
+
map_element "label", to: :label
|
21
|
+
map_element "math", to: :math,
|
22
|
+
namespace: "http://www.w3.org/1998/Math/MathML",
|
23
|
+
prefix: "mml"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../mapper"
|
4
4
|
|
5
5
|
module Sts
|
6
6
|
module NisoSts
|
7
|
-
class DocumentIdentification <
|
7
|
+
class DocumentIdentification < Sts::Mapper
|
8
8
|
attribute :sdo, Shale::Type::String
|
9
9
|
attribute :proj_id, Shale::Type::String
|
10
10
|
attribute :language, Shale::Type::String
|
@@ -14,11 +14,11 @@ module Sts
|
|
14
14
|
xml do
|
15
15
|
root "doc-iden"
|
16
16
|
|
17
|
-
map_element
|
18
|
-
map_element
|
19
|
-
map_element
|
20
|
-
map_element
|
21
|
-
map_element
|
17
|
+
map_element "sdo", to: :sdo
|
18
|
+
map_element "proj-id", to: :proj_id
|
19
|
+
map_element "language", to: :language
|
20
|
+
map_element "release-version", to: :release_version
|
21
|
+
map_element "urn", to: :urn
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_striing_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
module Sts
|
6
|
+
module NisoSts
|
7
|
+
class ExtLink < Sts::Mapper
|
8
|
+
attribute :ext_link_type, Shale::Type::String
|
9
|
+
attribute :content, Shale::Type::String
|
10
|
+
|
11
|
+
xml do
|
12
|
+
root "ext-link"
|
13
|
+
|
14
|
+
map_content to: :content
|
15
|
+
|
16
|
+
map_attribute "ext-link-type", to: :ext_link_type
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "caption"
|
6
|
+
require_relative "graphic"
|
7
|
+
require_relative "def_list"
|
8
|
+
|
9
|
+
# <fig id="fig-1" orientation="portrait">
|
10
|
+
# <label>Figure 1</label>
|
11
|
+
# <caption...>
|
12
|
+
# <graphic...>
|
13
|
+
# </fig>
|
14
|
+
|
15
|
+
module Sts
|
16
|
+
module NisoSts
|
17
|
+
class Caption < Sts::Mapper; end
|
18
|
+
|
19
|
+
class Figure < Sts::Mapper
|
20
|
+
attribute :id, Shale::Type::String
|
21
|
+
attribute :orientation, Shale::Type::String
|
22
|
+
attribute :caption, Caption
|
23
|
+
attribute :def_list, DefList
|
24
|
+
attribute :label, Shale::Type::String
|
25
|
+
attribute :graphic, Graphic, collection: true
|
26
|
+
|
27
|
+
xml do
|
28
|
+
root "fig"
|
29
|
+
|
30
|
+
map_attribute "id", to: :id
|
31
|
+
map_attribute "orientation", to: :orientation
|
32
|
+
|
33
|
+
map_element "label", to: :label
|
34
|
+
map_element "caption", to: :caption
|
35
|
+
map_element "graphic", to: :graphic
|
36
|
+
map_element "def-list", to: :def_list
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "paragraph"
|
6
|
+
|
7
|
+
module Sts
|
8
|
+
module NisoSts
|
9
|
+
class Fn < Sts::Mapper
|
10
|
+
attribute :id, Shale::Type::String
|
11
|
+
attribute :label, Shale::Type::String
|
12
|
+
attribute :paragraph, Paragraph
|
13
|
+
|
14
|
+
xml do
|
15
|
+
root "fn"
|
16
|
+
|
17
|
+
map_attribute "id", to: :id
|
18
|
+
|
19
|
+
map_element "label", to: :label
|
20
|
+
map_element "p", to: :paragraph
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
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 NisoSts
|
9
|
+
class FnGroup < Sts::Mapper
|
10
|
+
attribute :fn, 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
|
data/lib/sts/niso_sts/front.rb
CHANGED
@@ -1,17 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../mapper"
|
4
4
|
|
5
5
|
require_relative "metadata_iso"
|
6
|
+
require_relative "metadata_std"
|
7
|
+
require_relative "section"
|
6
8
|
|
7
9
|
module Sts
|
8
10
|
module NisoSts
|
9
|
-
class Front <
|
11
|
+
class Front < Sts::Mapper
|
10
12
|
attribute :iso_meta, MetadataIso
|
13
|
+
attribute :std_meta, MetadataStd
|
14
|
+
attribute :sec, Section, collection: true
|
11
15
|
|
12
16
|
xml do
|
13
17
|
root "front"
|
14
18
|
map_element "iso-meta", to: :iso_meta
|
19
|
+
map_element "std-meta", to: :std_meta
|
20
|
+
map_element "sec", to: :sec
|
15
21
|
end
|
16
22
|
end
|
17
23
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require_relative "../mapper"
|
2
|
+
|
3
|
+
require_relative "object_id"
|
4
|
+
|
5
|
+
# rubocop:disable Layout/LineLength
|
6
|
+
# <graphic xlink:href="e1d18be9.001.gif">
|
7
|
+
# <object-id pub-id-type="fpi">+//ISO 9070/RA::A00007::GE::DIN German Institute for
|
8
|
+
# Standardization::Standards//NONSGML ISO 13849-1:2006-11-00::Figure 1//EN</object-id>
|
9
|
+
# <object-id pub-id-type="publisher-id">fig-1</object-id>
|
10
|
+
# </graphic>
|
11
|
+
# rubocop:enable Layout/LineLength
|
12
|
+
|
13
|
+
module Sts
|
14
|
+
module NisoSts
|
15
|
+
class Graphic < Sts::Mapper
|
16
|
+
attribute :href, Shale::Type::String
|
17
|
+
attribute :object_id, ObjectId, collection: true
|
18
|
+
|
19
|
+
xml do
|
20
|
+
root "graphic"
|
21
|
+
|
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
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
|
5
|
+
require_relative "../mapper"
|
6
|
+
require_relative "../tbx_iso_tml/math"
|
7
|
+
|
8
|
+
module Sts
|
9
|
+
module NisoSts
|
10
|
+
class InlineFormula < Sts::Mapper
|
11
|
+
attribute :math, TbxIsoTml::Math
|
12
|
+
|
13
|
+
xml do
|
14
|
+
root "inline-formula"
|
15
|
+
|
16
|
+
map_element "math", to: :math,
|
17
|
+
namespace: "http://www.w3.org/1998/Math/MathML",
|
18
|
+
prefix: "mml"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/sts/niso_sts/list.rb
CHANGED
@@ -2,14 +2,22 @@
|
|
2
2
|
|
3
3
|
require "shale"
|
4
4
|
|
5
|
+
require_relative "list_item"
|
6
|
+
require_relative "../mapper"
|
7
|
+
|
5
8
|
module Sts
|
6
9
|
module NisoSts
|
7
|
-
class List <
|
10
|
+
class List < Sts::Mapper
|
8
11
|
attribute :text, Shale::Type::String
|
12
|
+
attribute :list_type, Shale::Type::String
|
13
|
+
attribute :list_item, ListItem, collection: true
|
9
14
|
|
10
15
|
xml do
|
11
16
|
root "list"
|
17
|
+
|
12
18
|
map_content to: :text
|
19
|
+
map_attribute "list-type", to: :list_type
|
20
|
+
map_element "list-item", to: :list_item, namespace: nil, prefix: nil
|
13
21
|
end
|
14
22
|
end
|
15
23
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
require_relative "list"
|
5
|
+
|
6
|
+
module Sts
|
7
|
+
module NisoSts
|
8
|
+
class Paragraph < Sts::Mapper; end
|
9
|
+
class List < Sts::Mapper; end
|
10
|
+
|
11
|
+
class ListItem < Sts::Mapper
|
12
|
+
attribute :label, Shale::Type::String
|
13
|
+
attribute :p, Sts::NisoSts::Paragraph
|
14
|
+
attribute :list, List
|
15
|
+
|
16
|
+
xml do
|
17
|
+
root "list-item"
|
18
|
+
|
19
|
+
map_element :label, to: :label
|
20
|
+
map_element :p, to: :p
|
21
|
+
map_element :list, to: :list
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "paragraph"
|
6
|
+
|
7
|
+
module Sts
|
8
|
+
module NisoSts
|
9
|
+
class MetaNote < Sts::Mapper
|
10
|
+
attribute :id, Shale::Type::String
|
11
|
+
attribute :content_type, Shale::Type::String
|
12
|
+
attribute :p, Paragraph, collection: true
|
13
|
+
attribute :title, Shale::Type::String
|
14
|
+
|
15
|
+
xml do
|
16
|
+
root "meta-note"
|
17
|
+
map_attribute "id", to: :id
|
18
|
+
map_attribute "content-type", to: :content_type
|
19
|
+
map_element "p", to: :p
|
20
|
+
map_element "title", to: :title
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../mapper"
|
4
4
|
require_relative "title_wrap"
|
5
5
|
require_relative "document_identification"
|
6
6
|
require_relative "standard_identification"
|
@@ -9,7 +9,7 @@ require_relative "page_count"
|
|
9
9
|
|
10
10
|
module Sts
|
11
11
|
module NisoSts
|
12
|
-
class MetadataIso <
|
12
|
+
class MetadataIso < Sts::Mapper
|
13
13
|
attribute :title_wrap, TitleWrap
|
14
14
|
attribute :content_language, Shale::Type::String
|
15
15
|
attribute :std_ident, StandardIdentification
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
require_relative "title_wrap"
|
5
|
+
require_relative "document_identification"
|
6
|
+
require_relative "standard_identification"
|
7
|
+
require_relative "standard_ref"
|
8
|
+
require_relative "page_count"
|
9
|
+
require_relative "std_cross_reference"
|
10
|
+
require_relative "meta_note"
|
11
|
+
require_relative "custom_meta_group"
|
12
|
+
require_relative "permissions"
|
13
|
+
|
14
|
+
module Sts
|
15
|
+
module NisoSts
|
16
|
+
class MetadataStd < Sts::Mapper
|
17
|
+
attribute :id, Shale::Type::String
|
18
|
+
attribute :title_wrap, TitleWrap, collection: true
|
19
|
+
attribute :content_language, Shale::Type::String
|
20
|
+
attribute :std_ident, StandardIdentification
|
21
|
+
attribute :doc_ident, DocumentIdentification
|
22
|
+
attribute :std_ref, StandardRef, collection: true
|
23
|
+
attribute :doc_ref, Shale::Type::String
|
24
|
+
attribute :pub_date, Shale::Type::String
|
25
|
+
attribute :release_date, Shale::Type::String
|
26
|
+
attribute :release_version, Shale::Type::String
|
27
|
+
attribute :comm_ref, Shale::Type::String
|
28
|
+
attribute :secretariat, Shale::Type::String
|
29
|
+
attribute :page_count, PageCount
|
30
|
+
attribute :ics, Shale::Type::String
|
31
|
+
attribute :std_xref, StdCrossReference
|
32
|
+
attribute :permissions, Permissions
|
33
|
+
attribute :meta_note, MetaNote, collection: true
|
34
|
+
attribute :custom_meta_group, CustomMetaGroup, collection: true
|
35
|
+
|
36
|
+
xml do
|
37
|
+
root "std-meta"
|
38
|
+
map_attribute "id", to: :id
|
39
|
+
map_element "title-wrap", to: :title_wrap
|
40
|
+
map_element "content-language", to: :content_language
|
41
|
+
map_element "std-ident", to: :std_ident
|
42
|
+
map_element "doc-ident", to: :doc_ident
|
43
|
+
map_element "std-ref", to: :std_ref
|
44
|
+
map_element "doc-ref", to: :doc_ref
|
45
|
+
map_element "pub-date", to: :pub_date
|
46
|
+
map_element "release-date", to: :release_date
|
47
|
+
map_element "release-version", to: :release_version
|
48
|
+
map_element "comm-ref", to: :comm_ref, render_nil: true
|
49
|
+
map_element "secretariat", to: :secretariat, render_nil: true
|
50
|
+
map_element "page-count", to: :page_count
|
51
|
+
map_element "ics", to: :ics
|
52
|
+
map_element "std-xref", to: :std_xref
|
53
|
+
map_element "permissions", to: :permissions
|
54
|
+
map_element "meta-note", to: :meta_note
|
55
|
+
map_element "custom-meta-group", to: :custom_meta_group
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_striing_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "ext_link"
|
6
|
+
require_relative "reference_standard"
|
7
|
+
|
8
|
+
module Sts
|
9
|
+
module NisoSts
|
10
|
+
class MixedCitation < Sts::Mapper
|
11
|
+
attribute :content, Shale::Type::String
|
12
|
+
attribute :bold, Shale::Type::String
|
13
|
+
attribute :std, ReferenceStandard
|
14
|
+
attribute :ext_link, ExtLink
|
15
|
+
|
16
|
+
xml do
|
17
|
+
root "mixed-citation"
|
18
|
+
|
19
|
+
map_content to: :content
|
20
|
+
|
21
|
+
map_element "bold", to: :bold
|
22
|
+
map_element "std", to: :std
|
23
|
+
map_element "ext-link", to: :ext_link
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "paragraph"
|
6
|
+
|
7
|
+
module Sts
|
8
|
+
module NisoSts
|
9
|
+
class NonNormativeExample < Sts::Mapper
|
10
|
+
attribute :id, Shale::Type::String
|
11
|
+
attribute :p, Paragraph
|
12
|
+
attribute :label, Shale::Type::String
|
13
|
+
|
14
|
+
xml do
|
15
|
+
root "non-normative-example"
|
16
|
+
map_attribute "id", to: :id
|
17
|
+
map_element "p", to: :p
|
18
|
+
map_element "label", to: :label
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,17 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../mapper"
|
4
4
|
|
5
5
|
require_relative "paragraph"
|
6
6
|
|
7
7
|
module Sts
|
8
8
|
module NisoSts
|
9
|
-
class NonNormativeNote <
|
9
|
+
class NonNormativeNote < Sts::Mapper
|
10
|
+
attribute :id, Shale::Type::String
|
11
|
+
attribute :content_type, Shale::Type::String
|
10
12
|
attribute :p, Paragraph
|
11
13
|
attribute :label, Shale::Type::String
|
12
14
|
|
13
15
|
xml do
|
14
16
|
root "non-normative-note"
|
17
|
+
|
18
|
+
map_attribute "content-type", to: :content_type
|
19
|
+
map_attribute "id", to: :id
|
20
|
+
|
15
21
|
map_element "p", to: :p
|
16
22
|
map_element "label", to: :label
|
17
23
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# rubocop:disable Layout/LineLength
|
2
|
+
# <object-id pub-id-type="fpi">+//ISO 9070/RA::A00007::GE::DIN German Institute for
|
3
|
+
# Standardization::Standards//NONSGML ISO 13849-1:2006-11-00::Figure 1//EN</object-id>
|
4
|
+
# <object-id pub-id-type="publisher-id">fig-1</object-id>
|
5
|
+
# rubocop:enable Layout/LineLength
|
6
|
+
|
7
|
+
require_relative "../mapper"
|
8
|
+
|
9
|
+
module Sts
|
10
|
+
module NisoSts
|
11
|
+
class ObjectId < Sts::Mapper
|
12
|
+
attribute :pub_id_type, Shale::Type::String
|
13
|
+
attribute :content, Shale::Type::String
|
14
|
+
|
15
|
+
xml do
|
16
|
+
root "object-id"
|
17
|
+
|
18
|
+
map_attribute "pub-id-type", to: :pub_id_type
|
19
|
+
map_content to: :content
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|