relaton-bsi 1.13.0 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,233 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <include href="biblio-standoc.rng">
4
+ <define name="BibDataExtensionType">
5
+ <optional>
6
+ <attribute name="schema-version"/>
7
+ </optional>
8
+ <ref name="doctype"/>
9
+ <optional>
10
+ <ref name="docsubtype"/>
11
+ </optional>
12
+ <ref name="editorialgroup"/>
13
+ <zeroOrMore>
14
+ <ref name="ics"/>
15
+ </zeroOrMore>
16
+ <ref name="structuredidentifier"/>
17
+ <optional>
18
+ <ref name="stagename"/>
19
+ </optional>
20
+ <zeroOrMore>
21
+ <ref name="coverimages"/>
22
+ </zeroOrMore>
23
+ </define>
24
+ <define name="bdate">
25
+ <element name="date">
26
+ <attribute name="type">
27
+ <choice>
28
+ <ref name="BibliographicDateType"/>
29
+ <text/>
30
+ </choice>
31
+ </attribute>
32
+ <choice>
33
+ <group>
34
+ <element name="from">
35
+ <ref name="ISO8601Date"/>
36
+ </element>
37
+ <optional>
38
+ <element name="to">
39
+ <ref name="ISO8601Date"/>
40
+ </element>
41
+ </optional>
42
+ </group>
43
+ <element name="on">
44
+ <choice>
45
+ <ref name="ISO8601Date"/>
46
+ <value>--</value>
47
+ <value>–</value>
48
+ </choice>
49
+ </element>
50
+ </choice>
51
+ </element>
52
+ </define>
53
+ <define name="organization">
54
+ <element name="organization">
55
+ <oneOrMore>
56
+ <ref name="orgname"/>
57
+ </oneOrMore>
58
+ <optional>
59
+ <ref name="abbreviation"/>
60
+ </optional>
61
+ <optional>
62
+ <ref name="uri"/>
63
+ </optional>
64
+ <zeroOrMore>
65
+ <ref name="org-identifier"/>
66
+ </zeroOrMore>
67
+ <zeroOrMore>
68
+ <ref name="contact"/>
69
+ </zeroOrMore>
70
+ <optional>
71
+ <ref name="technical-committee"/>
72
+ </optional>
73
+ <optional>
74
+ <ref name="subcommittee"/>
75
+ </optional>
76
+ <optional>
77
+ <ref name="workgroup"/>
78
+ </optional>
79
+ <optional>
80
+ <ref name="secretariat"/>
81
+ </optional>
82
+ </element>
83
+ </define>
84
+ <define name="DocumentType">
85
+ <choice>
86
+ <value>british-standard</value>
87
+ <value>draft-for-development</value>
88
+ <value>published-document</value>
89
+ <value>privately-subscribed-standard</value>
90
+ <value>publicly-available-specification</value>
91
+ <value>flex-standard</value>
92
+ <value>international-standard</value>
93
+ <value>technical-specification</value>
94
+ <value>technical-report</value>
95
+ <value>guide</value>
96
+ <value>international-workshop-agreement</value>
97
+ <value>industry-technical-agreement</value>
98
+ <value>standard</value>
99
+ <value>european-workshop-agreement</value>
100
+ <value>fast-track-standard</value>
101
+ </choice>
102
+ </define>
103
+ <define name="DocumentSubtype">
104
+ <choice>
105
+ <value>specification</value>
106
+ <value>method-of-test</value>
107
+ <value>method-of-specifying</value>
108
+ <value>vocabulary</value>
109
+ <value>code-of-practice</value>
110
+ </choice>
111
+ </define>
112
+ <define name="structuredidentifier">
113
+ <element name="structuredidentifier">
114
+ <optional>
115
+ <attribute name="type"/>
116
+ </optional>
117
+ <group>
118
+ <ref name="documentnumber"/>
119
+ <optional>
120
+ <ref name="tc-documentnumber"/>
121
+ </optional>
122
+ </group>
123
+ </element>
124
+ </define>
125
+ <define name="editorialgroup">
126
+ <element name="editorialgroup">
127
+ <ref name="ISOProjectGroup"/>
128
+ </element>
129
+ </define>
130
+ </include>
131
+ <define name="updates_document_type">
132
+ <element name="updates-document-type">
133
+ <ref name="DocumentType"/>
134
+ </element>
135
+ </define>
136
+ <define name="ISOProjectGroup">
137
+ <zeroOrMore>
138
+ <ref name="agency"/>
139
+ </zeroOrMore>
140
+ <oneOrMore>
141
+ <ref name="technical-committee"/>
142
+ </oneOrMore>
143
+ <zeroOrMore>
144
+ <ref name="subcommittee"/>
145
+ </zeroOrMore>
146
+ <zeroOrMore>
147
+ <ref name="workgroup"/>
148
+ </zeroOrMore>
149
+ <optional>
150
+ <ref name="secretariat"/>
151
+ </optional>
152
+ </define>
153
+ <define name="approvalgroup">
154
+ <element name="approvalgroup">
155
+ <ref name="ISOProjectGroup"/>
156
+ </element>
157
+ </define>
158
+ <define name="agency">
159
+ <element name="agency">
160
+ <text/>
161
+ </element>
162
+ </define>
163
+ <define name="horizontal">
164
+ <element name="horizontal">
165
+ <data type="boolean"/>
166
+ </element>
167
+ </define>
168
+ <define name="documentnumber">
169
+ <element name="project-number">
170
+ <optional>
171
+ <attribute name="part">
172
+ <data type="int"/>
173
+ </attribute>
174
+ </optional>
175
+ <optional>
176
+ <attribute name="subpart">
177
+ <data type="int"/>
178
+ </attribute>
179
+ </optional>
180
+ <optional>
181
+ <attribute name="amendment">
182
+ <data type="int"/>
183
+ </attribute>
184
+ </optional>
185
+ <optional>
186
+ <attribute name="corrigendum">
187
+ <data type="int"/>
188
+ </attribute>
189
+ </optional>
190
+ <optional>
191
+ <attribute name="origyr">
192
+ <ref name="ISO8601Date"/>
193
+ </attribute>
194
+ </optional>
195
+ <text/>
196
+ </element>
197
+ </define>
198
+ <define name="tc-documentnumber">
199
+ <element name="tc-document-number">
200
+ <data type="int"/>
201
+ </element>
202
+ </define>
203
+ <define name="subcommittee">
204
+ <element name="subcommittee">
205
+ <ref name="IsoWorkgroup"/>
206
+ </element>
207
+ </define>
208
+ <define name="workgroup">
209
+ <element name="workgroup">
210
+ <ref name="IsoWorkgroup"/>
211
+ </element>
212
+ </define>
213
+ <define name="secretariat">
214
+ <element name="secretariat">
215
+ <text/>
216
+ </element>
217
+ </define>
218
+ <define name="stagename">
219
+ <element name="stagename">
220
+ <optional>
221
+ <attribute name="abbreviation"/>
222
+ </optional>
223
+ <text/>
224
+ </element>
225
+ </define>
226
+ <define name="coverimages">
227
+ <element name="coverimages">
228
+ <oneOrMore>
229
+ <ref name="image"/>
230
+ </oneOrMore>
231
+ </element>
232
+ </define>
233
+ </grammar>
@@ -1,6 +1,6 @@
1
1
  module RelatonBsi
2
2
  class BsiBibliographicItem < RelatonIsoBib::IsoBibliographicItem
3
- TYPES = %w[
3
+ DOCTYPES = %w[
4
4
  british-standard draft-for-development published-document privately-subscribed-standard
5
5
  publicly-available-specification flex-standard international-standard technical-specification
6
6
  technical-report guide international-workshop-agreement industry-technical-agreement
@@ -23,6 +23,15 @@ module RelatonBsi
23
23
  super
24
24
  end
25
25
 
26
+ #
27
+ # Fetch flavor schema version
28
+ #
29
+ # @return [String] flavor schema version
30
+ #
31
+ def ext_schema
32
+ @ext_schema ||= schema_versions["relaton-model-bsi"]
33
+ end
34
+
26
35
  # @param opts [Hash]
27
36
  # @option opts [Nokogiri::XML::Builder] :builder XML builder
28
37
  # @option opts [Boolean] :bibdata
@@ -30,9 +39,8 @@ module RelatonBsi
30
39
  # @return [String] XML
31
40
  def to_xml(**opts) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
32
41
  super(**opts) do |b|
33
- if opts[:bibdata] && (has_ext_attrs? || price_code ||
34
- !cen_processing.nil?)
35
- b.ext do
42
+ if opts[:bibdata] && (has_ext_attrs? || price_code || !cen_processing.nil?)
43
+ ext = b.ext do
36
44
  b.doctype doctype if doctype
37
45
  b.horizontal horizontal unless horizontal.nil?
38
46
  editorialgroup&.to_xml b
@@ -40,6 +48,7 @@ module RelatonBsi
40
48
  structuredidentifier&.to_xml b
41
49
  b.stagename stagename if stagename
42
50
  end
51
+ ext["schema-version"] = ext_schema unless opts[:embeded]
43
52
  end
44
53
  end
45
54
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonBsi
4
- VERSION = "1.13.0"
4
+ VERSION = "1.14.0"
5
5
  end
data/relaton_bsi.gemspec CHANGED
@@ -40,5 +40,5 @@ Gem::Specification.new do |spec|
40
40
  spec.add_dependency "graphql", "1.13.6"
41
41
  spec.add_dependency "graphql-client", "~> 0.16.0"
42
42
  # spec.add_dependency "mechanize", "~> 2.8.0"
43
- spec.add_dependency "relaton-iso-bib", "~> 1.13.0"
43
+ spec.add_dependency "relaton-iso-bib", "~> 1.14.0"
44
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-bsi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-21 00:00:00.000000000 Z
11
+ date: 2022-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.13.0
145
+ version: 1.14.0
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 1.13.0
152
+ version: 1.14.0
153
153
  description: 'RelatonBsi: retrieve BSI Standards for bibliographic use using the BibliographicItem
154
154
  model'
155
155
  email:
@@ -159,6 +159,7 @@ extensions: []
159
159
  extra_rdoc_files: []
160
160
  files:
161
161
  - ".github/workflows/rake.yml"
162
+ - ".github/workflows/release.yml"
162
163
  - ".gitignore"
163
164
  - ".rspec"
164
165
  - ".rubocop.yml"
@@ -170,11 +171,10 @@ files:
170
171
  - bin/rspec
171
172
  - bin/setup
172
173
  - grammars/basicdoc.rng
174
+ - grammars/biblio-standoc.rng
173
175
  - grammars/biblio.rng
174
- - grammars/bsi.rng
175
- - grammars/isodoc.rng
176
- - grammars/isostandard.rng
177
- - grammars/reqt.rng
176
+ - grammars/relaton-bsi-compile.rng
177
+ - grammars/relaton-bsi.rng
178
178
  - lib/relaton_bsi.rb
179
179
  - lib/relaton_bsi/bsi_bibliographic_item.rb
180
180
  - lib/relaton_bsi/bsi_bibliography.rb
data/grammars/bsi.rng DELETED
@@ -1,343 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- default namespace = "https://www.metanorma.com/ns/bsi" -->
4
- <include href="isostandard.rng">
5
- <start>
6
- <ref name="bsi-standard"/>
7
- </start>
8
- <define name="DocumentType">
9
- <choice>
10
- <value>british-standard</value>
11
- <value>draft-for-development</value>
12
- <value>published-document</value>
13
- <value>privately-subscribed-standard</value>
14
- <value>publicly-available-specification</value>
15
- <value>flex-standard</value>
16
- <value>international-standard</value>
17
- <value>technical-specification</value>
18
- <value>technical-report</value>
19
- <value>guide</value>
20
- <value>international-workshop-agreement</value>
21
- <value>industry-technical-agreement</value>
22
- <value>standard</value>
23
- <value>european-workshop-agreement</value>
24
- <value>fast-track-standard</value>
25
- </choice>
26
- </define>
27
- <define name="DocumentSubtype">
28
- <choice>
29
- <value>specification</value>
30
- <value>method-of-test</value>
31
- <value>method-of-specifying</value>
32
- <value>vocabulary</value>
33
- <value>code-of-practice</value>
34
- </choice>
35
- </define>
36
- <define name="BibDataExtensionType">
37
- <ref name="doctype"/>
38
- <optional>
39
- <ref name="docsubtype"/>
40
- </optional>
41
- <ref name="editorialgroup"/>
42
- <zeroOrMore>
43
- <ref name="ics"/>
44
- </zeroOrMore>
45
- <ref name="structuredidentifier"/>
46
- <optional>
47
- <ref name="stagename"/>
48
- </optional>
49
- <zeroOrMore>
50
- <ref name="coverimages"/>
51
- </zeroOrMore>
52
- </define>
53
- <define name="admonition">
54
- <element name="admonition">
55
- <attribute name="type">
56
- <ref name="AdmonitionType"/>
57
- </attribute>
58
- <optional>
59
- <attribute name="class"/>
60
- </optional>
61
- <attribute name="id">
62
- <data type="ID"/>
63
- </attribute>
64
- <optional>
65
- <attribute name="target">
66
- <data type="IDREF"/>
67
- </attribute>
68
- </optional>
69
- <optional>
70
- <attribute name="uri">
71
- <data type="anyURI"/>
72
- </attribute>
73
- </optional>
74
- <optional>
75
- <attribute name="coverpage">
76
- <data type="boolean"/>
77
- </attribute>
78
- </optional>
79
- <optional>
80
- <attribute name="notag">
81
- <data type="boolean"/>
82
- </attribute>
83
- </optional>
84
- <optional>
85
- <ref name="tname"/>
86
- </optional>
87
- <zeroOrMore>
88
- <ref name="paragraph-with-footnote"/>
89
- </zeroOrMore>
90
- <zeroOrMore>
91
- <ref name="note"/>
92
- </zeroOrMore>
93
- </element>
94
- </define>
95
- <define name="Clause-Section">
96
- <optional>
97
- <attribute name="id">
98
- <data type="ID"/>
99
- </attribute>
100
- </optional>
101
- <optional>
102
- <attribute name="language"/>
103
- </optional>
104
- <optional>
105
- <attribute name="script"/>
106
- </optional>
107
- <optional>
108
- <attribute name="inline-header">
109
- <data type="boolean"/>
110
- </attribute>
111
- </optional>
112
- <optional>
113
- <attribute name="obligation">
114
- <choice>
115
- <value>normative</value>
116
- <value>informative</value>
117
- </choice>
118
- </attribute>
119
- </optional>
120
- <optional>
121
- <attribute name="type"/>
122
- </optional>
123
- <optional>
124
- <ref name="section-title"/>
125
- </optional>
126
- <choice>
127
- <choice>
128
- <oneOrMore>
129
- <ref name="BasicBlock"/>
130
- </oneOrMore>
131
- <ref name="amend"/>
132
- </choice>
133
- <oneOrMore>
134
- <choice>
135
- <ref name="clause-subsection"/>
136
- <ref name="floating-title"/>
137
- </choice>
138
- </oneOrMore>
139
- </choice>
140
- </define>
141
- <define name="annex">
142
- <element name="annex">
143
- <optional>
144
- <attribute name="id">
145
- <data type="ID"/>
146
- </attribute>
147
- </optional>
148
- <optional>
149
- <attribute name="language"/>
150
- </optional>
151
- <optional>
152
- <attribute name="script"/>
153
- </optional>
154
- <optional>
155
- <attribute name="inline-header">
156
- <data type="boolean"/>
157
- </attribute>
158
- </optional>
159
- <optional>
160
- <attribute name="obligation">
161
- <choice>
162
- <value>normative</value>
163
- <value>informative</value>
164
- </choice>
165
- </attribute>
166
- </optional>
167
- <optional>
168
- <ref name="section-title"/>
169
- </optional>
170
- <zeroOrMore>
171
- <!--
172
- allow hanging paragraps in annexes: they introduce lists
173
- ( paragraph-with-footnote | table | note | formula | admonition | ol | ul | dl | figure | quote | sourcecode | review | example )*,
174
- -->
175
- <ref name="BasicBlock"/>
176
- </zeroOrMore>
177
- <zeroOrMore>
178
- <choice>
179
- <ref name="clause-hanging-paragraph-with-footnote"/>
180
- <ref name="floating-title"/>
181
- </choice>
182
- </zeroOrMore>
183
- <zeroOrMore>
184
- <ref name="annex-appendix"/>
185
- </zeroOrMore>
186
- </element>
187
- </define>
188
- <define name="clause-hanging-paragraph-with-footnote">
189
- <element name="clause">
190
- <optional>
191
- <attribute name="id">
192
- <data type="ID"/>
193
- </attribute>
194
- </optional>
195
- <optional>
196
- <attribute name="language"/>
197
- </optional>
198
- <optional>
199
- <attribute name="script"/>
200
- </optional>
201
- <optional>
202
- <attribute name="inline-header">
203
- <data type="boolean"/>
204
- </attribute>
205
- </optional>
206
- <optional>
207
- <attribute name="obligation">
208
- <choice>
209
- <value>normative</value>
210
- <value>informative</value>
211
- </choice>
212
- </attribute>
213
- </optional>
214
- <optional>
215
- <ref name="section-title"/>
216
- </optional>
217
- <zeroOrMore>
218
- <!-- allow hanging paragraphs in annexes: they introduce lists -->
219
- <ref name="BasicBlock"/>
220
- </zeroOrMore>
221
- <zeroOrMore>
222
- <choice>
223
- <ref name="clause-hanging-paragraph-with-footnote"/>
224
- <ref name="floating-title"/>
225
- </choice>
226
- </zeroOrMore>
227
- </element>
228
- </define>
229
- <define name="sections">
230
- <element name="sections">
231
- <zeroOrMore>
232
- <choice>
233
- <ref name="note"/>
234
- <ref name="admonition"/>
235
- </choice>
236
- </zeroOrMore>
237
- <optional>
238
- <choice>
239
- <ref name="floating-title"/>
240
- <ref name="floating-section-title"/>
241
- </choice>
242
- </optional>
243
- <ref name="clause"/>
244
- <optional>
245
- <choice>
246
- <ref name="floating-title"/>
247
- <ref name="floating-section-title"/>
248
- </choice>
249
- </optional>
250
- <optional>
251
- <choice>
252
- <ref name="term-clause"/>
253
- <ref name="terms"/>
254
- </choice>
255
- </optional>
256
- <optional>
257
- <choice>
258
- <ref name="floating-title"/>
259
- <ref name="floating-section-title"/>
260
- </choice>
261
- </optional>
262
- <optional>
263
- <ref name="definitions"/>
264
- </optional>
265
- <optional>
266
- <choice>
267
- <ref name="floating-title"/>
268
- <ref name="floating-section-title"/>
269
- </choice>
270
- </optional>
271
- <oneOrMore>
272
- <choice>
273
- <ref name="clause"/>
274
- <ref name="term-clause"/>
275
- <ref name="terms"/>
276
- <ref name="floating-title"/>
277
- <ref name="floating-section-title"/>
278
- </choice>
279
- </oneOrMore>
280
- </element>
281
- </define>
282
- </include>
283
- <!-- end overrides -->
284
- <define name="floating-section-title">
285
- <element name="section-title">
286
- <attribute name="id">
287
- <data type="ID"/>
288
- </attribute>
289
- <attribute name="depth">
290
- <data type="int"/>
291
- </attribute>
292
- <zeroOrMore>
293
- <ref name="TextElement"/>
294
- </zeroOrMore>
295
- </element>
296
- </define>
297
- <define name="AdmonitionType" combine="choice">
298
- <value>commentary</value>
299
- </define>
300
- <define name="coverimages">
301
- <element name="coverimages">
302
- <oneOrMore>
303
- <ref name="image"/>
304
- </oneOrMore>
305
- </element>
306
- </define>
307
- <!--
308
- We display the Normative References between scope and terms; but to keep the
309
- grammar simple, we keep the references together
310
- -->
311
- <define name="bsi-standard">
312
- <element name="bsi-standard">
313
- <attribute name="version"/>
314
- <attribute name="type">
315
- <choice>
316
- <value>semantic</value>
317
- <value>presentation</value>
318
- </choice>
319
- </attribute>
320
- <ref name="bibdata"/>
321
- <zeroOrMore>
322
- <ref name="termdocsource"/>
323
- </zeroOrMore>
324
- <optional>
325
- <ref name="misccontainer"/>
326
- </optional>
327
- <optional>
328
- <ref name="boilerplate"/>
329
- </optional>
330
- <ref name="preface"/>
331
- <oneOrMore>
332
- <ref name="sections"/>
333
- </oneOrMore>
334
- <zeroOrMore>
335
- <ref name="annex"/>
336
- </zeroOrMore>
337
- <ref name="bibliography"/>
338
- <zeroOrMore>
339
- <ref name="indexsect"/>
340
- </zeroOrMore>
341
- </element>
342
- </define>
343
- </grammar>