metanorma-bipm 2.7.1 → 2.7.3

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.
@@ -1,46 +1,50 @@
1
1
  module Metanorma
2
2
  module Bipm
3
3
  class Converter < Metanorma::Generic::Converter
4
- def metadata_committee(node, xml)
5
- node.attr("committee-en") || node.attr("committee-fr") or return
6
- xml.editorialgroup do |a|
7
- metadata_committee1(node, a)
8
- i = 2
9
- while node.attr("committee-en_#{i}") || node.attr("committee-fr_#{i}")
10
- metadata_committee2(node, a, i)
11
- i += 1
12
- end
13
- metadata_workgroup(node, a)
4
+ def contrib_committee_subdiv(xml, committee)
5
+ contributors_committees_filter_empty?(committee) and return
6
+ xml.subdivision **attr_code(type: committee[:subdivtype],
7
+ subtype: committee[:type]) do |o|
8
+ committee[:name] and o.name committee[:name]
9
+ committee[:name_en] and o.name committee[:name_en],
10
+ language: "en"
11
+ committee[:name_fr] and o.name committee[:name_fr],
12
+ language: "fr"
13
+ committee[:abbr] and o.abbreviation committee[:abbr]
14
+ committee[:ident] and o.identifier committee[:ident]
14
15
  end
15
16
  end
16
17
 
17
- def metadata_committee1(node, xml)
18
- %w(en fr).each do |lg|
19
- e = node.attr("committee-#{lg}") or next
20
- xml.committee e, **attr_code(acronym: node.attr("committee-acronym"),
21
- language: lg, script: "Latn")
22
- end
18
+ def contributors_committees_filter_empty?(committee)
19
+ (committee[:name].nil? || committee[:name].empty?) &&
20
+ (committee[:name_en].nil? || committee[:name_en].empty?) &&
21
+ (committee[:name_fr].nil? || committee[:name_fr].empty?) &&
22
+ committee[:ident].nil?
23
23
  end
24
24
 
25
- def metadata_committee2(node, xml, num)
26
- %w(en fr).each do |lg|
27
- e = node.attr("committee-#{lg}_#{num}") or next
28
- xml.committee e, **attr_code(acronym: node.attr("committee-acronym"),
29
- language: lg, script: "Latn")
30
- end
25
+ def committee_number_or_name?(node, type, suffix)
26
+ node.attr("#{type}-number#{suffix}") || node.attr("#{type}#{suffix}") ||
27
+ node.attr("#{type}-en#{suffix}") || node.attr("#{type}-fr#{suffix}")
31
28
  end
32
29
 
33
- def metadata_workgroup(node, xml)
34
- xml.workgroup(node.attr("workgroup"),
35
- **attr_code(acronym: node.attr("workgroup-acronym")))
36
- i = 2
37
- while node.attr("workgroup_#{i}")
38
- xml.workgroup(
39
- node.attr("workgroup_#{i}"),
40
- **attr_code(acronym: node.attr("workgroup-acronym_#{i}")),
41
- )
30
+ def committee_org_prep_agency(node, type, agency, agency_arr, agency_abbr)
31
+ i = 1
32
+ suffix = ""
33
+ while committee_number_or_name?(node, type, suffix)
34
+ agency_arr << (node.attr("#{type}-agency#{suffix}") || agency)
35
+ agency_abbr << node.attr("#{type}-agency-abbr#{suffix}")
42
36
  i += 1
37
+ suffix = "_#{i}"
43
38
  end
39
+ [agency_arr, agency_abbr]
40
+ end
41
+
42
+ def extract_org_attrs_complex(node, opts, source, suffix)
43
+ ident = node.attr("#{source}-acronym#{suffix}")
44
+ ret = super.merge(name_en: node.attr("#{source}-en#{suffix}"),
45
+ name_fr: node.attr("#{source}-fr#{suffix}"))
46
+ ident and ret[:ident] = ident
47
+ ret
44
48
  end
45
49
 
46
50
  def metadata_relations(node, xml)
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- VERSION v2.1.0 -->
3
+ <!-- VERSION v2.1.1 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -42,36 +42,6 @@ All IdRefType instances point not to `@id` in Semantic XML, which is the Content
42
42
  but to `@anchor`, the user-supplied cross-reference</a:documentation>
43
43
  <text/>
44
44
  </define>
45
- <define name="index-primary">
46
- <element name="primary">
47
- <oneOrMore>
48
- <choice>
49
- <ref name="PureTextElement"/>
50
- <ref name="stem"/>
51
- </choice>
52
- </oneOrMore>
53
- </element>
54
- </define>
55
- <define name="index-secondary">
56
- <element name="secondary">
57
- <oneOrMore>
58
- <choice>
59
- <ref name="PureTextElement"/>
60
- <ref name="stem"/>
61
- </choice>
62
- </oneOrMore>
63
- </element>
64
- </define>
65
- <define name="index-tertiary">
66
- <element name="tertiary">
67
- <oneOrMore>
68
- <choice>
69
- <ref name="PureTextElement"/>
70
- <ref name="stem"/>
71
- </choice>
72
- </oneOrMore>
73
- </element>
74
- </define>
75
45
  <define name="review">
76
46
  <a:documentation>Generalise BasicDoc element from just review comments, to general annotations;
77
47
  the type attribute defaults to `review` for reviews</a:documentation>
@@ -592,28 +562,6 @@ normative or informative references, some split references into sections organiz
592
562
  </oneOrMore>
593
563
  </element>
594
564
  </define>
595
- <define name="sub">
596
- <a:documentation>Subscript text. Corresponds to HTML `sub</a:documentation>
597
- <element name="sub">
598
- <zeroOrMore>
599
- <choice>
600
- <ref name="PureTextElement"/>
601
- <ref name="stem"/>
602
- </choice>
603
- </zeroOrMore>
604
- </element>
605
- </define>
606
- <define name="sup">
607
- <a:documentation>Superscript text. Corresponds to HTML `sup`</a:documentation>
608
- <element name="sup">
609
- <zeroOrMore>
610
- <choice>
611
- <ref name="PureTextElement"/>
612
- <ref name="stem"/>
613
- </choice>
614
- </zeroOrMore>
615
- </element>
616
- </define>
617
565
  <define name="pagebreak">
618
566
  <a:documentation>Page break. Only applicable in paged layouts (e.g. PDF, Word), and not flow layouts (e.g. HTML)</a:documentation>
619
567
  <element name="pagebreak">
@@ -1094,7 +1042,6 @@ That concept may be defined as a term within the current document, or it may be
1094
1042
  <zeroOrMore>
1095
1043
  <choice>
1096
1044
  <ref name="PureTextElement"/>
1097
- <ref name="stem"/>
1098
1045
  <ref name="index"/>
1099
1046
  <ref name="index-xref"/>
1100
1047
  </choice>
@@ -1107,7 +1054,6 @@ That concept may be defined as a term within the current document, or it may be
1107
1054
  <zeroOrMore>
1108
1055
  <choice>
1109
1056
  <ref name="PureTextElement"/>
1110
- <ref name="stem"/>
1111
1057
  <ref name="index"/>
1112
1058
  <ref name="index-xref"/>
1113
1059
  </choice>
@@ -2025,10 +1971,7 @@ used in document amendments</a:documentation>
2025
1971
  <element name="name">
2026
1972
  <a:documentation>The symbolic form of the designation</a:documentation>
2027
1973
  <oneOrMore>
2028
- <choice>
2029
- <ref name="PureTextElement"/>
2030
- <ref name="stem"/>
2031
- </choice>
1974
+ <ref name="PureTextElement"/>
2032
1975
  </oneOrMore>
2033
1976
  </element>
2034
1977
  </element>
@@ -2081,7 +2024,6 @@ used in document amendments</a:documentation>
2081
2024
  <zeroOrMore>
2082
2025
  <choice>
2083
2026
  <ref name="PureTextElement"/>
2084
- <ref name="stem"/>
2085
2027
  <ref name="index"/>
2086
2028
  <ref name="index-xref"/>
2087
2029
  </choice>
@@ -2291,6 +2233,11 @@ used in document amendments</a:documentation>
2291
2233
  <ref name="RequiredId"/>
2292
2234
  <ref name="NumberingAttributes"/>
2293
2235
  <ref name="BlockAttributes"/>
2236
+ <optional>
2237
+ <attribute name="type">
2238
+ <a:documentation>Semantic classification of note</a:documentation>
2239
+ </attribute>
2240
+ </optional>
2294
2241
  <oneOrMore>
2295
2242
  <choice>
2296
2243
  <a:documentation>Content of the term note</a:documentation>
@@ -17,16 +17,6 @@
17
17
  <value>policy</value>
18
18
  </choice>
19
19
  </define>
20
- <define name="editorialgroup">
21
- <element name="editorialgroup">
22
- <oneOrMore>
23
- <ref name="committee"/>
24
- </oneOrMore>
25
- <zeroOrMore>
26
- <ref name="workgroup"/>
27
- </zeroOrMore>
28
- </element>
29
- </define>
30
20
  <define name="structuredidentifier">
31
21
  <element name="structuredidentifier">
32
22
  <element name="docnumber">
@@ -91,41 +81,6 @@
91
81
  </choice>
92
82
  </element>
93
83
  </define>
94
- <define name="committee">
95
- <element name="committee">
96
- <attribute name="acronym">
97
- <choice>
98
- <value>CGPM</value>
99
- <value>CIPM</value>
100
- <value>BIPM</value>
101
- <value>CCAUV</value>
102
- <value>CCEM</value>
103
- <value>CCL</value>
104
- <value>CCM</value>
105
- <value>CCPR</value>
106
- <value>CCQM</value>
107
- <value>CCRI</value>
108
- <value>CCT</value>
109
- <value>CCTF</value>
110
- <value>CCU</value>
111
- <value>CCL-CCTF-WGFS</value>
112
- <value>JCGM</value>
113
- <value>JCRB</value>
114
- <value>JCTLM</value>
115
- <value>INetQI</value>
116
- </choice>
117
- </attribute>
118
- <ref name="LocalizedString"/>
119
- </element>
120
- </define>
121
- <define name="workgroup">
122
- <element name="workgroup">
123
- <optional>
124
- <attribute name="acronym"/>
125
- </optional>
126
- <text/>
127
- </element>
128
- </define>
129
84
  <define name="meeting-note">
130
85
  <element name="meeting-note">
131
86
  <text/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Bipm
3
- VERSION = "2.7.1".freeze
3
+ VERSION = "2.7.3".freeze
4
4
  end
5
5
  end
@@ -42,5 +42,5 @@ spec.add_development_dependency "rubocop-performance"
42
42
  spec.add_development_dependency "simplecov", "~> 0.15"
43
43
  spec.add_development_dependency "timecop", "~> 0.9"
44
44
  spec.add_development_dependency "webmock"
45
- spec.add_development_dependency "xml-c14n"
45
+ spec.add_development_dependency "canon"
46
46
  end
data/metanorma.yml CHANGED
@@ -97,6 +97,9 @@ committees:
97
97
  - Comité commun pour la traçabilité en médecine de laboratoire
98
98
  - INetQI
99
99
  - International Network on Quality Infrastructure
100
+ committee_types:
101
+ - committee
102
+ - workgroup
100
103
  metadata_extensions:
101
104
  structuredidentifier:
102
105
  docnumber:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-07-21 00:00:00.000000000 Z
11
+ date: 2025-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -207,7 +207,7 @@ dependencies:
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  - !ruby/object:Gem::Dependency
210
- name: xml-c14n
210
+ name: canon
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - ">="