metanorma-bipm 2.1.10 → 2.1.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <include href="biblio.rng">
4
- <start>
5
- <ref name="document"/>
6
- </start>
7
- </include>
8
3
  <define name="document">
9
4
  <element name="document">
10
5
  <optional>
@@ -1125,26 +1120,4 @@
1125
1120
  </zeroOrMore>
1126
1121
  </element>
1127
1122
  </define>
1128
- <define name="ext">
1129
- <element name="ext">
1130
- <ref name="BibDataExtensionType"/>
1131
- </element>
1132
- </define>
1133
- <define name="BibDataExtensionType">
1134
- <ref name="doctype"/>
1135
- </define>
1136
- <define name="doctype">
1137
- <element name="doctype">
1138
- <ref name="DocumentType"/>
1139
- </element>
1140
- </define>
1141
- <define name="DocumentType">
1142
- <value>document</value>
1143
- </define>
1144
- <define name="BibData">
1145
- <ref name="BibliographicItem"/>
1146
- <optional>
1147
- <ref name="ext"/>
1148
- </optional>
1149
- </define>
1150
1123
  </grammar>
@@ -0,0 +1,164 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0">
3
+ <!--
4
+ Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
5
+ of relaton
6
+
7
+ Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
8
+ (SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
9
+ -->
10
+ <include href="biblio.rng">
11
+ <define name="BibData">
12
+ <ref name="BibliographicItem"/>
13
+ <optional>
14
+ <ref name="ext"/>
15
+ </optional>
16
+ </define>
17
+ </include>
18
+ <define name="ext">
19
+ <element name="ext">
20
+ <ref name="BibDataExtensionType"/>
21
+ </element>
22
+ </define>
23
+ <define name="BibDataExtensionType">
24
+ <optional>
25
+ <attribute name="schema-version"/>
26
+ </optional>
27
+ <ref name="doctype"/>
28
+ <optional>
29
+ <ref name="docsubtype"/>
30
+ </optional>
31
+ <optional>
32
+ <ref name="editorialgroup"/>
33
+ </optional>
34
+ <zeroOrMore>
35
+ <ref name="ics"/>
36
+ </zeroOrMore>
37
+ <zeroOrMore>
38
+ <ref name="structuredidentifier"/>
39
+ </zeroOrMore>
40
+ </define>
41
+ <define name="doctype">
42
+ <element name="doctype">
43
+ <optional>
44
+ <attribute name="abbreviation"/>
45
+ </optional>
46
+ <ref name="DocumentType"/>
47
+ </element>
48
+ </define>
49
+ <define name="DocumentType">
50
+ <value>document</value>
51
+ </define>
52
+ <define name="docsubtype">
53
+ <element name="subdoctype">
54
+ <ref name="DocumentSubtype"/>
55
+ </element>
56
+ </define>
57
+ <define name="DocumentSubtype">
58
+ <text/>
59
+ </define>
60
+ <define name="editorialgroup">
61
+ <element name="editorialgroup">
62
+ <oneOrMore>
63
+ <ref name="technical-committee"/>
64
+ </oneOrMore>
65
+ </element>
66
+ </define>
67
+ <define name="technical-committee">
68
+ <element name="technical-committee">
69
+ <ref name="IsoWorkgroup"/>
70
+ </element>
71
+ </define>
72
+ <define name="IsoWorkgroup">
73
+ <optional>
74
+ <attribute name="number"/>
75
+ </optional>
76
+ <optional>
77
+ <attribute name="type"/>
78
+ </optional>
79
+ <optional>
80
+ <attribute name="identifier"/>
81
+ </optional>
82
+ <optional>
83
+ <attribute name="prefix"/>
84
+ </optional>
85
+ <text/>
86
+ </define>
87
+ <define name="ics">
88
+ <element name="ics">
89
+ <element name="code">
90
+ <text/>
91
+ </element>
92
+ <optional>
93
+ <element name="text">
94
+ <text/>
95
+ </element>
96
+ </optional>
97
+ </element>
98
+ </define>
99
+ <define name="structuredidentifier">
100
+ <element name="structuredidentifier">
101
+ <optional>
102
+ <attribute name="type"/>
103
+ </optional>
104
+ <oneOrMore>
105
+ <element name="agency">
106
+ <text/>
107
+ </element>
108
+ </oneOrMore>
109
+ <optional>
110
+ <element name="class">
111
+ <text/>
112
+ </element>
113
+ </optional>
114
+ <element name="docnumber">
115
+ <text/>
116
+ </element>
117
+ <optional>
118
+ <element name="partnumber">
119
+ <text/>
120
+ </element>
121
+ </optional>
122
+ <optional>
123
+ <element name="edition">
124
+ <text/>
125
+ </element>
126
+ </optional>
127
+ <optional>
128
+ <element name="version">
129
+ <text/>
130
+ </element>
131
+ </optional>
132
+ <optional>
133
+ <element name="supplementtype">
134
+ <text/>
135
+ </element>
136
+ </optional>
137
+ <optional>
138
+ <element name="supplementnumber">
139
+ <text/>
140
+ </element>
141
+ </optional>
142
+ <optional>
143
+ <element name="amendment">
144
+ <text/>
145
+ </element>
146
+ </optional>
147
+ <optional>
148
+ <element name="corrigendum">
149
+ <text/>
150
+ </element>
151
+ </optional>
152
+ <optional>
153
+ <element name="language">
154
+ <text/>
155
+ </element>
156
+ </optional>
157
+ <optional>
158
+ <element name="year">
159
+ <text/>
160
+ </element>
161
+ </optional>
162
+ </element>
163
+ </define>
164
+ </grammar>
@@ -33,9 +33,10 @@
33
33
  <param name="pattern">([\+\-]?\d{4})((-?)((0[1-9]|1[0-2])((-?)([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6]))))?</param>
34
34
  </data>
35
35
  </define>
36
- <start>
37
- <ref name="bibitem"/>
38
- </start>
36
+ <!-- start = bibitem -->
37
+ <define name="BibData">
38
+ <ref name="BibliographicItem"/>
39
+ </define>
39
40
  <define name="status">
40
41
  <element name="status">
41
42
  <ref name="stage"/>
@@ -170,27 +171,30 @@
170
171
  </define>
171
172
  <define name="contributor">
172
173
  <element name="contributor">
173
- <zeroOrMore>
174
+ <oneOrMore>
174
175
  <ref name="role"/>
175
- </zeroOrMore>
176
+ </oneOrMore>
176
177
  <ref name="ContributorInfo"/>
177
178
  </element>
178
179
  </define>
179
180
  <define name="role">
180
181
  <element name="role">
181
- <optional>
182
- <attribute name="type">
183
- <choice>
184
- <value>author</value>
185
- <value>performer</value>
186
- <value>publisher</value>
187
- <value>editor</value>
188
- <value>adapter</value>
189
- <value>translator</value>
190
- <value>distributor</value>
191
- </choice>
192
- </attribute>
193
- </optional>
182
+ <attribute name="type">
183
+ <choice>
184
+ <value>author</value>
185
+ <value>performer</value>
186
+ <value>publisher</value>
187
+ <value>editor</value>
188
+ <value>adapter</value>
189
+ <value>translator</value>
190
+ <value>distributor</value>
191
+ <value>realizer</value>
192
+ <value>owner</value>
193
+ <value>authorizer</value>
194
+ <value>enabler</value>
195
+ <value>subject</value>
196
+ </choice>
197
+ </attribute>
194
198
  <zeroOrMore>
195
199
  <ref name="roledescription"/>
196
200
  </zeroOrMore>
@@ -512,6 +516,17 @@
512
516
  </define>
513
517
  <define name="localityStack">
514
518
  <element name="localityStack">
519
+ <optional>
520
+ <attribute name="connective">
521
+ <choice>
522
+ <value>and</value>
523
+ <value>or</value>
524
+ <value>from</value>
525
+ <value>to</value>
526
+ <value/>
527
+ </choice>
528
+ </attribute>
529
+ </optional>
515
530
  <zeroOrMore>
516
531
  <ref name="locality"/>
517
532
  </zeroOrMore>
@@ -524,6 +539,17 @@
524
539
  </define>
525
540
  <define name="sourceLocalityStack">
526
541
  <element name="sourceLocalityStack">
542
+ <optional>
543
+ <attribute name="connective">
544
+ <choice>
545
+ <value>and</value>
546
+ <value>or</value>
547
+ <value>from</value>
548
+ <value>to</value>
549
+ <value/>
550
+ </choice>
551
+ </attribute>
552
+ </optional>
527
553
  <zeroOrMore>
528
554
  <ref name="sourceLocality"/>
529
555
  </zeroOrMore>
@@ -626,6 +652,9 @@
626
652
  <ref name="BibItemType"/>
627
653
  </attribute>
628
654
  </optional>
655
+ <optional>
656
+ <attribute name="schema-version"/>
657
+ </optional>
629
658
  <optional>
630
659
  <ref name="fetched"/>
631
660
  </optional>
@@ -720,6 +749,9 @@
720
749
  <ref name="BibItemType"/>
721
750
  </attribute>
722
751
  </optional>
752
+ <optional>
753
+ <attribute name="schema-version"/>
754
+ </optional>
723
755
  <optional>
724
756
  <ref name="fetched"/>
725
757
  </optional>
@@ -5,6 +5,7 @@
5
5
  we cannot have a new default namespace: we will end up with a grammar with two different
6
6
  namespaces, one for isostandard and one for csand additions. And we do not want that.
7
7
  -->
8
+ <include href="relaton-bipm.rng"/>
8
9
  <include href="isodoc.rng">
9
10
  <start>
10
11
  <ref name="bipm-standard"/>
@@ -209,137 +210,7 @@
209
210
  </zeroOrMore>
210
211
  </element>
211
212
  </define>
212
- <define name="DocumentType">
213
- <choice>
214
- <value>brochure</value>
215
- <value>mise-en-pratique</value>
216
- <value>rapport</value>
217
- <value>monographie</value>
218
- <value>guide</value>
219
- <value>meeting-report</value>
220
- <value>technical-report</value>
221
- <value>working-party-note</value>
222
- <value>strategy</value>
223
- <value>cipm-mra</value>
224
- <value>resolution</value>
225
- </choice>
226
- </define>
227
- <define name="editorialgroup">
228
- <element name="editorialgroup">
229
- <oneOrMore>
230
- <ref name="committee"/>
231
- </oneOrMore>
232
- <zeroOrMore>
233
- <ref name="workgroup"/>
234
- </zeroOrMore>
235
- </element>
236
- </define>
237
- <define name="structuredidentifier">
238
- <element name="structuredidentifier">
239
- <element name="docnumber">
240
- <text/>
241
- </element>
242
- <optional>
243
- <element name="part">
244
- <text/>
245
- </element>
246
- </optional>
247
- <optional>
248
- <element name="appendix">
249
- <text/>
250
- </element>
251
- </optional>
252
- </element>
253
- </define>
254
- <define name="BibDataExtensionType">
255
- <optional>
256
- <ref name="doctype"/>
257
- </optional>
258
- <optional>
259
- <ref name="docsubtype"/>
260
- </optional>
261
- <ref name="editorialgroup"/>
262
- <optional>
263
- <ref name="comment-period"/>
264
- </optional>
265
- <optional>
266
- <ref name="si-aspect"/>
267
- </optional>
268
- <optional>
269
- <ref name="meeting-note"/>
270
- </optional>
271
- <ref name="structuredidentifier"/>
272
- </define>
273
213
  </include>
274
- <define name="comment-period">
275
- <element name="comment-period">
276
- <element name="from">
277
- <ref name="ISO8601Date"/>
278
- </element>
279
- <element name="to">
280
- <ref name="ISO8601Date"/>
281
- </element>
282
- </element>
283
- </define>
284
- <define name="si-aspect">
285
- <element name="si-aspect">
286
- <choice>
287
- <value>A_e_deltanu</value>
288
- <value>A_e</value>
289
- <value>cd_Kcd_h_deltanu</value>
290
- <value>cd_Kcd</value>
291
- <value>full</value>
292
- <value>K_k_deltanu</value>
293
- <value>K_k</value>
294
- <value>kg_h_c_deltanu</value>
295
- <value>kg_h</value>
296
- <value>m_c_deltanu</value>
297
- <value>m_c</value>
298
- <value>mol_NA</value>
299
- <value>s_deltanu</value>
300
- </choice>
301
- </element>
302
- </define>
303
- <define name="committee">
304
- <element name="committee">
305
- <attribute name="acronym">
306
- <choice>
307
- <value>CGPM</value>
308
- <value>CIPM</value>
309
- <value>BIPM</value>
310
- <value>CCAUV</value>
311
- <value>CCEM</value>
312
- <value>CCL</value>
313
- <value>CCM</value>
314
- <value>CCPR</value>
315
- <value>CCQM</value>
316
- <value>CCRI</value>
317
- <value>CCT</value>
318
- <value>CCTF</value>
319
- <value>CCU</value>
320
- <value>CCL-CCTF-WGFS</value>
321
- <value>JCGM</value>
322
- <value>JCRB</value>
323
- <value>JCTLM</value>
324
- <value>INetQI</value>
325
- </choice>
326
- </attribute>
327
- <ref name="LocalizedString"/>
328
- </element>
329
- </define>
330
- <define name="workgroup">
331
- <element name="workgroup">
332
- <optional>
333
- <attribute name="acronym"/>
334
- </optional>
335
- <text/>
336
- </element>
337
- </define>
338
- <define name="meeting-note">
339
- <element name="meeting-note">
340
- <text/>
341
- </element>
342
- </define>
343
214
  <define name="bipm-standard">
344
215
  <element name="bipm-standard">
345
216
  <attribute name="version"/>
@@ -50,29 +50,6 @@ module Metanorma
50
50
  ret
51
51
  end
52
52
 
53
- =begin
54
- def reference_names(xmldoc)
55
- xmldoc.xpath("//bibitem[not(ancestor::bibitem)]").each do |ref|
56
- docid = ref.at("./docidentifier[@type = 'metanorma']") ||
57
- ref.at("./docidentifier[not(@type = 'DOI')]") or next
58
- #date = ref.at("./date[@type = 'published']")
59
- #reference = format_ref(reference_names1(docid, date, docid["type"]),
60
- #docid["type"])
61
- reference = format_ref(docid.children.to_xml, docid["type"])
62
- @anchors[ref["id"]] = { xref: reference }
63
- end
64
- end
65
-
66
- def reference_names1(docid, date, type)
67
- ret = docid.children.to_xml
68
- if type == "BIPM" && date &&
69
- /(CIPM|CGPM) (Decision|Resolution)/.match?(docid)
70
- ret += " (#{date_range(date)})"
71
- end
72
- ret
73
- end
74
- =end
75
-
76
53
  def date_range(date)
77
54
  from = date.at(("./from"))
78
55
  to = date.at(("./to"))