relaton-bib 1.13.15 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f8a3825c0d7f1483217d8b0979d4fc3e1e127fda5356a82e24815d2495fa992
4
- data.tar.gz: 2cdf25310b04dd9a11daf23475acb46f1965f6f9262b17c03e959dbb732d6c1b
3
+ metadata.gz: fbae7bc96bcecd3287ff80420521dc68077b8379e0a901bfff6fc68eeb401abb
4
+ data.tar.gz: ad35e800b40a3ad78d645bba084f4d0cc27ab492b15c2438282aeff2401b7a08
5
5
  SHA512:
6
- metadata.gz: 65a74b2a88f96880299eb1aed70d221c61dc7a5b63295e8bc4a41484ed0179d16d8325c3dc4a5454a4891a103b24d3f10ae56677197edabd956f8c36dc4abfa9
7
- data.tar.gz: 2c623221052c170088f875b8c9a846932980693d0d44afa28e223a83049fc41ad84ce48ec0c5142c386676aadc290b1315de8d6a092bcc6646b13b60a6bf3b09
6
+ metadata.gz: c28d3f0f63f6dd545fd74f54872425031137c2b40ae10f0e10512ff7651bba9321ff8602785e1a52941c072e26f61917d14aae99ca4a141adc678da522655516
7
+ data.tar.gz: a4c21ab249c4993278cef4d3b63f7179fc1b5902752642cdcacb308f987efe67c558cdad97466c1955ceb8bbe016caac1301d3efd9d230c773b51f2a0d75a69d
data/README.adoc CHANGED
@@ -31,8 +31,12 @@ Or install it yourself as:
31
31
 
32
32
  [source,ruby]
33
33
  ----
34
+ require 'relaton_bib'
35
+ => true
36
+
34
37
  hash = YAML.load_file "spec/examples/bib_item.yml"
35
38
  => {"id"=>"ISOTC211",
39
+ "fetched"=>"2022-05-02",
36
40
  "title"=>["Geographic information", {"content"=>"Information géographique", "language"=>"fr", "script"=>"Latn"}],
37
41
  ...
38
42
 
@@ -48,17 +52,25 @@ item = RelatonBib::BibliographicItem.from_hash(hash)
48
52
  [source,ruby]
49
53
  ----
50
54
  item.title
51
- => [#<RelatonBib::TypedTitleString:0x007fa49a360290
52
- @title=#<RelatonBib::FormattedString:0x007fa49a360088 @content="Geographic information", @format=nil, @language=["en"], @script=["Latn"]>,
53
- @type="main">,
54
- #<RelatonBib::TypedTitleString:0x007fa49a35bf38
55
- @title=#<RelatonBib::FormattedString:0x007fa49a35bdd0 @content="Information géographique", @format=nil, @language=["fr"], @script=["Latn"]>,
56
- @type=nil>]
55
+ => #<RelatonBib::TypedTitleStringCollection:0x00007fea821ec6b0
56
+ @array=
57
+ [#<RelatonBib::TypedTitleString:0x00007fea821ecb60
58
+ @title=#<RelatonBib::FormattedString:0x00007fea821eca70 @content="Geographic information", @format="text/plain", @language=nil, @script=nil>,
59
+ @type="title-main">,
60
+ #<RelatonBib::TypedTitleString:0x00007fea821ec8b8
61
+ @title=#<RelatonBib::FormattedString:0x00007fea821ec818 @content="Geographic information", @format="text/plain", @language=nil, @script=nil>,
62
+ @type="main">,
63
+ #<RelatonBib::TypedTitleString:0x00007fea821ec610
64
+ @title=
65
+ #<RelatonBib::FormattedString:0x00007fea821ec570 @content="Information géographique", @format="text/plain", @language=["fr"], @script=["Latn"]>,
66
+ @type=nil>]>
57
67
 
58
68
  item.title lang: "fr"
59
- => [#<RelatonBib::TypedTitleString:0x007fa49a35bf38
60
- @title=#<RelatonBib::FormattedString:0x007fa49a35bdd0 @content="Information géographique", @format=nil, @language=["fr"], @script=["Latn"]>,
61
- @type=nil>]
69
+ => #<RelatonBib::TypedTitleStringCollection:0x00007fea8222d908
70
+ @array=
71
+ [#<RelatonBib::TypedTitleString:0x00007fea821ec610
72
+ @title=#<RelatonBib::FormattedString:0x00007fea821ec570 @content="Information géographique", @format="text/plain", @language=["fr"], @script=["Latn"]>,
73
+ @type=nil>]>
62
74
  ----
63
75
 
64
76
  === BibliographicItem Formatted Strings
@@ -66,20 +78,19 @@ item.title lang: "fr"
66
78
  [source,ruby]
67
79
  ----
68
80
  item.abstract
69
- => #<RelatonBib::TypedTitleStringCollection:0x00007f962f0306c0
70
- @array=
71
- [#<RelatonBib::TypedTitleString:0x00007f95ee8a4298
72
- @title=#<RelatonBib::FormattedString:0x00007f95ee8a41a8 @content="Geographic information", @format="text/plain", @language=nil, @script=nil>,
73
- @type="title-main">,
74
- #<RelatonBib::TypedTitleString:0x00007f95ee8a4040
75
- @title=#<RelatonBib::FormattedString:0x00007f962f03bf70 @content="Geographic information", @format="text/plain", @language=nil, @script=nil>,
76
- @type="main">,
77
- #<RelatonBib::TypedTitleString:0x00007f962f030620
78
- @title=#<RelatonBib::FormattedString:0x00007f962f030580 @content="Information géographique", @format="text/plain", @language=["fr"], @script=["Latn"]>,
79
- @type=nil>]>
81
+ => [#<RelatonBib::FormattedString:0x00007fea82236828
82
+ @content="<p>ISO 19115-1:2014 defines the schema required for ...</p>",
83
+ @format="text/html",
84
+ @language=["en"],
85
+ @script=["Latn"]>,
86
+ #<RelatonBib::FormattedString:0x00007fea82236670
87
+ @content="L'ISO 19115-1:2014 définit le schéma requis pour ...",
88
+ @format="text/plain",
89
+ @language=["fr"],
90
+ @script=["Latn"]>]
80
91
 
81
92
  item.abstract(lang: "en").to_s
82
- => "ISO 19115-1:2014 defines the schema required for ..."
93
+ => "<p>ISO 19115-1:2014 defines the schema required for ...</p>"
83
94
  ----
84
95
 
85
96
  === BibliographicItem references
@@ -87,7 +98,7 @@ item.abstract(lang: "en").to_s
87
98
  [source,ruby]
88
99
  ----
89
100
  item.shortref item.docidentifier.first
90
- => "TC211:2014"
101
+ => "ISOTC211:2014"
91
102
  ----
92
103
 
93
104
  === XML serialization
@@ -95,10 +106,11 @@ item.shortref item.docidentifier.first
95
106
  [source,ruby]
96
107
  ----
97
108
  item.to_xml
98
- => "<bibitem id="ISO/TC211" type="standard">
99
- <fetched>2019-04-30</fetched>
100
- <title type="main" language="en" script="Latn">Geographic information</title>
101
- <title language="fr" script="Latn">Information géographique</title>
109
+ => "<bibitem id="ISOTC211" type="standard" schema-version="v1.2.1">
110
+ <fetched>2022-05-02</fetched>
111
+ <title type="title-main" format="text/plain">Geographic information</title>
112
+ <title type="main" format="text/plain">Geographic information</title>
113
+ <title format="text/plain" language="fr" script="Latn">Information géographique</title>
102
114
  ...
103
115
  </bibitem>"
104
116
  ----
@@ -108,10 +120,15 @@ The default root element is `bibitem`. With argument `bibdata: true` the XML wra
108
120
  [source,ruby]
109
121
  ----
110
122
  item.to_xml bibdata: true
111
- => "<bibdata type="standard">
112
- <fetched>2019-04-30</fetched>
113
- <title type="main" language="en" script="Latn">Geographic information</title>
123
+ => "<bibdata type="standard" schema-version="v1.2.1">
124
+ <fetched>2022-05-02</fetched>
125
+ <title type="title-main" format="text/plain">Geographic information</title>
114
126
  ...
127
+ <ext>
128
+ <doctype>document</doctype>
129
+ <subdoctype>subdocument</subdoctype>
130
+ ...
131
+ </ext>
115
132
  </bibdata>"
116
133
  ----
117
134
 
@@ -122,9 +139,9 @@ By default date elements are formatted as a year (yyyy). Option `:date_format` a
122
139
  [source,ruby]
123
140
  ----
124
141
  item.to_xml date_format: :short
125
- => "<bibitem id="ISO/TC211" type="standard">
126
- <fetched>2019-04-30</fetched>
127
- <title type="main" language="en" script="Latn">Geographic information</title>
142
+ => "<bibitem id="ISOTC211" type="standard" schema-version="v1.2.1">
143
+ <fetched>2022-05-02</fetched>
144
+ <title type="title-main" format="text/plain">Geographic information</title>
128
145
  ...
129
146
  <date type="issued">
130
147
  <on>2014-01</on>
@@ -139,7 +156,7 @@ item.to_xml date_format: :short
139
156
  </bibitem>"
140
157
 
141
158
  item.to_xml date_format: :full
142
- => "<bibitem id="ISO/TC211" type="standard">
159
+ => "<bibitem id="ISOTC211" type="standard" schema-version="v1.2.1">
143
160
  ...
144
161
  <date type="issued">
145
162
  <on>2014-01-01</on>
@@ -159,11 +176,11 @@ item.to_xml date_format: :full
159
176
  [source,ruby]
160
177
  ----
161
178
  item.to_xml note: [{ text: "Note", type: "note" }]
162
- =>"<bibitem id="ISO19115-1-2014">
163
- ...
164
- <note format="text/plain" type="note">Note</note>
165
- ...
166
- </bibitem>"
179
+ => "<bibitem id="ISOTC211" type="standard" schema-version="v1.2.1">
180
+ ...
181
+ <note format="text/plain" type="note">Note</note>
182
+ ...
183
+ </bibitem>"
167
184
  ----
168
185
 
169
186
  === Create bibliographic item form YAML
@@ -171,7 +188,7 @@ item.to_xml note: [{ text: "Note", type: "note" }]
171
188
  [source,ruby]
172
189
  ----
173
190
  hash = YAML.load_file 'spec/examples/bib_item.yml'
174
- => {"id"=>"ISO/TC211",
191
+ => {"id"=>"ISOTC211"
175
192
  ...
176
193
 
177
194
  RelatonBib::BibliographicItem.from_hash hash
@@ -196,11 +213,13 @@ RelatonBib::BibXMLParser.parse bibxml
196
213
  [source,ruby]
197
214
  ----
198
215
  item.to_hash
199
- => {"id"=>"ISOTC211",
200
- "title"=>
201
- [{"type"=>"main", "content"=>"Geographic information", "language"=>"en", "script"=>"Latn", "format"=>"text/plain"},
202
- {"content"=>"Information géographique", "language"=>"fr", "script"=>"Latn", "format"=>"text/plain"}],
203
- ...
216
+ => {"schema-version"=>"v1.2.1",
217
+ "id"=>"ISOTC211",
218
+ "title"=>
219
+ [{"content"=>"Geographic information", "format"=>"text/plain", "type"=>"title-main"},
220
+ {"content"=>"Geographic information", "format"=>"text/plain", "type"=>"main"},
221
+ {"content"=>"Information géographique", "language"=>["fr"], "script"=>["Latn"], "format"=>"text/plain"}],
222
+ ...
204
223
  ----
205
224
 
206
225
  === Create bibliographic item from BibTeX
@@ -218,11 +237,11 @@ RelatonBib::BibtexParser.from_bibtex File.read('spec/examples/techreport.bib')
218
237
  [source,ruby]
219
238
  ----
220
239
  item.to_bibtex
221
- @misc{ISOTC211,
222
- tile = {Geographic information},
223
- edition = {1},
224
- author = {Bierman, A. and Bierman, Forename},
225
- ...
240
+ => @misc{ISOTC211,
241
+ title = {Geographic information},
242
+ edition = {Edition 1},
243
+ author = {Bierman, A. and Bierman, Arnold and Bierman, Arnold B},
244
+ ...
226
245
  ----
227
246
 
228
247
  === Export bibliographic item to Citeproc
@@ -231,11 +250,11 @@ item.to_bibtex
231
250
  ----
232
251
  item.to_citeproc
233
252
  => [{"title"=>"Geographic information",
234
- "edition"=>"1",
235
- "author"=>[{"family"=>"Bierman", "given"=>"A."}, {"family"=>"Bierman", "given"=>"Forename"}],
236
- "publisher"=>"Institute of Electrical and Electronics Engineers",
237
- "publisher-place"=>"bib place",
238
- ...
253
+ "edition"=>"Edition 1",
254
+ "author"=>[{"family"=>"Bierman", "given"=>"A."}, {"family"=>"Bierman", "given"=>"Arnold"}, {"family"=>"Bierman", "given"=>"Arnold B"}],
255
+ "publisher"=>"Institute of Electrical and Electronics Engineers",
256
+ "publisher-place"=>"bib place",
257
+ ...
239
258
  ----
240
259
 
241
260
  === Exporting bibliographic item to AsciiBib
@@ -243,15 +262,15 @@ item.to_citeproc
243
262
  [source,ruby]
244
263
  ----
245
264
  item.to_asciibib
246
- [%bibitem]
247
- == {blank}
248
- id:: ISOTC211
249
- fetched:: 2020-08-19
250
- title::
251
- title.type:: title-main
252
- title.content:: Geographic information
253
- title.format:: text/plain
254
- ...
265
+ => [%bibitem]
266
+ == {blank}
267
+ id:: ISOTC211
268
+ fetched:: 2022-05-02
269
+ title::
270
+ title.type:: title-main
271
+ title.content:: Geographic information
272
+ title.format:: text/plain
273
+ ...
255
274
  ----
256
275
 
257
276
  === Export bibliographic item to BibXML (RFC)
@@ -259,58 +278,19 @@ title.format:: text/plain
259
278
  [source,ruby]
260
279
  ----
261
280
  item.to_bibxml
262
- <reference anchor="ISO.TC.211" target="https://www.iso.org/standard/53798.html">
263
- <front>
264
- <title>Geographic information</title>
265
- <author>
266
- <organization abbrev="ISO">International Organization for Standardization</organization>
267
- </author>
268
- <author fullname="A. Bierman">
269
- <organization abbrev="IETF">IETF</organization>
270
- <address>
271
- <postal>
272
- <city>City</city>
273
- <code>123456</code>
274
- <country>Country</country>
275
- <region>State</region>
276
- <street>Street</street>
277
- </postal>
278
- <phone>223322</phone>
279
- </address>
280
- </author>
281
- <author role="editor">
282
- <organization abbrev="IEEE">IEEE</organization>
283
- </author>
284
- <author fullname="Forename Bierman" initials="A." surname="Bierman">
285
- <organization abbrev="IETF">IETF</organization>
286
- <address>
287
- <postal>
288
- <city>City</city>
289
- <code>123456</code>
290
- <country>Country</country>
291
- <region>State</region>
292
- <street>Street</street>
293
- </postal>
294
- <phone>223322</phone>
295
- </address>
296
- </author>
297
- <author>
298
- <organization>W3C</organization>
299
- </author>
300
- <date year="2014" month="April"/>
301
- <workgroup>Editorial group</workgroup>
302
- <abstract>
303
- <t>ISO 19115-1:2014 defines the schema required for ...</t>
304
- </abstract>
305
- </front>
306
- <seriesInfo name="DOI" value="10.17487/rfc1149"/>
307
- <seriesInfo name="Internet-Draft" value="draft-ietf-somewg-someprotocol-07"/>
308
- <seriesInfo name="ISO/IEC FDIS 10118-3" value="serie1234"/>
309
- <seriesInfo name="Formattedref"/>
310
- <seriesInfo name="Journal" value="7"/>
311
- <seriesInfo name="Series"/>
312
- <seriesInfo name="RFC" value="4"/>
313
- </reference>
281
+ => "<reference anchor="ISO.TC.211" target="https://www.iso.org/standard/53798.html">
282
+ <front>
283
+ <title>Geographic information</title>
284
+ <author>
285
+ <organization abbrev="ISO">International Organization for Standardization</organization>
286
+ </author>
287
+ ..
288
+ </front>
289
+ <seriesInfo name="DOI" value="10.17487/rfc1149"/>
290
+ <seriesInfo name="Internet-Draft" value="draft-ietf-somewg-someprotocol-07"/>
291
+ <seriesInfo name="ISO/IEC FDIS 10118-3" value="serie1234"/>
292
+ ...
293
+ </reference>"
314
294
  ----
315
295
 
316
296
  == Development
@@ -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>
@@ -688,6 +683,9 @@
688
683
  </define>
689
684
  <define name="underline">
690
685
  <element name="underline">
686
+ <optional>
687
+ <attribute name="style"/>
688
+ </optional>
691
689
  <zeroOrMore>
692
690
  <ref name="PureTextElement"/>
693
691
  </zeroOrMore>
@@ -1125,26 +1123,4 @@
1125
1123
  </zeroOrMore>
1126
1124
  </element>
1127
1125
  </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
1126
  </grammar>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0">
3
+ <include href="basicdoc.rng"/>
4
+ <include href="biblio-standoc.rng"/>
5
+ <start>
6
+ <choice>
7
+ <ref name="bibitem"/>
8
+ <ref name="bibdata"/>
9
+ </choice>
10
+ </start>
11
+ </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
+ <text/>
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>