relaton-bib 1.11.7 → 1.12.2

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: 9dffbd3f78b2468d48d601dd2cb1fa883c94d16d0b6c16a213219f85bbeef4c3
4
- data.tar.gz: b04d3b2db08c74e0ba9599c36a35ebd00dc62501ce0847bbce046cbcc9892fa8
3
+ metadata.gz: ebde20c82020f6add84d243549e0300e43a92f3702173f646df61c10c8dab27a
4
+ data.tar.gz: 6a4a26a79f56851700b37d5ded69b9a9b2eb69192d2f04efccb9a2ee56c7b2b4
5
5
  SHA512:
6
- metadata.gz: adf68e1aa4a1c7f8fc719cf51bfc1b74d0e8ae49374647d70140021d5250908c52b0728219cb5eda9aed442eaf3f12674648ac1e61af744ffce345d0e81c7b91
7
- data.tar.gz: 29690620969a335e11ab867163f33b530072cea8ceaab4d2980c60eadf14c9eaddb2976c02826cdf13ad677dd2ef781539419a014929481bce0e90274cc6dad7
6
+ metadata.gz: d99a477188088aeec02dd56732eb49517ee457186b334833c8fb22a9ea51ac49552fb7c963cc22a4d3230b378904a1603534991718eb620c96016323034ab956
7
+ data.tar.gz: cd5006e735cc8ff49b9c6fa910980b947691c14c725259f5843495722f5c0706a82f81d770fc11da2aa899d48654c963d87ec14aa15e5b361068f50fd83df48b
data/README.adoc CHANGED
@@ -31,216 +31,16 @@ Or install it yourself as:
31
31
 
32
32
  [source,ruby]
33
33
  ----
34
- item = RelatonBib::BibliographicItem.new(
35
- id: "ISOTC211", fetched: Date.today.to_s,
36
- title: [
37
- { type: "main", content: "Geographic information", language: "en", script: "Latn" },
38
- {
39
- content: "Information géographique", language: "fr", script: "Latn"
40
- },
41
- ],
42
- type: "standard",
43
- docid: [
44
- RelatonBib::DocumentIdentifier.new(id: "TC211", type: "ISO"),
45
- RelatonBib::DocumentIdentifier.new(id: "ISBN", type: "isbn"),
46
- RelatonBib::DocumentIdentifier.new(id: "LCCN", type: "lccn"),
47
- RelatonBib::DocumentIdentifier.new(id: "ISSN", type: "issn"),
48
- ],
49
- docnumber: "123456",
50
- edition: "1", language: %w[en fr], script: ["Latn"],
51
- version: RelatonBib::BibliographicItem::Version.new("2019-04-01", ["draft"]),
52
- biblionote: [
53
- RelatonBib::BiblioNote.new(content: "note"),
54
- RelatonBib::BiblioNote.new(content: "An note", type: "annote"),
55
- RelatonBib::BiblioNote.new(content: "How published", type: "howpublished"),
56
- RelatonBib::BiblioNote.new(content: "Comment", type: "comment"),
57
- RelatonBib::BiblioNote.new(content: "Table Of Contents", type: "tableOfContents"),
58
- ],
59
- docstatus: RelatonBib::DocumentStatus.new(
60
- stage: "stage", substage: "substage", iteration: "final",
61
- ),
62
- date: [
63
- { type: "issued", on: "2014" },
64
- { type: "published", on: "2014-04" },
65
- { type: "accessed", on: "2015-05-20" },
66
- ],
67
- abstract: [
68
- { content: "ISO 19115-1:2014 defines the schema required for ...",
69
- language: "en", script: "Latn", format: "text/plain" },
70
- { content: "L'ISO 19115-1:2014 définit le schéma requis pour ...",
71
- language: "fr", script: "Latn", format: "text/plain" },
72
- ],
73
- contributor: [
74
- {
75
- entity: {
76
- name: "International Organization for Standardization",
77
- url: "www.iso.org", abbreviation: "ISO", subdivision: "division",
78
- },
79
- role: [{ type: "publisher", description: ["Publisher role"] }],
80
- },
81
- {
82
- entity: RelatonBib::Person.new(
83
- name: RelatonBib::FullName.new(
84
- completename: RelatonBib::LocalizedString.new("A. Bierman", "en"),
85
- ),
86
- affiliation: [RelatonBib::Affiliation.new(
87
- organization: RelatonBib::Organization.new(
88
- name: "IETF",
89
- abbreviation: RelatonBib::LocalizedString.new("IETF"),
90
- identifier: [RelatonBib::OrgIdentifier.new("uri", "www.ietf.org")],
91
- )
92
- )],
93
- contact: [
94
- RelatonBib::Address.new(
95
- street: ["Street"], city: "City", postcode: "123456",
96
- country: "Country", state: "State"
97
- ),
98
- RelatonBib::Contact.new(type: "phone", value: "223322"),
99
- ]
100
- ),
101
- role: [type: "author"],
102
- },
103
- RelatonBib::ContributionInfo.new(
104
- entity: RelatonBib::Organization.new(
105
- name: "IETF",
106
- abbreviation: "IETF",
107
- identifier: [RelatonBib::OrgIdentifier.new("uri", "www.ietf.org")],
108
- ),
109
- role: [type: "publisher"],
110
- ),
111
- {
112
- entity: RelatonBib::Person.new(
113
- name: RelatonBib::FullName.new(
114
- initial: [RelatonBib::LocalizedString.new("A.", "en")],
115
- surname: RelatonBib::LocalizedString.new("Bierman", "en"),
116
- forename: [RelatonBib::LocalizedString.new("Forename", "en")],
117
- addition: [RelatonBib::LocalizedString.new("Addition", "en")],
118
- prefix: [RelatonBib::LocalizedString.new("Prefix", "en")],
119
- ),
120
- affiliation: [RelatonBib::Affiliation.new(
121
- organization: RelatonBib::Organization.new(name: "IETF", abbreviation: "IETF"),
122
- description: [RelatonBib::LocalizedString.new("Description", "en")]
123
- )],
124
- contact: [
125
- RelatonBib::Address.new(
126
- street: ["Street"], city: "City", postcode: "123456",
127
- country: "Country", state: "State"
128
- ),
129
- RelatonBib::Contact.new(type: "phone", value: "223322"),
130
- ],
131
- identifier: [RelatonBib::PersonIdentifier.new("uri", "www.person.com")],
132
- ),
133
- role: [type: "author"],
134
- },
135
- { entity: { name: "Institution" }, role: [type: "sponsor"] }
136
- ],
137
- copyright: [{
138
- owner: [{
139
- name: "International Organization for Standardization",
140
- abbreviation: "ISO", url: "www.iso.org"
141
- }],
142
- from: "2014", to: "2020"
143
- }],
144
- link: [
145
- { type: "src", content: "https://www.iso.org/standard/53798.html" },
146
- { type: "obp",
147
- content: "https://www.iso.org/obp/ui/#!iso:std:53798:en" },
148
- { type: "rss", content: "https://www.iso.org/contents/data/standard"\
149
- "/05/37/53798.detail.rss" },
150
- { type: "doi", content: "http://standrd.org/doi-123" },
151
- { type: "file", content: "file://path/file" },
152
- ],
153
- relation: [
154
- {
155
- type: "updates",
156
- bibitem: RelatonBib::BibliographicItem.new(
157
- formattedref: RelatonBib::FormattedRef.new(content: "ISO 19115:2003"),
158
- ),
159
- locality: [
160
- RelatonBib::LocalityStack.new([
161
- RelatonBib::Locality.new("volume", "1"),
162
- RelatonBib::Locality.new("section", "2"),
163
- ]),
164
- ],
165
- source_locality: [
166
- RelatonBib::SourceLocalityStack.new([
167
- RelatonBib::SourceLocality.new("chapter", "4"),
168
- ]),
169
- ],
170
- },
171
- {
172
- type: "updates",
173
- bibitem: RelatonBib::BibliographicItem.new(
174
- type: "standard",
175
- formattedref: RelatonBib::FormattedRef.new(content: "ISO 19115:2003/Cor 1:2006"),
176
- ),
177
- },
178
- {
179
- type: "partOf",
180
- bibitem: RelatonBib::BibliographicItem.new(
181
- title: [RelatonBib::TypedTitleString.new(type: "main", content: "Book title")],
182
- ),
183
- },
184
- ],
185
- series: [
186
- RelatonBib::Series.new(
187
- type: "main",
188
- title: RelatonBib::TypedTitleString.new(
189
- type: "original", content: "ISO/IEC FDIS 10118-3", language: "en",
190
- script: "Latn", format: "text/plain",
191
- ),
192
- place: "Serie's place",
193
- organization: "Serie's organization",
194
- abbreviation: RelatonBib::LocalizedString.new("ABVR"),
195
- from: "2009-02-01",
196
- to: "2010-12-20",
197
- number: "serie1234",
198
- partnumber: "part5678",
199
- ),
200
- RelatonBib::Series.new(
201
- type: "alt",
202
- formattedref: RelatonBib::FormattedRef.new(
203
- content: "serieref", language: "en", script: "Latn",
204
- ),
205
- ),
206
- RelatonBib::Series.new(
207
- type: "journal", title: RelatonBib::TypedTitleString.new(content: "Journal"), number: "7"
208
- ),
209
- RelatonBib::Series.new(title: RelatonBib::TypedTitleString.new(content: "Series")),
210
- ],
211
- medium: RelatonBib::Medium.new(
212
- form: "medium form", size: "medium size", scale: "medium scale",
213
- ),
214
- place: [
215
- "bib place",
216
- RelatonBib::Place.new(
217
- city: "Geneva",
218
- region: [RelatonBib::Place::RegionType.new(name: "Region")],
219
- country: [RelatonBib::Place::RegionType.new(name: "Switzeland", iso: "SH", recommended: true)],
220
- )
221
- ],
222
- extent: [
223
- RelatonBib::BibItemLocality.new("section", "Reference from", "Reference to"),
224
- RelatonBib::BibItemLocality.new("chapter", "4"),
225
- RelatonBib::BibItemLocality.new("page", "10", "20"),
226
- RelatonBib::BibItemLocality.new("volume", "1"),
227
- ],
228
- accesslocation: ["accesslocation1", "accesslocation2"],
229
- classification: [
230
- RelatonBib::Classification.new(type: "type", value: "value"),
231
- RelatonBib::Classification.new(type: "keyword", value: "Keywords"),
232
- RelatonBib::Classification.new(type: "mendeley", value: "Mendeley Tags"),
233
- ],
234
- validity: RelatonBib::Validity.new(
235
- begins: Time.new(2010, 10, 10, 12, 21),
236
- ends: Time.new(2011, 2, 3, 18,30),
237
- revision: Time.new(2011, 3, 4, 9, 0),
238
- )
239
- )
240
-
241
- => #<RelatonBib::BibliographicItem:0x007fc8b6c796c0
34
+ hash = YAML.load_file "spec/examples/bib_item.yml"
35
+ => {"id"=>"ISOTC211",
36
+ "title"=>["Geographic information", {"content"=>"Information géographique", "language"=>"fr", "script"=>"Latn"}],
37
+ ...
38
+
39
+ item = RelatonBib::BibliographicItem.from_hash(hash)
40
+ => #<RelatonBib::BibliographicItem:0x00007f962f030710
242
41
  @abstract=
243
- [#<RelatonBib::FormattedString:0x007fc8b6c726b8 @content="ISO 19115-1:2014 defines the schema required for ...", @format="text/plain", @language=["en"], @script=["Latn"]>,
42
+ [#<RelatonBib::FormattedString:0x00007f962f02acc0
43
+ ...
244
44
  ----
245
45
 
246
46
  === BibliographicItem Typed Title Strings
@@ -266,8 +66,17 @@ item.title lang: "fr"
266
66
  [source,ruby]
267
67
  ----
268
68
  item.abstract
269
- => [#<RelatonBib::FormattedString:0x007fc8b6c726b8 @content="ISO 19115-1:2014 defines the schema required for ...", @format="text/plain", @language=["en"], @script=["Latn"]>,
270
- #<RelatonBib::FormattedString:0x007fc8b6c725f0 @content="L'ISO 19115-1:2014 définit le schéma requis pour ...", @format="text/plain", @language=["fr"], @script=["Latn"]>]
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>]>
271
80
 
272
81
  item.abstract(lang: "en").to_s
273
82
  => "ISO 19115-1:2014 defines the schema required for ..."
@@ -450,37 +259,57 @@ title.format:: text/plain
450
259
  [source,ruby]
451
260
  ----
452
261
  item.to_bibxml
453
- <reference anchor="ISOTC211" target="https://www.iso.org/standard/53798.html">
262
+ <reference anchor="ISO.TC.211" target="https://www.iso.org/standard/53798.html">
454
263
  <front>
455
264
  <title>Geographic information</title>
456
- <seriesInfo name="DOI" value="10.17487/rfc1149"/>
457
- <seriesInfo name="Internet-Draft" value="draft-ietf-somewg-someprotocol-07"/>
458
- <seriesInfo name="RFC" value="4"/>
459
265
  <author>
460
266
  <organization abbrev="ISO">International Organization for Standardization</organization>
461
267
  </author>
462
268
  <author fullname="A. Bierman">
463
269
  <organization abbrev="IETF">IETF</organization>
464
270
  <address>
465
- <postal>123456</postal>
271
+ <postal>
272
+ <city>City</city>
273
+ <code>123456</code>
274
+ <country>Country</country>
275
+ <region>State</region>
276
+ <street>Street</street>
277
+ </postal>
466
278
  <phone>223322</phone>
467
279
  </address>
468
280
  </author>
469
281
  <author role="editor">
470
- <organization abbrev="IETF">IETF</organization>
282
+ <organization abbrev="IEEE">IEEE</organization>
471
283
  </author>
472
- <author initials="A." surname="Bierman">
284
+ <author fullname="Forename Bierman" initials="A." surname="Bierman">
473
285
  <organization abbrev="IETF">IETF</organization>
474
286
  <address>
475
- <postal>123456</postal>
287
+ <postal>
288
+ <city>City</city>
289
+ <code>123456</code>
290
+ <country>Country</country>
291
+ <region>State</region>
292
+ <street>Street</street>
293
+ </postal>
476
294
  <phone>223322</phone>
477
295
  </address>
478
296
  </author>
479
297
  <author>
480
- <organization>Institution</organization>
298
+ <organization>W3C</organization>
481
299
  </author>
482
- <date year="2014" month="April" day="1"/>
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>
483
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"/>
484
313
  </reference>
485
314
  ----
486
315
 
data/grammars/biblio.rng CHANGED
@@ -614,12 +614,103 @@
614
614
  <optional>
615
615
  <ref name="fetched"/>
616
616
  </optional>
617
- <choice>
618
- <oneOrMore>
619
- <ref name="btitle"/>
620
- </oneOrMore>
617
+ <optional>
621
618
  <ref name="formattedref"/>
622
- </choice>
619
+ </optional>
620
+ <oneOrMore>
621
+ <ref name="btitle"/>
622
+ </oneOrMore>
623
+ <zeroOrMore>
624
+ <ref name="bsource"/>
625
+ </zeroOrMore>
626
+ <oneOrMore>
627
+ <ref name="docidentifier"/>
628
+ </oneOrMore>
629
+ <optional>
630
+ <ref name="docnumber"/>
631
+ </optional>
632
+ <zeroOrMore>
633
+ <ref name="bdate"/>
634
+ </zeroOrMore>
635
+ <zeroOrMore>
636
+ <ref name="contributor"/>
637
+ </zeroOrMore>
638
+ <optional>
639
+ <ref name="edition"/>
640
+ </optional>
641
+ <zeroOrMore>
642
+ <ref name="version"/>
643
+ </zeroOrMore>
644
+ <zeroOrMore>
645
+ <ref name="biblionote"/>
646
+ </zeroOrMore>
647
+ <zeroOrMore>
648
+ <ref name="language"/>
649
+ </zeroOrMore>
650
+ <zeroOrMore>
651
+ <ref name="script"/>
652
+ </zeroOrMore>
653
+ <zeroOrMore>
654
+ <ref name="bibabstract"/>
655
+ </zeroOrMore>
656
+ <optional>
657
+ <ref name="status"/>
658
+ </optional>
659
+ <zeroOrMore>
660
+ <ref name="copyright"/>
661
+ </zeroOrMore>
662
+ <zeroOrMore>
663
+ <ref name="docrelation"/>
664
+ </zeroOrMore>
665
+ <zeroOrMore>
666
+ <ref name="series"/>
667
+ </zeroOrMore>
668
+ <optional>
669
+ <ref name="medium"/>
670
+ </optional>
671
+ <zeroOrMore>
672
+ <ref name="bplace"/>
673
+ </zeroOrMore>
674
+ <zeroOrMore>
675
+ <ref name="bprice"/>
676
+ </zeroOrMore>
677
+ <zeroOrMore>
678
+ <ref name="extent"/>
679
+ </zeroOrMore>
680
+ <optional>
681
+ <ref name="bibliographic_size"/>
682
+ </optional>
683
+ <zeroOrMore>
684
+ <ref name="accesslocation"/>
685
+ </zeroOrMore>
686
+ <zeroOrMore>
687
+ <ref name="license"/>
688
+ </zeroOrMore>
689
+ <zeroOrMore>
690
+ <ref name="bclassification"/>
691
+ </zeroOrMore>
692
+ <zeroOrMore>
693
+ <ref name="bkeyword"/>
694
+ </zeroOrMore>
695
+ <optional>
696
+ <ref name="validity"/>
697
+ </optional>
698
+ </define>
699
+ <define name="ReducedBibliographicItem">
700
+ <optional>
701
+ <attribute name="type">
702
+ <ref name="BibItemType"/>
703
+ </attribute>
704
+ </optional>
705
+ <optional>
706
+ <ref name="fetched"/>
707
+ </optional>
708
+ <optional>
709
+ <ref name="formattedref"/>
710
+ </optional>
711
+ <zeroOrMore>
712
+ <ref name="btitle"/>
713
+ </zeroOrMore>
623
714
  <zeroOrMore>
624
715
  <ref name="bsource"/>
625
716
  </zeroOrMore>
@@ -638,9 +729,9 @@
638
729
  <optional>
639
730
  <ref name="edition"/>
640
731
  </optional>
641
- <optional>
732
+ <zeroOrMore>
642
733
  <ref name="version"/>
643
- </optional>
734
+ </zeroOrMore>
644
735
  <zeroOrMore>
645
736
  <ref name="biblionote"/>
646
737
  </zeroOrMore>
@@ -833,6 +924,12 @@
833
924
  <data type="boolean"/>
834
925
  </attribute>
835
926
  </optional>
927
+ <optional>
928
+ <attribute name="language"/>
929
+ </optional>
930
+ <optional>
931
+ <attribute name="script"/>
932
+ </optional>
836
933
  <text/>
837
934
  </element>
838
935
  </define>
@@ -986,36 +1083,34 @@
986
1083
  <ref name="SeriesType"/>
987
1084
  </attribute>
988
1085
  </optional>
989
- <choice>
1086
+ <optional>
990
1087
  <ref name="formattedref"/>
991
- <group>
992
- <ref name="btitle"/>
993
- <optional>
994
- <ref name="bplace"/>
995
- </optional>
996
- <optional>
997
- <ref name="seriesorganization"/>
998
- </optional>
999
- <optional>
1000
- <ref name="abbreviation"/>
1001
- </optional>
1002
- <optional>
1003
- <ref name="seriesfrom"/>
1004
- </optional>
1005
- <optional>
1006
- <ref name="seriesto"/>
1007
- </optional>
1008
- <optional>
1009
- <ref name="seriesnumber"/>
1010
- </optional>
1011
- <optional>
1012
- <ref name="seriespartnumber"/>
1013
- </optional>
1014
- <optional>
1015
- <ref name="seriesrun"/>
1016
- </optional>
1017
- </group>
1018
- </choice>
1088
+ </optional>
1089
+ <ref name="btitle"/>
1090
+ <optional>
1091
+ <ref name="bplace"/>
1092
+ </optional>
1093
+ <optional>
1094
+ <ref name="seriesorganization"/>
1095
+ </optional>
1096
+ <optional>
1097
+ <ref name="abbreviation"/>
1098
+ </optional>
1099
+ <optional>
1100
+ <ref name="seriesfrom"/>
1101
+ </optional>
1102
+ <optional>
1103
+ <ref name="seriesto"/>
1104
+ </optional>
1105
+ <optional>
1106
+ <ref name="seriesnumber"/>
1107
+ </optional>
1108
+ <optional>
1109
+ <ref name="seriespartnumber"/>
1110
+ </optional>
1111
+ <optional>
1112
+ <ref name="seriesrun"/>
1113
+ </optional>
1019
1114
  </element>
1020
1115
  </define>
1021
1116
  <define name="SeriesType">
@@ -1174,7 +1269,7 @@
1174
1269
  </element>
1175
1270
  </optional>
1176
1271
  <element name="bibitem">
1177
- <ref name="BibliographicItem"/>
1272
+ <ref name="ReducedBibliographicItem"/>
1178
1273
  </element>
1179
1274
  <choice>
1180
1275
  <zeroOrMore>
@@ -1199,9 +1294,9 @@
1199
1294
  <optional>
1200
1295
  <ref name="revision-date"/>
1201
1296
  </optional>
1202
- <zeroOrMore>
1297
+ <optional>
1203
1298
  <ref name="draft"/>
1204
- </zeroOrMore>
1299
+ </optional>
1205
1300
  </element>
1206
1301
  </define>
1207
1302
  <define name="vedition">