metanorma-generic 3.1.2 → 3.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c50b039e644c1672d5e945c482602c872a21bceff11ac3f7d4d9d768639b81b1
4
- data.tar.gz: 3fbcdb088cf39e43227dc48cc23874af81829e743d7a583e3408300f06dfbad8
3
+ metadata.gz: 02271ab979ae1b84b53ca3112e5e3cae9d98eceb5b575dd030f20a261b2ad734
4
+ data.tar.gz: '0893a275a0feb6027bb51f7b1437bc6317b9bc90027bac8e0ace8cfc2d55912d'
5
5
  SHA512:
6
- metadata.gz: 11057878ee61b576be907979f6db2d66a30dea8b19b886e1aacce53d50b254bf989369b4f50d16cd1a16643412936b21d76d2f41b74e9e1cd0dd94316913615d
7
- data.tar.gz: 5a7b58efe110889513dd6621fdd3bfc365b8eb2df02b91ca5ccad467dce4fd7ebb3a70b38e3257a2e3ed50e1a6e7fd9d1367efedc73450d5a8d0d53ec187c74b
6
+ metadata.gz: b0d2736096d9be12eed06c33b4c2ca9e8511aac8868e4036488e197fafa4bfd015bea9de1533da0e8ba7743aa5fb2690cf44ee5d7c3fbe14a647419817df73ec
7
+ data.tar.gz: e17f63256ce28036017aaee6ce37601ac595eaca68f7ae2917f46141e774c985ba88e33c95c175d4d111d491fe036f2049bd3da23ae7f61e29658e2c73c00a57
@@ -53,21 +53,15 @@ module IsoDoc
53
53
 
54
54
  def author(isoxml, _out)
55
55
  super
56
- tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
56
+ tc = isoxml.at(ns("//bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Committee']/name"))
57
57
  set(:tc, tc.text) if tc
58
58
  end
59
59
 
60
60
  def stage_abbr(status)
61
- return super unless configuration.stage_abbreviations
62
-
61
+ configuration.stage_abbreviations or return super
63
62
  Hash(configuration.stage_abbreviations).dig(status)
64
63
  end
65
64
 
66
- def unpublished(status)
67
- stages = configuration&.published_stages || ["published"]
68
- !(Array(stages).map { |m| m.downcase }.include? status.downcase)
69
- end
70
-
71
65
  def doctype(isoxml, _out)
72
66
  super
73
67
  b = isoxml&.at(ns("//bibdata/ext/doctype#{currlang}")) ||
@@ -77,10 +71,8 @@ module IsoDoc
77
71
 
78
72
  def xmlhash2hash(hash)
79
73
  ret = {}
80
- return ret if hash.nil? || hash[:kind] != "element"
81
-
82
- hash[:attr].nil? or
83
- hash[:attr].each { |k, v| ret["#{hash[:name]}_#{k}"] = v }
74
+ hash.nil? || hash[:kind] != "element" and return ret
75
+ hash[:attr]&.each { |k, v| ret["#{hash[:name]}_#{k}"] = v }
84
76
  ret[hash[:name]] = hash[:kids] ? xmlhash2hash_kids(hash) : hash[:text]
85
77
  ret
86
78
  end
@@ -76,12 +76,6 @@ from other documents in the same doctype</a:documentation>
76
76
  <ref name="flavor">
77
77
  <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
78
78
  </ref>
79
- <optional>
80
- <ref name="editorialgroup">
81
- <a:documentation>Groups associated with the production of the standards document, typically within
82
- a standards definition organization</a:documentation>
83
- </ref>
84
- </optional>
85
79
  <zeroOrMore>
86
80
  <ref name="ics">
87
81
  <a:documentation>Classification of the document contents taken from the International Classification of Standards</a:documentation>
@@ -130,49 +124,6 @@ a standards definition organization</a:documentation>
130
124
  However we prefer not to hardcode it, given ongoing extension.</a:documentation>
131
125
  <text/>
132
126
  </define>
133
- <define name="editorialgroup">
134
- <a:documentation>A group associated with the production of the standards document, typically within
135
- a standards definition organization</a:documentation>
136
- <element name="editorialgroup">
137
- <oneOrMore>
138
- <ref name="technical-committee">
139
- <a:documentation>A technical committee associated with the production of the standards document</a:documentation>
140
- </ref>
141
- </oneOrMore>
142
- </element>
143
- </define>
144
- <define name="technical-committee">
145
- <a:documentation>Technical committee associated with the production of a standards document</a:documentation>
146
- <element name="technical-committee">
147
- <ref name="IsoWorkgroup"/>
148
- </element>
149
- </define>
150
- <define name="IsoWorkgroup">
151
- <optional>
152
- <attribute name="number">
153
- <a:documentation>Numeric identifier of the technical committee</a:documentation>
154
- </attribute>
155
- </optional>
156
- <optional>
157
- <attribute name="type">
158
- <a:documentation>Type of the technical committee, used in identifying the technical committee</a:documentation>
159
- </attribute>
160
- </optional>
161
- <optional>
162
- <attribute name="identifier">
163
- <a:documentation>Non-numeric, complete identifier of the technical committee</a:documentation>
164
- </attribute>
165
- </optional>
166
- <optional>
167
- <attribute name="prefix">
168
- <a:documentation>Disambiguating prefix added to number to form the identifier of the technical committee,
169
- typically indicating its type</a:documentation>
170
- </attribute>
171
- </optional>
172
- <text>
173
- <a:documentation>Name of the technical committee</a:documentation>
174
- </text>
175
- </define>
176
127
  <define name="ics">
177
128
  <a:documentation>Classification taken from the International Classification of Standards.
178
129
  ICS is defined by ISO here -- https://www.iso.org/publication/PUB100033.html</a:documentation>
@@ -242,6 +242,8 @@ Detailed in https://www.relaton.org/model/creator/</a:documentation>
242
242
  </choice>
243
243
  </define>
244
244
  <define name="roledescription">
245
+ <a:documentation>A more detailed description of the role of the contributor
246
+ Some descriptions are reserved words; in particular, the editorial committee of a standard has the role description "committee"</a:documentation>
245
247
  <element name="description">
246
248
  <ref name="LocalizedMarkedUpString"/>
247
249
  </element>
@@ -443,7 +445,10 @@ real names (if the person is named with a pseudonym or user name); previous lega
443
445
  </oneOrMore>
444
446
  <zeroOrMore>
445
447
  <ref name="subdivision">
446
- <a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item</a:documentation>
448
+ <a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item.
449
+ Multiple subdivisions can be specified for an organization, with no implication of hierarchical
450
+ relation between them
451
+ Editorial and advisory groups are represented as consecutive subdivisions of the SDO</a:documentation>
447
452
  </ref>
448
453
  </zeroOrMore>
449
454
  <optional>
@@ -485,6 +490,11 @@ real names (if the person is named with a pseudonym or user name); previous lega
485
490
  <a:documentation>The type of subdivision</a:documentation>
486
491
  </attribute>
487
492
  </optional>
493
+ <optional>
494
+ <attribute name="subtype">
495
+ <a:documentation>The subtype of subdivision; e.g. different types of technical committee</a:documentation>
496
+ </attribute>
497
+ </optional>
488
498
  <ref name="OrganizationType">
489
499
  <a:documentation>The subdivision, modelled recursively as an organization</a:documentation>
490
500
  </ref>
@@ -121,7 +121,8 @@ module Metanorma
121
121
  def committee_validate(xmldoc)
122
122
  committees = Array(configuration&.committees) || return
123
123
  committees.empty? and return
124
- xmldoc.xpath("//bibdata/ext/editorialgroup/committee").each do |c|
124
+ xmldoc.xpath("//bibdata/contributor[role/description = 'committee']/" \
125
+ "organization/subdivision/name").each do |c|
125
126
  committees.include? c.text or
126
127
  @log.add("Document Attributes", nil,
127
128
  "#{c.text} is not a recognised committee")
@@ -182,6 +183,11 @@ module Metanorma
182
183
  f.is_a? Hash and f[@lang] and return baselocation(f[@lang])
183
184
  super
184
185
  end
186
+
187
+ def published?(status, _xmldoc)
188
+ stages = configuration&.published_stages || ["published"]
189
+ (Array(stages).map(&:downcase).include? status.downcase)
190
+ end
185
191
  end
186
192
  end
187
193
  end
@@ -21,18 +21,8 @@ module Metanorma
21
21
  Array(configuration.relations) || []
22
22
  end
23
23
 
24
- def metadata_committee(node, xml)
25
- node.attr("committee") or return
26
- xml.editorialgroup do |a|
27
- a.committee node.attr("committee"),
28
- **attr_code(type: node.attr("committee-type"))
29
- i = 2
30
- while node.attr("committee_#{i}")
31
- a.committee node.attr("committee_#{i}"),
32
- **attr_code(type: node.attr("committee-type_#{i}"))
33
- i += 1
34
- end
35
- end
24
+ def metadata_committee_types(_node)
25
+ Array(configuration.committee_types || "committee")
36
26
  end
37
27
 
38
28
  def metadata_status(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
@@ -2233,6 +2233,11 @@ used in document amendments</a:documentation>
2233
2233
  <ref name="RequiredId"/>
2234
2234
  <ref name="NumberingAttributes"/>
2235
2235
  <ref name="BlockAttributes"/>
2236
+ <optional>
2237
+ <attribute name="type">
2238
+ <a:documentation>Semantic classification of note</a:documentation>
2239
+ </attribute>
2240
+ </optional>
2236
2241
  <oneOrMore>
2237
2242
  <choice>
2238
2243
  <a:documentation>Content of the term note</a:documentation>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Generic
3
- VERSION = "3.1.2".freeze
3
+ VERSION = "3.1.3".freeze
4
4
  end
5
5
  end
@@ -21,6 +21,7 @@ module Metanorma
21
21
  bibliography_titles
22
22
  boilerplate
23
23
  committees
24
+ committee_types
24
25
  document_namespace
25
26
  docid_template
26
27
  doctypes
@@ -42,6 +42,9 @@ metadata_extensions:
42
42
  - security
43
43
  published_stages:
44
44
  - published
45
+ committee_types:
46
+ - Committee
47
+ - Workgroup
45
48
  committees:
46
49
  - TC 1
47
50
  relations:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-generic
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.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-08-04 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-standoc