cocina_display 1.1.3 → 1.2.1
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 +4 -4
- data/.rspec +0 -1
- data/.standard.yml +1 -1
- data/README.md +21 -2
- data/config/i18n-tasks.yml +0 -0
- data/config/licenses.yml +59 -0
- data/config/locales/en.yml +109 -0
- data/config/marc_countries.yml +385 -0
- data/config/marc_relators.yml +310 -0
- data/config/searchworks_languages.yml +520 -0
- data/lib/cocina_display/cocina_record.rb +29 -64
- data/lib/cocina_display/concerns/accesses.rb +78 -0
- data/lib/cocina_display/concerns/contributors.rb +32 -11
- data/lib/cocina_display/concerns/events.rb +19 -6
- data/lib/cocina_display/concerns/forms.rb +98 -11
- data/lib/cocina_display/concerns/geospatial.rb +9 -5
- data/lib/cocina_display/concerns/identifiers.rb +25 -5
- data/lib/cocina_display/concerns/languages.rb +6 -2
- data/lib/cocina_display/concerns/notes.rb +36 -0
- data/lib/cocina_display/concerns/related_resources.rb +20 -0
- data/lib/cocina_display/concerns/subjects.rb +25 -8
- data/lib/cocina_display/concerns/titles.rb +67 -25
- data/lib/cocina_display/concerns/{access.rb → url_helpers.rb} +3 -3
- data/lib/cocina_display/concerns.rb +6 -0
- data/lib/cocina_display/contributors/contributor.rb +47 -26
- data/lib/cocina_display/contributors/name.rb +18 -14
- data/lib/cocina_display/contributors/role.rb +31 -13
- data/lib/cocina_display/dates/date.rb +55 -14
- data/lib/cocina_display/dates/date_range.rb +0 -2
- data/lib/cocina_display/description/access.rb +41 -0
- data/lib/cocina_display/description/access_contact.rb +11 -0
- data/lib/cocina_display/description/url.rb +17 -0
- data/lib/cocina_display/display_data.rb +104 -0
- data/lib/cocina_display/events/event.rb +8 -4
- data/lib/cocina_display/events/imprint.rb +0 -10
- data/lib/cocina_display/events/location.rb +9 -3
- data/lib/cocina_display/events/note.rb +33 -0
- data/lib/cocina_display/forms/form.rb +71 -0
- data/lib/cocina_display/forms/genre.rb +12 -0
- data/lib/cocina_display/forms/resource_type.rb +38 -0
- data/lib/cocina_display/geospatial.rb +1 -1
- data/lib/cocina_display/identifier.rb +101 -0
- data/lib/cocina_display/json_backed_record.rb +27 -0
- data/lib/cocina_display/language.rb +18 -12
- data/lib/cocina_display/license.rb +32 -0
- data/lib/cocina_display/note.rb +103 -0
- data/lib/cocina_display/related_resource.rb +74 -0
- data/lib/cocina_display/subjects/subject.rb +32 -9
- data/lib/cocina_display/subjects/subject_value.rb +34 -16
- data/lib/cocina_display/title.rb +221 -0
- data/lib/cocina_display/utils.rb +4 -4
- data/lib/cocina_display/version.rb +1 -1
- data/lib/cocina_display.rb +32 -2
- metadata +46 -12
- data/lib/cocina_display/title_builder.rb +0 -397
- data/lib/cocina_display/vocabularies/marc_country_codes.rb +0 -393
- data/lib/cocina_display/vocabularies/marc_relator_codes.rb +0 -318
- data/lib/cocina_display/vocabularies/searchworks_languages.rb +0 -526
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
# Map of language codes to language names used in Searchworks, ported from stanford-mods gem.
|
|
2
|
+
# See: https://github.com/solrmarc/stanford-solr-marc/blob/master/stanford-sw/translation_maps/language_map.properties
|
|
3
|
+
|
|
4
|
+
aaa: Afar
|
|
5
|
+
abk: Abkhaz
|
|
6
|
+
ace: Achinese
|
|
7
|
+
ach: Acoli
|
|
8
|
+
ada: Adangme
|
|
9
|
+
ady: Adygei
|
|
10
|
+
afa: Afroasiatic (Other)
|
|
11
|
+
afh: Afrihili (Artificial language)
|
|
12
|
+
afr: Afrikaans
|
|
13
|
+
ain: Ainu
|
|
14
|
+
ajm: Aljamia
|
|
15
|
+
aka: Akan
|
|
16
|
+
akk: Akkadian
|
|
17
|
+
alb: Albanian
|
|
18
|
+
ale: Aleut
|
|
19
|
+
alg: Algonquian (Other)
|
|
20
|
+
alt: Altai
|
|
21
|
+
amh: Amharic
|
|
22
|
+
ang: English, Old (ca. 450-1100)
|
|
23
|
+
anp: Angika
|
|
24
|
+
apa: Apache languages
|
|
25
|
+
ara: Arabic
|
|
26
|
+
arc: Aramaic
|
|
27
|
+
arg: Aragonese Spanish
|
|
28
|
+
arm: Armenian
|
|
29
|
+
arn: Mapuche
|
|
30
|
+
arp: Arapaho
|
|
31
|
+
art: Artificial (Other)
|
|
32
|
+
arw: Arawak
|
|
33
|
+
ase: American Sign Language
|
|
34
|
+
asm: Assamese
|
|
35
|
+
ast: Bable
|
|
36
|
+
ath: Athapascan (Other)
|
|
37
|
+
aus: Australian languages
|
|
38
|
+
ava: Avaric
|
|
39
|
+
ave: Avestan
|
|
40
|
+
awa: Awadhi
|
|
41
|
+
aym: Aymara
|
|
42
|
+
aze: Azerbaijani
|
|
43
|
+
bad: Banda
|
|
44
|
+
bai: Bamileke languages
|
|
45
|
+
bak: Bashkir
|
|
46
|
+
bal: Baluchi
|
|
47
|
+
bam: Bambara
|
|
48
|
+
ban: Balinese
|
|
49
|
+
baq: Basque
|
|
50
|
+
bas: Basa
|
|
51
|
+
bat: Baltic (Other)
|
|
52
|
+
bej: Beja
|
|
53
|
+
bel: Belarusian
|
|
54
|
+
bem: Bemba
|
|
55
|
+
ben: Bengali
|
|
56
|
+
ber: Berber (Other)
|
|
57
|
+
bho: Bhojpuri
|
|
58
|
+
bih: Bihari
|
|
59
|
+
bik: Bikol
|
|
60
|
+
bin: Edo
|
|
61
|
+
bis: Bislama
|
|
62
|
+
bla: Siksika
|
|
63
|
+
bnt: Bantu (Other)
|
|
64
|
+
bos: Bosnian
|
|
65
|
+
bra: Braj
|
|
66
|
+
bre: Breton
|
|
67
|
+
btk: Batak
|
|
68
|
+
bua: Buriat
|
|
69
|
+
bug: Bugis
|
|
70
|
+
bul: Bulgarian
|
|
71
|
+
bur: Burmese
|
|
72
|
+
byn: Bilin
|
|
73
|
+
cad: Caddo
|
|
74
|
+
cai: Central American Indian (Other)
|
|
75
|
+
cam: Khmer
|
|
76
|
+
car: Carib
|
|
77
|
+
cat: Catalan
|
|
78
|
+
cau: Caucasian (Other)
|
|
79
|
+
ceb: Cebuano
|
|
80
|
+
cel: Celtic (Other)
|
|
81
|
+
cha: Chamorro
|
|
82
|
+
chb: Chibcha
|
|
83
|
+
che: Chechen
|
|
84
|
+
chg: Chagatai
|
|
85
|
+
chi: Chinese
|
|
86
|
+
chk: Truk
|
|
87
|
+
chm: Mari
|
|
88
|
+
chn: Chinook jargon
|
|
89
|
+
cho: Choctaw
|
|
90
|
+
chp: Chipewyan
|
|
91
|
+
chr: Cherokee
|
|
92
|
+
chu: Church Slavic
|
|
93
|
+
chv: Chuvash
|
|
94
|
+
chy: Cheyenne
|
|
95
|
+
cmc: Chamic languages
|
|
96
|
+
cop: Coptic
|
|
97
|
+
cor: Cornish
|
|
98
|
+
cos: Corsican
|
|
99
|
+
cpe: Creoles and Pidgins, English-based (Other)
|
|
100
|
+
cpf: Creoles and Pidgins, French-based (Other)
|
|
101
|
+
cpp: Creoles and Pidgins, Portuguese-based (Other)
|
|
102
|
+
cre: Cree
|
|
103
|
+
crh: Crimean Tatar
|
|
104
|
+
crp: Creoles and Pidgins (Other)
|
|
105
|
+
csb: Kashubian
|
|
106
|
+
cus: Cushitic (Other)
|
|
107
|
+
cze: Czech
|
|
108
|
+
dak: Dakota
|
|
109
|
+
dan: Danish
|
|
110
|
+
dar: Dargwa
|
|
111
|
+
day: Dayak
|
|
112
|
+
del: Delaware
|
|
113
|
+
den: Slave
|
|
114
|
+
dgr: Dogrib
|
|
115
|
+
din: Dinka
|
|
116
|
+
div: Divehi
|
|
117
|
+
doi: Dogri
|
|
118
|
+
dra: Dravidian (Other)
|
|
119
|
+
dsb: Lower Sorbian
|
|
120
|
+
dua: Duala
|
|
121
|
+
dum: Dutch, Middle (ca. 1050-1350)
|
|
122
|
+
dut: Dutch
|
|
123
|
+
dyu: Dyula
|
|
124
|
+
dzo: Dzongkha
|
|
125
|
+
efi: Efik
|
|
126
|
+
egy: Egyptian
|
|
127
|
+
egy-Egyd: Egyptian, Demotic
|
|
128
|
+
eka: Ekajuk
|
|
129
|
+
elx: Elamite
|
|
130
|
+
eng: English
|
|
131
|
+
enm: English, Middle (1100-1500)
|
|
132
|
+
epo: Esperanto
|
|
133
|
+
esk: Eskimo languages
|
|
134
|
+
esp: Esperanto
|
|
135
|
+
est: Estonian
|
|
136
|
+
eth: Ethiopic
|
|
137
|
+
ewe: Ewe
|
|
138
|
+
ewo: Ewondo
|
|
139
|
+
fan: Fang
|
|
140
|
+
fao: Faroese
|
|
141
|
+
far: Faroese
|
|
142
|
+
fat: Fanti
|
|
143
|
+
fij: Fijian
|
|
144
|
+
fil: Filipino
|
|
145
|
+
fin: Finnish
|
|
146
|
+
fiu: Finno-Ugrian (Other)
|
|
147
|
+
fon: Fon
|
|
148
|
+
fre: French
|
|
149
|
+
fri: Frisian
|
|
150
|
+
frm: French, Middle (ca. 1400-1600)
|
|
151
|
+
fro: French, Old (ca. 842-1400)
|
|
152
|
+
frr: North Frisian
|
|
153
|
+
frs: East Frisian
|
|
154
|
+
fry: Frisian
|
|
155
|
+
ful: Fula
|
|
156
|
+
fur: Friulian
|
|
157
|
+
gaa: Ga
|
|
158
|
+
gae: Scottish Gaelic
|
|
159
|
+
gag: Galician
|
|
160
|
+
gal: Oromo
|
|
161
|
+
gay: Gayo
|
|
162
|
+
gba: Gbaya
|
|
163
|
+
gem: Germanic (Other)
|
|
164
|
+
geo: Georgian
|
|
165
|
+
ger: German
|
|
166
|
+
gez: Ethiopic
|
|
167
|
+
gil: Gilbertese
|
|
168
|
+
gla: Scottish Gaelic
|
|
169
|
+
gle: Irish
|
|
170
|
+
glg: Galician
|
|
171
|
+
glv: Manx
|
|
172
|
+
gmh: German, Middle High (ca. 1050-1500)
|
|
173
|
+
goh: German, Old High (ca. 750-1050)
|
|
174
|
+
gon: Gondi
|
|
175
|
+
gor: Gorontalo
|
|
176
|
+
got: Gothic
|
|
177
|
+
grb: Grebo
|
|
178
|
+
grc: Greek, Ancient (to 1453)
|
|
179
|
+
gre: Greek, Modern (1453- )
|
|
180
|
+
grn: Guarani
|
|
181
|
+
gsw: Swiss German
|
|
182
|
+
gua: Guarani
|
|
183
|
+
guj: Gujarati
|
|
184
|
+
gwi: Gwich'in
|
|
185
|
+
hai: Haida
|
|
186
|
+
hat: Haitian French Creole
|
|
187
|
+
hau: Hausa
|
|
188
|
+
haw: Hawaiian
|
|
189
|
+
heb: Hebrew
|
|
190
|
+
her: Herero
|
|
191
|
+
hil: Hiligaynon
|
|
192
|
+
him: Himachali
|
|
193
|
+
hin: Hindi
|
|
194
|
+
hit: Hittite
|
|
195
|
+
hmn: Hmong
|
|
196
|
+
hmo: Hiri Motu
|
|
197
|
+
hrv: Croatian
|
|
198
|
+
hsb: Upper Sorbian
|
|
199
|
+
hun: Hungarian
|
|
200
|
+
hup: Hupa
|
|
201
|
+
iba: Iban
|
|
202
|
+
ibo: Igbo
|
|
203
|
+
ice: Icelandic
|
|
204
|
+
ido: Ido
|
|
205
|
+
iii: Sichuan Yi
|
|
206
|
+
ijo: Ijo
|
|
207
|
+
iku: Inuktitut
|
|
208
|
+
ile: Interlingue
|
|
209
|
+
ilo: Iloko
|
|
210
|
+
ina: Interlingua (International Auxiliary Language Association)
|
|
211
|
+
inc: Indic (Other)
|
|
212
|
+
ind: Indonesian
|
|
213
|
+
ine: Indo-European (Other)
|
|
214
|
+
inh: Ingush
|
|
215
|
+
int: Interlingua (International Auxiliary Language Association)
|
|
216
|
+
ipk: Inupiaq
|
|
217
|
+
ira: Iranian (Other)
|
|
218
|
+
iri: Irish
|
|
219
|
+
iro: Iroquoian (Other)
|
|
220
|
+
ita: Italian
|
|
221
|
+
jav: Javanese
|
|
222
|
+
jbo: Lojban (Artificial language)
|
|
223
|
+
jpn: Japanese
|
|
224
|
+
jpr: Judeo-Persian
|
|
225
|
+
jrb: Judeo-Arabic
|
|
226
|
+
kaa: Kara-Kalpak
|
|
227
|
+
kab: Kabyle
|
|
228
|
+
kac: Kachin
|
|
229
|
+
kal: Kalatdlisut
|
|
230
|
+
kam: Kamba
|
|
231
|
+
kan: Kannada
|
|
232
|
+
kar: Karen
|
|
233
|
+
kas: Kashmiri
|
|
234
|
+
kau: Kanuri
|
|
235
|
+
kaw: Kawi
|
|
236
|
+
kaz: Kazakh
|
|
237
|
+
kbd: Kabardian
|
|
238
|
+
kha: Khasi
|
|
239
|
+
khi: Khoisan (Other)
|
|
240
|
+
khm: Khmer
|
|
241
|
+
kho: Khotanese
|
|
242
|
+
kik: Kikuyu
|
|
243
|
+
kin: Kinyarwanda
|
|
244
|
+
kir: Kyrgyz
|
|
245
|
+
kmb: Kimbundu
|
|
246
|
+
kok: Konkani
|
|
247
|
+
kom: Komi
|
|
248
|
+
kon: Kongo
|
|
249
|
+
kor: Korean
|
|
250
|
+
kos: Kusaie
|
|
251
|
+
kpe: Kpelle
|
|
252
|
+
krc: Karachay-Balkar
|
|
253
|
+
krl: Karelian
|
|
254
|
+
kro: Kru
|
|
255
|
+
kru: Kurukh
|
|
256
|
+
kua: Kuanyama
|
|
257
|
+
kum: Kumyk
|
|
258
|
+
kur: Kurdish
|
|
259
|
+
kus: Kusaie
|
|
260
|
+
kut: Kutenai
|
|
261
|
+
lad: Ladino
|
|
262
|
+
lah: Lahnda
|
|
263
|
+
lam: Lamba
|
|
264
|
+
lan: Occitan (post-1500)
|
|
265
|
+
lao: Lao
|
|
266
|
+
lap: Sami
|
|
267
|
+
lat: Latin
|
|
268
|
+
lav: Latvian
|
|
269
|
+
lez: Lezgian
|
|
270
|
+
lim: Limburgish
|
|
271
|
+
lin: Lingala
|
|
272
|
+
lit: Lithuanian
|
|
273
|
+
lol: Mongo-Nkundu
|
|
274
|
+
loz: Lozi
|
|
275
|
+
ltz: Letzeburgesch
|
|
276
|
+
lua: Luba-Lulua
|
|
277
|
+
lub: Luba-Katanga
|
|
278
|
+
lug: Ganda
|
|
279
|
+
lui: Luiseno
|
|
280
|
+
lun: Lunda
|
|
281
|
+
luo: Luo (Kenya and Tanzania)
|
|
282
|
+
lus: Lushai
|
|
283
|
+
mac: Macedonian
|
|
284
|
+
mad: Madurese
|
|
285
|
+
mag: Magahi
|
|
286
|
+
mah: Marshallese
|
|
287
|
+
mai: Maithili
|
|
288
|
+
mak: Makasar
|
|
289
|
+
mal: Malayalam
|
|
290
|
+
man: Mandingo
|
|
291
|
+
mao: Maori
|
|
292
|
+
map: Austronesian (Other)
|
|
293
|
+
mar: Marathi
|
|
294
|
+
mas: Masai
|
|
295
|
+
max: Manx
|
|
296
|
+
may: Malay
|
|
297
|
+
mdf: Moksha
|
|
298
|
+
mdr: Mandar
|
|
299
|
+
men: Mende
|
|
300
|
+
mga: Irish, Middle (ca. 1100-1550)
|
|
301
|
+
mic: Micmac
|
|
302
|
+
min: Minangkabau
|
|
303
|
+
# mis: Miscellaneous languages
|
|
304
|
+
mkh: Mon-Khmer (Other)
|
|
305
|
+
mla: Malagasy
|
|
306
|
+
mlg: Malagasy
|
|
307
|
+
mlt: Maltese
|
|
308
|
+
mnc: Manchu
|
|
309
|
+
mni: Manipuri
|
|
310
|
+
mno: Manobo languages
|
|
311
|
+
moh: Mohawk
|
|
312
|
+
mol: Moldavian
|
|
313
|
+
mon: Mongolian
|
|
314
|
+
mos: Moore
|
|
315
|
+
# mul: Multiple languages
|
|
316
|
+
mun: Munda (Other)
|
|
317
|
+
mus: Creek
|
|
318
|
+
mwl: Mirandese
|
|
319
|
+
mwr: Marwari
|
|
320
|
+
myn: Mayan languages
|
|
321
|
+
myv: Erzya
|
|
322
|
+
nah: Nahuatl
|
|
323
|
+
nai: North American Indian (Other)
|
|
324
|
+
nap: Neapolitan Italian
|
|
325
|
+
nau: Nauru
|
|
326
|
+
nav: Navajo
|
|
327
|
+
nbl: Ndebele (South Africa)
|
|
328
|
+
nde: Ndebele (Zimbabwe)
|
|
329
|
+
ndo: Ndonga
|
|
330
|
+
nds: Low German
|
|
331
|
+
nep: Nepali
|
|
332
|
+
new: Newari
|
|
333
|
+
nia: Nias
|
|
334
|
+
nic: Niger-Kordofanian (Other)
|
|
335
|
+
niu: Niuean
|
|
336
|
+
nno: Norwegian (Nynorsk)
|
|
337
|
+
nob: Norwegian (Bokmal)
|
|
338
|
+
nog: Nogai
|
|
339
|
+
non: Old Norse
|
|
340
|
+
nor: Norwegian
|
|
341
|
+
nqo: N'Ko
|
|
342
|
+
nso: Northern Sotho
|
|
343
|
+
nub: Nubian languages
|
|
344
|
+
nwc: Newari, Old
|
|
345
|
+
nya: Nyanja
|
|
346
|
+
nym: Nyamwezi
|
|
347
|
+
nyn: Nyankole
|
|
348
|
+
nyo: Nyoro
|
|
349
|
+
nzi: Nzima
|
|
350
|
+
oci: Occitan (post-1500)
|
|
351
|
+
oji: Ojibwa
|
|
352
|
+
ori: Oriya
|
|
353
|
+
orm: Oromo
|
|
354
|
+
osa: Osage
|
|
355
|
+
oss: Ossetic
|
|
356
|
+
ota: Turkish, Ottoman
|
|
357
|
+
oto: Otomian languages
|
|
358
|
+
paa: Papuan (Other)
|
|
359
|
+
pag: Pangasinan
|
|
360
|
+
pal: Pahlavi
|
|
361
|
+
pam: Pampanga
|
|
362
|
+
pan: Panjabi
|
|
363
|
+
pap: Papiamento
|
|
364
|
+
pau: Palauan
|
|
365
|
+
peo: Old Persian (ca. 600-400 B.C.)
|
|
366
|
+
per: Persian
|
|
367
|
+
phi: Philippine (Other)
|
|
368
|
+
phn: Phoenician
|
|
369
|
+
pli: Pali
|
|
370
|
+
pol: Polish
|
|
371
|
+
pon: Ponape
|
|
372
|
+
por: Portuguese
|
|
373
|
+
pra: Prakrit languages
|
|
374
|
+
pro: Provencal (to 1500)
|
|
375
|
+
pus: Pushto
|
|
376
|
+
que: Quechua
|
|
377
|
+
raj: Rajasthani
|
|
378
|
+
rap: Rapanui
|
|
379
|
+
rar: Rarotongan
|
|
380
|
+
roa: Romance (Other)
|
|
381
|
+
roh: Raeto-Romance
|
|
382
|
+
rom: Romani
|
|
383
|
+
rum: Romanian
|
|
384
|
+
run: Rundi
|
|
385
|
+
rup: Aromanian
|
|
386
|
+
rus: Russian
|
|
387
|
+
sad: Sandawe
|
|
388
|
+
sag: Sango (Ubangi Creole)
|
|
389
|
+
sah: Yakut
|
|
390
|
+
sai: South American Indian (Other)
|
|
391
|
+
sal: Salishan languages
|
|
392
|
+
sam: Samaritan Aramaic
|
|
393
|
+
san: Sanskrit
|
|
394
|
+
sao: Samoan
|
|
395
|
+
sas: Sasak
|
|
396
|
+
sat: Santali
|
|
397
|
+
scc: Serbian
|
|
398
|
+
scn: Sicilian Italian
|
|
399
|
+
sco: Scots
|
|
400
|
+
scr: Croatian
|
|
401
|
+
sel: Selkup
|
|
402
|
+
sem: Semitic (Other)
|
|
403
|
+
sga: Irish, Old (to 1100)
|
|
404
|
+
sgn: Sign languages
|
|
405
|
+
shn: Shan
|
|
406
|
+
sho: Shona
|
|
407
|
+
sid: Sidamo
|
|
408
|
+
sin: Sinhalese
|
|
409
|
+
sio: Siouan (Other)
|
|
410
|
+
sit: Sino-Tibetan (Other)
|
|
411
|
+
sla: Slavic (Other)
|
|
412
|
+
slo: Slovak
|
|
413
|
+
slv: Slovenian
|
|
414
|
+
sma: Southern Sami
|
|
415
|
+
sme: Northern Sami
|
|
416
|
+
smi: Sami
|
|
417
|
+
smj: Lule Sami
|
|
418
|
+
smn: Inari Sami
|
|
419
|
+
smo: Samoan
|
|
420
|
+
sms: Skolt Sami
|
|
421
|
+
sna: Shona
|
|
422
|
+
snd: Sindhi
|
|
423
|
+
snh: Sinhalese
|
|
424
|
+
snk: Soninke
|
|
425
|
+
sog: Sogdian
|
|
426
|
+
som: Somali
|
|
427
|
+
son: Songhai
|
|
428
|
+
sot: Sotho
|
|
429
|
+
spa: Spanish
|
|
430
|
+
srd: Sardinian
|
|
431
|
+
srn: Sranan
|
|
432
|
+
srp: Serbian
|
|
433
|
+
srr: Serer
|
|
434
|
+
ssa: Nilo-Saharan (Other)
|
|
435
|
+
sso: Sotho
|
|
436
|
+
ssw: Swazi
|
|
437
|
+
suk: Sukuma
|
|
438
|
+
sun: Sundanese
|
|
439
|
+
sus: Susu
|
|
440
|
+
sux: Sumerian
|
|
441
|
+
swa: Swahili
|
|
442
|
+
swe: Swedish
|
|
443
|
+
swz: Swazi
|
|
444
|
+
syc: Syriac
|
|
445
|
+
syr: Syriac, Modern
|
|
446
|
+
tag: Tagalog
|
|
447
|
+
tah: Tahitian
|
|
448
|
+
tai: Tai (Other)
|
|
449
|
+
taj: Tajik
|
|
450
|
+
tam: Tamil
|
|
451
|
+
tar: Tatar
|
|
452
|
+
tat: Tatar
|
|
453
|
+
tel: Telugu
|
|
454
|
+
tem: Temne
|
|
455
|
+
ter: Terena
|
|
456
|
+
tet: Tetum
|
|
457
|
+
tgk: Tajik
|
|
458
|
+
tgl: Tagalog
|
|
459
|
+
tha: Thai
|
|
460
|
+
tib: Tibetan
|
|
461
|
+
tig: Tigre
|
|
462
|
+
tir: Tigrinya
|
|
463
|
+
tiv: Tiv
|
|
464
|
+
tkl: Tokelauan
|
|
465
|
+
tlh: Klingon (Artificial language)
|
|
466
|
+
tli: Tlingit
|
|
467
|
+
tmh: Tamashek
|
|
468
|
+
tog: Tonga (Nyasa)
|
|
469
|
+
ton: Tongan
|
|
470
|
+
tpi: Tok Pisin
|
|
471
|
+
tru: Truk
|
|
472
|
+
tsi: Tsimshian
|
|
473
|
+
tsn: Tswana
|
|
474
|
+
tso: Tsonga
|
|
475
|
+
tsw: Tswana
|
|
476
|
+
tuk: Turkmen
|
|
477
|
+
tum: Tumbuka
|
|
478
|
+
tup: Tupi languages
|
|
479
|
+
tur: Turkish
|
|
480
|
+
tut: Altaic (Other)
|
|
481
|
+
tvl: Tuvaluan
|
|
482
|
+
twi: Twi
|
|
483
|
+
tyv: Tuvinian
|
|
484
|
+
udm: Udmurt
|
|
485
|
+
uga: Ugaritic
|
|
486
|
+
uig: Uighur
|
|
487
|
+
ukr: Ukrainian
|
|
488
|
+
umb: Umbundu
|
|
489
|
+
# und: Undetermined
|
|
490
|
+
urd: Urdu
|
|
491
|
+
uzb: Uzbek
|
|
492
|
+
vai: Vai
|
|
493
|
+
ven: Venda
|
|
494
|
+
vie: Vietnamese
|
|
495
|
+
vol: Volapuk
|
|
496
|
+
vot: Votic
|
|
497
|
+
wak: Wakashan languages
|
|
498
|
+
wal: Walamo
|
|
499
|
+
war: Waray
|
|
500
|
+
was: Washo
|
|
501
|
+
wel: Welsh
|
|
502
|
+
wen: Sorbian languages
|
|
503
|
+
wln: Walloon
|
|
504
|
+
wol: Wolof
|
|
505
|
+
xal: Kalmyk
|
|
506
|
+
xho: Xhosa
|
|
507
|
+
yao: Yao (Africa)
|
|
508
|
+
yap: Yapese
|
|
509
|
+
yid: Yiddish
|
|
510
|
+
yor: Yoruba
|
|
511
|
+
ypk: Yupik languages
|
|
512
|
+
zap: Zapotec
|
|
513
|
+
zbl: Blissymbolics
|
|
514
|
+
zen: Zenaga
|
|
515
|
+
zha: Zhuang
|
|
516
|
+
znd: Zande
|
|
517
|
+
zul: Zulu
|
|
518
|
+
zun: Zuni
|
|
519
|
+
# zxx: null
|
|
520
|
+
zza: Zaza
|
|
@@ -1,46 +1,31 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "janeway"
|
|
4
|
-
require "json"
|
|
5
|
-
require "net/http"
|
|
6
|
-
require "active_support"
|
|
7
|
-
require "active_support/core_ext/object/blank"
|
|
8
|
-
require "active_support/core_ext/hash/conversions"
|
|
9
|
-
|
|
10
|
-
require_relative "concerns/events"
|
|
11
|
-
require_relative "concerns/contributors"
|
|
12
|
-
require_relative "concerns/identifiers"
|
|
13
|
-
require_relative "concerns/titles"
|
|
14
|
-
require_relative "concerns/access"
|
|
15
|
-
require_relative "concerns/subjects"
|
|
16
|
-
require_relative "concerns/forms"
|
|
17
|
-
require_relative "concerns/languages"
|
|
18
|
-
require_relative "concerns/geospatial"
|
|
19
|
-
require_relative "concerns/structural"
|
|
20
|
-
require_relative "utils"
|
|
21
|
-
|
|
22
3
|
module CocinaDisplay
|
|
23
4
|
# Public Cocina metadata for an SDR object, as fetched from PURL.
|
|
24
|
-
class CocinaRecord
|
|
5
|
+
class CocinaRecord < JsonBackedRecord
|
|
6
|
+
include CocinaDisplay::Concerns::Accesses
|
|
25
7
|
include CocinaDisplay::Concerns::Events
|
|
26
8
|
include CocinaDisplay::Concerns::Contributors
|
|
27
9
|
include CocinaDisplay::Concerns::Identifiers
|
|
10
|
+
include CocinaDisplay::Concerns::Notes
|
|
28
11
|
include CocinaDisplay::Concerns::Titles
|
|
29
|
-
include CocinaDisplay::Concerns::
|
|
12
|
+
include CocinaDisplay::Concerns::UrlHelpers
|
|
30
13
|
include CocinaDisplay::Concerns::Subjects
|
|
31
14
|
include CocinaDisplay::Concerns::Forms
|
|
32
15
|
include CocinaDisplay::Concerns::Languages
|
|
33
16
|
include CocinaDisplay::Concerns::Geospatial
|
|
34
17
|
include CocinaDisplay::Concerns::Structural
|
|
18
|
+
include CocinaDisplay::Concerns::RelatedResources
|
|
35
19
|
|
|
36
20
|
# Fetch a public Cocina document from PURL and create a CocinaRecord.
|
|
37
21
|
# @note This is intended to be used in development or testing only.
|
|
38
22
|
# @param druid [String] The bare DRUID of the object to fetch.
|
|
23
|
+
# @param purl_url [String] The base url for the purl service.
|
|
39
24
|
# @param deep_compact [Boolean] If true, compact the JSON to remove blank values.
|
|
40
25
|
# @return [CocinaDisplay::CocinaRecord]
|
|
41
26
|
# :nocov:
|
|
42
|
-
def self.fetch(druid, deep_compact:
|
|
43
|
-
from_json(Net::HTTP.get(URI("
|
|
27
|
+
def self.fetch(druid, deep_compact: true, purl_url: "https://purl.stanford.edu")
|
|
28
|
+
from_json(Net::HTTP.get(URI("#{purl_url}/#{druid}.json")), deep_compact: deep_compact)
|
|
44
29
|
end
|
|
45
30
|
# :nocov:
|
|
46
31
|
|
|
@@ -53,28 +38,6 @@ module CocinaDisplay
|
|
|
53
38
|
deep_compact ? new(Utils.deep_compact_blank(cocina_doc)) : new(cocina_doc)
|
|
54
39
|
end
|
|
55
40
|
|
|
56
|
-
# The parsed Cocina document.
|
|
57
|
-
# @return [Hash]
|
|
58
|
-
attr_reader :cocina_doc
|
|
59
|
-
|
|
60
|
-
# Initialize a CocinaRecord with a Cocina document hash.
|
|
61
|
-
# @param cocina_doc [Hash]
|
|
62
|
-
def initialize(cocina_doc)
|
|
63
|
-
@cocina_doc = cocina_doc
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
# Evaluate a JSONPath expression against the Cocina document.
|
|
67
|
-
# @return [Enumerator] An enumerator that yields results matching the expression.
|
|
68
|
-
# @param path_expression [String] The JSONPath expression to evaluate.
|
|
69
|
-
# @see https://www.rubydoc.info/gems/janeway-jsonpath/0.6.0/file/README.md
|
|
70
|
-
# @example Name values for contributors
|
|
71
|
-
# record.path("$.description.contributor.*.name.*.value").search #=> ["Smith, John", "ACME Corp."]
|
|
72
|
-
# @example Filtering nodes using a condition
|
|
73
|
-
# record.path("$.description.contributor[?(@.type == 'person')].name.*.value").search #=> ["Smith, John"]
|
|
74
|
-
def path(path_expression)
|
|
75
|
-
Janeway.enum_for(path_expression, cocina_doc)
|
|
76
|
-
end
|
|
77
|
-
|
|
78
41
|
# Timestamp when the Cocina was created.
|
|
79
42
|
# @note This is for the metadata itself, not the object.
|
|
80
43
|
# @return [Time]
|
|
@@ -96,7 +59,7 @@ module CocinaDisplay
|
|
|
96
59
|
# @example
|
|
97
60
|
# record.content_type #=> "image"
|
|
98
61
|
def content_type
|
|
99
|
-
cocina_doc["type"]
|
|
62
|
+
cocina_doc["type"].delete_prefix("https://cocina.sul.stanford.edu/models/")
|
|
100
63
|
end
|
|
101
64
|
|
|
102
65
|
# Primary processing label for the object.
|
|
@@ -112,27 +75,29 @@ module CocinaDisplay
|
|
|
112
75
|
content_type == "collection"
|
|
113
76
|
end
|
|
114
77
|
|
|
115
|
-
#
|
|
116
|
-
# @return [
|
|
117
|
-
def
|
|
118
|
-
|
|
78
|
+
# Copyright statement from Cocina access metadata.
|
|
79
|
+
# @return [String, nil]
|
|
80
|
+
def copyright
|
|
81
|
+
cocina_doc.dig("access", "copyright")
|
|
119
82
|
end
|
|
120
|
-
end
|
|
121
83
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
# @example "is part of"
|
|
128
|
-
# @see https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md#relatedresource-types
|
|
129
|
-
attr_reader :type
|
|
84
|
+
# Use and reproduction statement from Cocina access metadata.
|
|
85
|
+
# @return [String, nil]
|
|
86
|
+
def use_and_reproduction
|
|
87
|
+
cocina_doc.dig("access", "useAndReproductionStatement")
|
|
88
|
+
end
|
|
130
89
|
|
|
131
|
-
#
|
|
132
|
-
#
|
|
133
|
-
def
|
|
134
|
-
@
|
|
135
|
-
|
|
90
|
+
# Description of the license
|
|
91
|
+
# @return [String, nil]
|
|
92
|
+
def license_description
|
|
93
|
+
@license_description ||=
|
|
94
|
+
license ? License.new(url: license).description : nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# License URI
|
|
98
|
+
# @return [String, nil]
|
|
99
|
+
def license
|
|
100
|
+
cocina_doc.dig("access", "license")
|
|
136
101
|
end
|
|
137
102
|
end
|
|
138
103
|
end
|