marcspec 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/.document +5 -0
  2. data/.gitignore +21 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +59 -0
  5. data/Rakefile +58 -0
  6. data/VERSION +1 -0
  7. data/lib/marcspec/customspec.rb +97 -0
  8. data/lib/marcspec/kvmap.rb +79 -0
  9. data/lib/marcspec/map.rb +67 -0
  10. data/lib/marcspec/marcfieldspec.rb +205 -0
  11. data/lib/marcspec/multivaluemap.rb +62 -0
  12. data/lib/marcspec/solrfieldspec.rb +123 -0
  13. data/lib/marcspec/specset.rb +58 -0
  14. data/lib/marcspec.rb +11 -0
  15. data/lib/orig.rb +288 -0
  16. data/spec/data/batch.dat +1 -0
  17. data/spec/data/one.dat +1 -0
  18. data/spec/data/umich/translation_maps/area_map.properties +1039 -0
  19. data/spec/data/umich/translation_maps/availability_map_ht.properties +9 -0
  20. data/spec/data/umich/translation_maps/availability_map_umich.properties +6 -0
  21. data/spec/data/umich/translation_maps/callnumber_map.properties +21 -0
  22. data/spec/data/umich/translation_maps/callnumber_subject_map.properties +214 -0
  23. data/spec/data/umich/translation_maps/country_map.properties +320 -0
  24. data/spec/data/umich/translation_maps/format_map.properties +47 -0
  25. data/spec/data/umich/translation_maps/format_map_umich.properties +35 -0
  26. data/spec/data/umich/translation_maps/ht_namespace_map.properties +10 -0
  27. data/spec/data/umich/translation_maps/institution_map.properties +11 -0
  28. data/spec/data/umich/translation_maps/language_map.properties +489 -0
  29. data/spec/data/umich/translation_maps/library_map.properties +48 -0
  30. data/spec/data/umich/translation_maps/location_map.properties +345 -0
  31. data/spec/data/umich/umich_index.properties +130 -0
  32. data/spec/maps_spec.rb +91 -0
  33. data/spec/marcfieldspecs_spec.rb +109 -0
  34. data/spec/marcspec_spec.rb +10 -0
  35. data/spec/solrfieldspec_spec.rb +177 -0
  36. data/spec/spec_helper.rb +16 -0
  37. metadata +166 -0
@@ -0,0 +1,345 @@
1
+ MiAaUTR = UMTRI
2
+ MiFliC = FLINT
3
+ MiU-C = CLEM
4
+ MiU-H = BENT
5
+ AAEL = AAEL
6
+ BENT = BENT
7
+ BSTA = BSTA
8
+ BUHR = BUHR
9
+ CLEM = CLEM
10
+ CSCAR = CSCAR
11
+ ELEC = ELEC
12
+ FINE = FINE
13
+ FLINT = FLINT
14
+ FVL = FVL
15
+ HATCH = HATCH
16
+ HERB = HERB
17
+ TAUB = TAUB
18
+ MUSM = MUSM
19
+ MUSIC = MUSIC
20
+ PUB = PUB
21
+ SCI = SCI
22
+ SOC = SOC
23
+ SPEC = SPEC
24
+ UGL = UGL
25
+ UMTRI = UMTRI
26
+ SDR = SDR
27
+ UNION = UNION
28
+ AAEL\ BKS = AAEL BKS
29
+ AAEL\ BSMT = AAEL BSMT
30
+ AAEL\ CAR = AAEL CAR
31
+ AAEL\ DISS = AAEL DISS
32
+ AAEL\ ERES = AAEL ERES
33
+ AAEL\ FUN = AAEL FUN
34
+ AAEL\ GAME = AAEL GAME
35
+ AAEL\ IEEE = AAEL IEEE
36
+ AAEL\ MICE = AAEL MICE
37
+ AAEL\ MICM = AAEL MICM
38
+ AAEL\ OPEN = AAEL OPEN
39
+ AAEL\ OVR = AAEL OVR
40
+ AAEL\ PER = AAEL PER
41
+ AAEL\ PERU = AAEL PERU
42
+ AAEL\ RAR = AAEL RAR
43
+ AAEL\ REF = AAEL REF
44
+ AAEL\ RESC = AAEL RESC
45
+ AAEL\ RESI = AAEL RESI
46
+ AAEL\ RESP = AAEL RESP
47
+ AAEL\ SECD = AAEL SECD
48
+ AAEL\ SLD = AAEL SLD
49
+ AAEL\ STO = AAEL STO
50
+ AAEL\ STOF = AAEL STOF
51
+ AAEL\ XOVR = AAEL XOVR
52
+ BENT\ RR = BENT RR
53
+ BENT\ SF = BENT SF
54
+ BENT\ STOR = BENT STOR
55
+ BENT\ ELEC = BENT ELEC
56
+ BSTA\ CAGE = BSTA CAGE
57
+ BSTA\ ERES = BSTA ERES
58
+ BSTA\ OVR = BSTA OVR
59
+ BSTA\ REF = BSTA REF
60
+ BSTA\ RESC = BSTA RESC
61
+ BUHR\ AAEL = BUHR
62
+ BUHR\ ASIA = BUHR
63
+ BUHR\ CHEM = BUHR
64
+ BUHR\ DENT = BUHR
65
+ BUHR\ FINE = BUHR
66
+ BUHR\ GLMR = BUHR
67
+ BUHR\ GRAD = BUHR
68
+ BUHR\ JUV = BUHR
69
+ BUHR\ MAP = BUHR
70
+ BUHR\ MUSI = BUHR
71
+ BUHR\ MUSM = BUHR
72
+ BUHR\ PAPY = BUHR
73
+ BUHR\ PUB = BUHR
74
+ BUHR\ SCI = BUHR
75
+ BUHR\ SOC = BUHR
76
+ BUHR\ SSBU = BUHR
77
+ BUHR\ TAUB = BUHR
78
+ CLEM\ OVFL = CLEM OVFL
79
+ CLEM\ RSTO = CLEM RSTO
80
+ FINE\ ADM = FINE ADM
81
+ FINE\ ERES = FINE ERES
82
+ FINE\ FOL = FINE FOL
83
+ FINE\ OSFF = FINE OSFF
84
+ FINE\ OSR = FINE OSR
85
+ FINE\ OSRF = FINE OSRF
86
+ FINE\ OSRJ = FINE OSRJ
87
+ FINE\ OSRR = FINE OSRR
88
+ FINE\ OVR = FINE OVR
89
+ FINE\ OVR2 = FINE OVR2
90
+ FINE\ PER = FINE PER
91
+ FINE\ PERC = FINE PERC
92
+ FINE\ REF = FINE REF
93
+ FINE\ RESC = FINE RESC
94
+ FINE\ RESP = FINE RESP
95
+ FINE\ SPE = FINE SPE
96
+ FINE\ SPO = FINE SPO
97
+ FVL\ H1 = FVL H1
98
+ FVL\ H3 = FVL H3
99
+ FVL\ F1 = FVL F1
100
+ FVL\ F2 = FVL F2
101
+ HATCH\ ACQ = HATCH ACQ
102
+ HATCH\ AMIC = HATCH ASIA
103
+ HATCH\ AOFF = HATCH ASIA
104
+ HATCH\ AOVR = HATCH ASIA
105
+ HATCH\ AREF = HATCH ASIA
106
+ HATCH\ ARGM = HATCH ARGM
107
+ HATCH\ ASIA = HATCH ASIA
108
+ HATCH\ BACK = HATCH BACK
109
+ HATCH\ DFILE = HATCH DOCS
110
+ HATCH\ DMIC = HATCH DOCS
111
+ HATCH\ DOCS = HATCH DOCS
112
+ HATCH\ DREF = HATCH DOCS
113
+ HATCH\ DSOFT = HATCH DOCS
114
+ HATCH\ GDESK = HATCH REF
115
+ HATCH\ GFOL = HATCH GFOL
116
+ HATCH\ GLMR = HATCH GLMR
117
+ HATCH\ GLRF = HATCH REF
118
+ HATCH\ GRAD = HATCH GRAD
119
+ HATCH\ GRNT = HATCH REF
120
+ HATCH\ ICPSR = HATCH ICPSR
121
+ HATCH\ JUV = HATCH JUV
122
+ HATCH\ MAP = HATCH MAP
123
+ HATCH\ MATL = HATCH BKS
124
+ HATCH\ MFILE = HATCH MAP
125
+ HATCH\ MFILR = HATCH MRAR
126
+ HATCH\ MFOL = HATCH MRAR
127
+ HATCH\ MIXM = HATCH MIXM
128
+ HATCH\ MMIC = HATCH MAP
129
+ HATCH\ MOFF = HATCH MOFF
130
+ HATCH\ MONO = HATCH MONO
131
+ HATCH\ MOVR = HATCH BKS
132
+ HATCH\ MOVRD = HATCH MAP
133
+ HATCH\ MRAR = HATCH MRAR
134
+ HATCH\ MREF = HATCH BKS
135
+ HATCH\ MSHLV = HATCH BKS
136
+ HATCH\ MSOFT = HATCH MSOFT
137
+ HATCH\ NER = HATCH NER
138
+ HATCH\ SAR = HATCH SAR
139
+ HATCH\ SEAR = HATCH SEAR
140
+ HATCH\ SEM = HATCH NER
141
+ HATCH\ SLVR = HATCH SLVR
142
+ HATCH\ SSBU = HATCH SSBU
143
+ HATCH\ TECH = HATCH TECH
144
+ HERB\ HEBC = HERB HEBC
145
+ HERB\ HEBO = HERB HEBO
146
+ HERB\ HEBR = HERB HEBR
147
+ MUSIC\ ADM = MUSIC ADM
148
+ MUSIC\ DIC = MUSIC DIC
149
+ MUSIC\ DIS = MUSIC DIS
150
+ MUSIC\ DVD = MUSIC DVD
151
+ MUSIC\ EDIS = MUSIC EDIS
152
+ MUSIC\ ERES = MUSIC ERES
153
+ MUSIC\ FOLIO = MUSIC FOLIO
154
+ MUSIC\ MIC = MUSIC MIC
155
+ MUSIC\ MINI = MUSIC MINI
156
+ MUSIC\ PER = MUSIC PER
157
+ MUSIC\ OVCD = MUSIC OVCD
158
+ MUSIC\ OVR = MUSIC OVR
159
+ MUSIC\ RAR = MUSIC RAR
160
+ MUSIC\ RARW = MUSIC RARW
161
+ MUSIC\ REC = MUSIC REC
162
+ MUSIC\ REF = MUSIC REF
163
+ MUSIC\ REF2 = MUSIC REF2
164
+ MUSIC\ RESC = MUSIC RESC
165
+ MUSIC\ SOFT = MUSIC SOFT
166
+ MUSIC\ VID = MUSIC VID
167
+ MUSM\ ANT = MUSM ANT
168
+ MUSM\ ANTE = MUSM ANTE
169
+ MUSM\ ANTO = MUSM ANTO
170
+ MUSM\ BIR = MUSM BIR
171
+ MUSM\ BIRC = MUSM BIRC
172
+ MUSM\ CAGE = MUSM CAGE
173
+ MUSM\ ERES = MUSM ERES
174
+ MUSM\ FIS = MUSM FIS
175
+ MUSM\ FISO = MUSM FISO
176
+ MUSM\ HEP = MUSM HEP
177
+ MUSM\ HEPO = MUSM HEPO
178
+ MUSM\ INS = MUSM INS
179
+ MUSM\ INSO = MUSM INSO
180
+ MUSM\ INST = MUSM INST
181
+ MUSM\ MAIN = MUSM MAIN
182
+ MUSM\ MAM = MUSM MAM
183
+ MUSM\ MAMO = MUSM MAMO
184
+ MUSM\ MIC = MUSM MIC
185
+ MUSM\ MOL = MUSM MOL
186
+ MUSM\ MOLO = MUSM MOLO
187
+ MUSM\ OVR = MUSM OVR
188
+ MUSM\ PAL = MUSM PAL
189
+ MUSM\ PALO = MUSM PALO
190
+ MUSM\ PALR = MUSM PALR
191
+ MUSM\ PER = MUSM PER
192
+ MUSM\ REF = MUSM REF
193
+ MUSM\ RESC = MUSM RESC
194
+ MUSM\ RESP = MUSM RESP
195
+ MUSM\ SPE = MUSM SPE
196
+ PUB\ CDR = PUB CDR
197
+ PUB\ ERES = PUB ERES
198
+ PUB\ IND = PUB IND
199
+ PUB\ OVR = PUB OVR
200
+ PUB\ PER = PUB PER
201
+ PUB\ RAR = PUB RAR
202
+ PUB\ REF = PUB REF
203
+ PUB\ RESC = PUB RESC
204
+ PUB\ RESP = PUB RESP
205
+ PUB\ RREF = PUB RREF
206
+ PUB\ SOFT = PUB SOFT
207
+ SCI\ ATL = SCI ATL
208
+ SCI\ DIS = SCI DIS
209
+ SCI\ BKS = SCI BKS
210
+ SCI\ ERES = SCI ERES
211
+ SCI\ IND = SCI IND
212
+ SCI\ INDT = SCI INDT
213
+ SCI\ MAS = SCI MAS
214
+ SCI\ OVR = SCI OVR
215
+ SCI\ REF = SCI REF
216
+ SCI\ RESC = SCI RESC
217
+ SCI\ RESP = SCI RESP
218
+ SCI\ SER = SCI SER
219
+ SOC\ AV = SOC AV
220
+ SOC\ DIS = SOC DIS
221
+ SOC\ ERES = SOC ERES
222
+ SOC\ FAC = SOC FAC
223
+ SOC\ PER = SOC PER
224
+ SOC\ PER2 = SOC PER2
225
+ SOC\ REF = SOC REF
226
+ SOC\ RESC = SOC RESC
227
+ SPEC\ ASA = SPEC ASA
228
+ SPEC\ ASG = SPEC ASG
229
+ SPEC\ ATL1 = SPEC ATL1
230
+ SPEC\ ATL2 = SPEC ATL2
231
+ SPEC\ BIND = SPEC BIND
232
+ SPEC\ CASE = SPEC CASE
233
+ SPEC\ CHIL = SPEC CHIL
234
+ SPEC\ FAUL = SPEC FAUL
235
+ SPEC\ FILE = SPEC FILE
236
+ SPEC\ FOL = SPEC FOL
237
+ SPEC\ GOSL = SPEC GOSL
238
+ SPEC\ HUB = SPEC HUB
239
+ SPEC\ ISLM = SPEC ISLM
240
+ SPEC\ JHC = SPEC JHC
241
+ SPEC\ LABD = SPEC LABD
242
+ SPEC\ LAFI = SPEC LAFI
243
+ SPEC\ LAFO = SPEC LAFO
244
+ SPEC\ LAFP = SPEC LAFP
245
+ SPEC\ LAMI = SPEC LAMI
246
+ SPEC\ LAMS = SPEC LAMS
247
+ SPEC\ LAOF = SPEC LAOF
248
+ SPEC\ LAOV = SPEC LAOV
249
+ SPEC\ LAPA = SPEC LAPA
250
+ SPEC\ LARC = SPEC LARC
251
+ SPEC\ LARF = SPEC LARF
252
+ SPEC\ LAST = SPEC LAST
253
+ SPEC\ MIC = SPEC MIC
254
+ SPEC\ MICH = SPEC MICH
255
+ SPEC\ MSS = SPEC MSS
256
+ SPEC\ OFF = SPEC OFF
257
+ SPEC\ OVR = SPEC OVR
258
+ SPEC\ PAPY = SPEC PAPY
259
+ SPEC\ PARS = SPEC PARS
260
+ SPEC\ REC = SPEC REC
261
+ SPEC\ REF = SPEC REF
262
+ SPEC\ RCLC = SPEC RCLC
263
+ SPEC\ RTHC = SPEC RTHC
264
+ SPEC\ SCFI = SPEC SCFI
265
+ SPEC\ SCI = SPEC SCI
266
+ SPEC\ SHA = SPEC SHA
267
+ SPEC\ STO = SPEC STO
268
+ SPEC\ THC = SPEC THC
269
+ SPEC\ WALP = SPEC WALP
270
+ SPEC\ WLPR = SPEC WLPR
271
+ SPEC\ WOR = SPEC WOR
272
+ TAUB\ ERES = TAUB ERES
273
+ TAUB\ ILL = TAUB ILL
274
+ TAUB\ IND = TAUB IND
275
+ TAUB\ INDA = TAUB INDA
276
+ TAUB\ MIC = TAUB MIC
277
+ TAUB\ OVR = TAUB OVR
278
+ TAUB\ PER = TAUB PER
279
+ TAUB\ RAR = TAUB RAR
280
+ TAUB\ RARA = TAUB RARA
281
+ TAUB\ RARC = TAUB RARC
282
+ TAUB\ RARD = TAUB RARD
283
+ TAUB\ RARF = TAUB RARF
284
+ TAUB\ RARH = TAUB RARH
285
+ TAUB\ RARI = TAUB RARI
286
+ TAUB\ RARJ = TAUB RARJ
287
+ TAUB\ RARL = TAUB RARL
288
+ TAUB\ RARM = TAUB RARM
289
+ TAUB\ RARO = TAUB RARO
290
+ TAUB\ RARP = TAUB RARP
291
+ TAUB\ RARR = TAUB RARR
292
+ TAUB\ RARW = TAUB RARW
293
+ TAUB\ REF = TAUB REF
294
+ TAUB\ RESC = TAUB RESC
295
+ TAUB\ STOR = TAUB STOR
296
+ UGL\ ATL = UGL ATL
297
+ UGL\ CLC = UGL CLC
298
+ UGL\ ERES = UGL ERES
299
+ UGL\ IND = UGL IND
300
+ UGL\ OFF = UGL OFF
301
+ UGL\ OVR = UGL OVR
302
+ UGL\ PER = UGL PER
303
+ UGL\ PRON = UGL PRON
304
+ UGL\ REF = UGL REF
305
+ UGL\ RESC = UGL RESC
306
+ FLINT\ ABST = FLINT ABST
307
+ FLINT\ ARCH = FLINT ARCH
308
+ FLINT\ ATLAS = FLINT REF
309
+ FLINT\ BUSB = FLINT MAIN
310
+ FLINT\ BUSP = FLINT PERI
311
+ FLINT\ CHILD = FLINT CHILD
312
+ FLINT\ ELEC = FLINT ELEC
313
+ FLINT\ ERES = FLINT ERES
314
+ FLINT\ FSPAM = FLINT MAIN
315
+ FLINT\ ILL = FLINT ILL
316
+ FLINT\ MAIN = FLINT MAIN
317
+ FLINT\ MCARD = FLINT MICRO
318
+ FLINT\ MEDIA = FLINT MEDIA
319
+ FLINT\ MFICH = FLINT MICRO
320
+ FLINT\ MFILM = FLINT MICRO
321
+ FLINT\ MOVRZ = FLINT MEDIA
322
+ FLINT\ MSTR = FLINT MAIN
323
+ FLINT\ OVERZ = FLINT MAIN
324
+ FLINT\ PERI = FLINT PERI
325
+ FLINT\ REF = FLINT REF
326
+ FLINT\ REFD = FLINT REF
327
+ FLINT\ RESV = FLINT RESV
328
+ FLINT\ SPEC = FLINT ARCH
329
+ FLINT\ TECH = FLINT REF
330
+ UMTRI\ INTER = UMTRI INTER
331
+ UMTRI\ STAPP = UMTRI STAPP
332
+ SDR\ MIU = SDR MIU
333
+ SDR\ UMDL = SDR UMDL
334
+ SDR\ UMLAW = SDR UMLAW
335
+ SDR\ GWLA = SDR GWLA
336
+ SDR\ WU = SDR WU
337
+ SDR\ INU = SDR INU
338
+ SDR\ NRLF = SDR NRLF
339
+ SDR\ UCSC = SDR UCSC
340
+ SDR\ UCSD = SDR UCSD
341
+ SDR\ ISRLF = SDR ISRLF
342
+ SDR\ PST = SDR PST
343
+ SDR\ UMN = SDR UMN
344
+ UNION\ TOY = UNION TOY
345
+ UNION\ CHES = UNION CHES
@@ -0,0 +1,130 @@
1
+ ##############################################################################################
2
+ # This file has been reorganized to reflect the order of field declarations in schema.xml. #
3
+ # Where existing VuFind fields overlapped with those defined by the CEILIDH metadata group, #
4
+ # the stock VuFind definition has been commented out and the CEILIDH definition substituted. #
5
+ # Additional CEILIDH-defined fields are included at the end of this file. --JKG #
6
+ ##############################################################################################
7
+
8
+ #### VUFIND CORE FIELDS ####
9
+
10
+ id = 001, first
11
+ #fullrecord = FullRecordAsMarc
12
+ fullrecord = FullRecordAsXML
13
+ allfields = custom, getAllSearchableFields(100, 999)
14
+
15
+ #### VUFIND INSTITUTIONAL FIELDS ####
16
+
17
+ institution = 971a, institution_map.properties
18
+ collection = "Catalog"
19
+ building = 852bc:971a, library_map.properties
20
+ location = 971a:852b:852bc, location_map.properties
21
+
22
+ ######## IDENTIFIERS ###########
23
+
24
+ htsource = custom, getHTNameSpace, ht_namespace_map.properties
25
+
26
+ lccn = 010a
27
+ #ctrlnum = 035a
28
+ oclc = custom, getOclcNum
29
+ sdrnum = custom, getSDRNum
30
+ rptnum = 088a
31
+ isbn = 020a:020z
32
+ issn = 022a:022l:022m:022y:022z:247x
33
+ isn_related = 400x:410x:411x:440x:490x:500x:510x:534xz:556z:581z:700x:710x:711x:730x:760x:762x:765xz:767xz:770xz:772x:773xz:774xz:775xz:776xz:777x:780xz:785xz:786xz:787xz
34
+
35
+
36
+ callnumber = 852hij
37
+ sudoc = 086a:086z
38
+
39
+ #### MISC ####
40
+
41
+ #language = 008[35-37]:041a[0-2]:041d[0-2]:041e[0-2]:041j[0-2], language_map.properties
42
+ language = custom, getLanguage, language_map.properties
43
+ #format = 600v:610v:611v:630v:648v:650v:651v:653v:654v:655v:690v:691v:655a:970a, format_map_umich.properties
44
+ format = 970a, format_map_umich.properties
45
+ availability = 973b, availability_map_umich.properties
46
+ ht_availability = 974r, availability_map_ht.properties
47
+ cat_date = 972c
48
+ #physical = 300abc
49
+ publisher = 260b:533c
50
+ edition = 250a
51
+ #contents = 505atr
52
+ #url = 856u
53
+ ht_id = 974u
54
+ ht_id_update = custom, getHathiUpdate
55
+ ht_id_display = custom, getHathiData
56
+ ht_json = custom, getHathiDataJSON
57
+
58
+ ########## AUTHOR ############
59
+
60
+ author = 100abcd:110abcd:111abc
61
+ author2 = 110ab:111ab:700abcd:710ab:711ab
62
+
63
+ author_top = 100abcdefgjklnpqtu0:110abcdefgklnptu04:111acdefgjklnpqtu04:700abcdejqux034:710abcdeux034:711acdegjnqux034:720a:765a:767a:770a:772a:774a:775a:776a:777a:780a:785a:786a:787a:245c
64
+ author_rest = 505r
65
+
66
+ #author_1xx = 100abcdefgjklnpqtu0:110abcdefgklnptu04:111acdefgjklnpqtu04
67
+ #author_2xx = 245c
68
+ #author_4xx = 400abcdn:411abcdn
69
+ #author_5xx = 505r:508a:511a
70
+ #author_7xx = 700abcdejqux034:710abcdeux034:711acdegjnqux034:720a:765a:767a:770a:772a:774a:775a:776a:777a:780a:785a:786a:787a
71
+ #author_8xx = 800abcdeqwx034:810abcdewx034:811acdejnwx034:505ar
72
+
73
+
74
+ #auth_author = 100abcd
75
+ #author2-role = 700e
76
+ #auth_author2 = 700abcd
77
+
78
+ ######### TITLE ############
79
+
80
+ title = custom, getTitle(abdefghknp)
81
+ title_ab = custom, getTitle(akb)
82
+ title_a = custom, getTitle(ak)
83
+ titleSort = custom, getTitle_sort
84
+ title_top = 240adfghklmnoprs0:245abfghknps:111acdefgjklnpqtu04:130adfghklmnoprst0
85
+ title_rest = 210ab:222ab:242abhnpy:243adfghklmnoprs:246abdenp:247abdenp:700fghjklmnoprstx03:710fghklmnoprstx03:711acdefghjklnpqstux034:730adfghklmnoprstx03:740ahnp:765st:767st:770st:772st:773st:775st:776st:777st:780st:785st:786st:787st:830adfghklmnoprstv:440anpvx:490avx:505t
86
+ series = 440ap:800abcdfpqt:830ap
87
+ series2 = 490a
88
+
89
+ serialTitle = custom, getSerialTitle(abdefghknp)
90
+ serialTitle_ab = custom, getSerialTitle(ab)
91
+ serialTitle_a = custom, getSerialTitle(a)
92
+ serialTitle_rest = custom, getDataForFormat(130adfgklmnoprst:210ab:222ab:240adfgklmnprs:246abdenp:247abdenp:730anp:740anp:765st:767st:770st:772st:775st:776st:777st:780st:785st:786st:787st,SE)
93
+
94
+ #### CATEGORIZATION #########
95
+
96
+ #fulltopic = custom, getFullTopic
97
+ topic = 600abcdefghjklmnopqrstuvxyz:600a:610abcdefghklmnoprstuvxyz:610a:611acdefghjklnpqstuvxyz:611a:630adefghklmnoprstvxyz:630a:648avxyz:648a:650abcdevxyz:600a:651aevxyz:651a:653a:654abevyz:654a:655abvxyz:655a:656akvxyz:656a:657avxyz:657a:658ab:658a:662abcdefgh:662a:
98
+ #subtopic = 600x:610x:611x:630x:648x:650x:651x:653x:654x:655x:656x:657x:658x:662x:690x:691x:692x:693x:694x:695x:696x:697x:698x:699x
99
+ #fullgenre = custom, getFullGenre
100
+ genre = 655ab
101
+ #subgenre = 655v:655x:655y:655z
102
+ #hlb_a = 975a
103
+ #hlb_b = 975b
104
+ #hlb_both: 975a:975b
105
+ #hlb_ab = 975ab
106
+ #hlb_full = 975c
107
+
108
+
109
+ #hlb3: 976a:976b:976c
110
+
111
+
112
+ hlb3 = custom, getHLB3
113
+ hlb3Delimited = custom, getHLB3Delimited
114
+
115
+ ####### TIME AND PLACE #######
116
+
117
+ #dateSpan = 362a
118
+ #fullgeographic = custom, getFullGeographic
119
+ geographic = 043a, area_map.properties
120
+ #subgeographic = 651v:651x:651y:651z
121
+ era = 600y:610y:611y:630y:650y:651y:654y:655y:656y:657y:690z:691y:692z:694z:695z:696z:697z:698z:699z
122
+ country_of_pub = 008[15-17]:008[17]:752ab, country_map.properties
123
+ publishDate = DateOfPublication
124
+ #publishDate = 008[7-10]
125
+ publishDateRange = custom, getPublishDateRange
126
+
127
+ #### ADDITIONAL CEILIDH-DEFINED FIELDS ####
128
+
129
+ # full spec for format facet, will require custom indexing code (currently unused)
130
+ # format_facet = 600xv:610xv:611xv:630xv:648xv:650xv:651xv:653xv:654xv:655xv:656xv:657xv:658xv:662xv:690xv:691xv:692xv:693xv:694xv:695xv:696xv:697xv:698xv:699xv
data/spec/maps_spec.rb ADDED
@@ -0,0 +1,91 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Maps" do
4
+ before do
5
+ @kvmap = MARCSpec::KVMap.new('kvmap', {'one' => '1', 'two' => ['2', 'zwei']})
6
+ @mvmap = MARCSpec::MultiValueMap.new('mvmap', [[/bi/, 'Bill'], [/mo/i, 'Molly'], [/ll/, 'Bill'], [/lly/i, ['One', 'Two']]])
7
+ end
8
+
9
+ it "knows its name" do
10
+ @kvmap.mapname.should.equal 'kvmap'
11
+ @mvmap.mapname.should.equal 'mvmap'
12
+ end
13
+
14
+ it "gets simple value from a kv map" do
15
+ @kvmap['one'].should.equal '1'
16
+ end
17
+
18
+ it "gets a list value from a kv map" do
19
+ @kvmap['two'].should.equal ['2', 'zwei']
20
+ end
21
+
22
+ it "gets nothing on nonmatches" do
23
+ @kvmap['ddd'].should.equal nil
24
+ @mvmap['ddd'].should.equal [nil]
25
+ end
26
+
27
+ it "gets correct values from multivaluemap" do
28
+ @mvmap['bi'].should.equal ['Bill']
29
+ @mvmap['bill'].should.equal ['Bill']
30
+ @mvmap['mobi'].sort.should.equal ['Bill', 'Molly'].sort
31
+ @mvmap['Molly'].sort.should.equal ['Molly', 'Bill', 'One', 'Two'].sort
32
+ end
33
+
34
+ it "correctly uses default value" do
35
+ @mvmap['bi', 'default'].should.equal ['Bill']
36
+ @mvmap['ddd', 'default'].should.equal ['default']
37
+ @kvmap['ddd', 'default'].should.equal 'default'
38
+ @kvmap['one', 'default'].should.equal '1'
39
+ end
40
+
41
+ it "should round-trip a kvmap" do
42
+ s = @kvmap.asPPString
43
+ newkvmap = MARCSpec::KVMap.fromPPString s
44
+ newkvmap.should.equal @kvmap
45
+ end
46
+
47
+ it "should round trip a multivaluemap" do
48
+ s = @mvmap.asPPString
49
+ newmvmap = MARCSpec::MultiValueMap.fromPPString s
50
+ newmvmap.should.equal @mvmap
51
+ end
52
+
53
+ it "should read a kv solrmarc file" do
54
+ map = MARCSpec::KVMap.from_solrmarc_file "#{DIR}/data/umich/translation_maps/country_map.properties"
55
+ map.mapname.should.equal 'country_map'
56
+ map["nl"].should.equal "New Caledonia"
57
+ end
58
+
59
+ it "should read a pattern solrmarc file" do
60
+ map = MARCSpec::MultiValueMap.from_solrmarc_file "#{DIR}/data/umich/translation_maps/library_map.properties"
61
+ map.mapname.should.equal 'library_map'
62
+ map['UMTRI Stuff'].should.equal ['Transportation Research Institute Library (UMTRI)']
63
+ map['HATCH DOCS'].should.equal ['Hatcher Graduate', 'Hatcher Graduate Documents Center']
64
+ end
65
+
66
+ it "can dump/load a kv map via generic map interface" do
67
+ map = MARCSpec::KVMap.from_solrmarc_file "#{DIR}/data/umich/translation_maps/country_map.properties"
68
+ f = Tempfile.new('kvmap')
69
+ f.puts map.asPPString
70
+ path = f.path
71
+ f.close
72
+ map2 = MARCSpec::Map.fromFile(path)
73
+ f.unlink
74
+ map.class.should.equal MARCSpec::KVMap
75
+ map.should.equal map2
76
+ end
77
+
78
+ it "can dump/load a multivalue map via generic map interface" do
79
+ map = MARCSpec::MultiValueMap.from_solrmarc_file "#{DIR}/data/umich/translation_maps/library_map.properties"
80
+ f = Tempfile.new('mvmap')
81
+ f.puts map.asPPString
82
+ path = f.path
83
+ f.close
84
+ map2 = MARCSpec::Map.fromFile(path)
85
+ f.unlink
86
+ map.class.should.equal MARCSpec::MultiValueMap
87
+ map.should.equal map2
88
+ end
89
+
90
+
91
+ end
@@ -0,0 +1,109 @@
1
+ require 'spec_helper'
2
+
3
+ # LEADER 00734njm a2200217uu 4500
4
+ # 001 afc99990058366
5
+ # 003 DLC
6
+ # 005 20071104155141.9
7
+ # 007 sd ummunniauub
8
+ # 008 071103s1939 xxufmnne||||||||| u eng||
9
+ # 010 $a afc99990058366
10
+ # 040 $a DLC $c DLC
11
+ # 245 04 $a The Texas ranger $h [sound recording] / $c Sung by Beale D. Taylor.
12
+ # 260 $a Medina, Texas, $c 1939.
13
+ # 300 $a 1 sound disc : $b analog, 33 1/3 rpm, mono. ; $c 12 in.
14
+ # 651 0 $a Medina $z Texas $z United States of America.
15
+ # 700 1 $a Lomax, John Avery, 1867-1948 $e Recording engineer.
16
+ # 700 1 $a Lomax, Ruby T. (Ruby Terrill) $e Recording engineer.
17
+ # 700 1 $a Taylor, Beale D. $e Singer.
18
+ # 852 $a American Folklife Center, Library of Congress
19
+ # 852 $a DLC
20
+
21
+ describe "ControlFieldSpec" do
22
+
23
+ before do
24
+ @one = MARC4J4R::Reader.new("#{DIR}/data/one.dat").first
25
+ # @batch = MARC4J4R::Reader.new("#{DIR}/batch.dat").collect
26
+ end
27
+
28
+ # afc99990058366 # data
29
+ # 01234567890123 # index
30
+ it "gets a single full value" do
31
+ cfs = MARCSpec::ControlFieldSpec.new('001')
32
+ cfs.marc_values(@one).should.equal ["afc99990058366"]
33
+ end
34
+
35
+ it "gets a single character" do
36
+ cfs = MARCSpec::ControlFieldSpec.new('001', 10 )
37
+ cfs.marc_values(@one).should.equal ['8']
38
+ end
39
+
40
+ it "gets a range of characters" do
41
+ cfs = MARCSpec::ControlFieldSpec.new('001', 6..10 )
42
+ cfs.marc_values(@one).should.equal ['90058']
43
+ end
44
+
45
+ it "should round trip" do
46
+ cfs = MARCSpec::ControlFieldSpec.new('001', 6..10 )
47
+ cfs2 = MARCSpec::ControlFieldSpec.fromPPString(cfs.asPPString)
48
+ cfs.should.equal cfs2
49
+ end
50
+ end
51
+
52
+
53
+ describe "LeaderSpec" do
54
+ before do
55
+ @one = MARC4J4R::Reader.new("#{DIR}/data/one.dat").first
56
+ end
57
+
58
+ it "Works with full leader" do
59
+ cfs = MARCSpec::LeaderSpec.new('LDR')
60
+ cfs.marc_values(@one).should.equal @one.leader
61
+ end
62
+
63
+ it "Works with substring of leader" do
64
+ cfs = MARCSpec::LeaderSpec.new('LDR', 3..5)
65
+ cfs.marc_values(@one).should.equal @one.leader[3..5]
66
+ end
67
+ end
68
+
69
+
70
+
71
+ describe "VariableFieldSpec" do
72
+ before do
73
+ @one = MARC4J4R::Reader.new("#{DIR}/data/one.dat").first
74
+ # @batch = MARC4J4R::Reader.new("#{DIR}/batch.dat").collect
75
+ end
76
+
77
+ it "Should get a whole field separated by spaces" do
78
+ dfs = MARCSpec::VariableFieldSpec.new('260')
79
+ dfs.marc_values(@one).should.equal ["Medina, Texas, 1939."]
80
+ end
81
+
82
+ it "Should get just the $a" do
83
+ dfs = MARCSpec::VariableFieldSpec.new('260', 'a')
84
+ dfs.marc_values(@one).should.equal ["Medina, Texas,"]
85
+ end
86
+
87
+ it "Should get all fields via several equal routes" do
88
+ a = MARCSpec::VariableFieldSpec.new('260').marc_values(@one)
89
+ ac = MARCSpec::VariableFieldSpec.new('260', ['a', 'c']).marc_values(@one)
90
+ ca = MARCSpec::VariableFieldSpec.new('260', ['c', 'a']).marc_values(@one)
91
+ ca2 = MARCSpec::VariableFieldSpec.new('260', 'ca').marc_values(@one)
92
+ allrange = MARCSpec::VariableFieldSpec.new('260', 'a'..'z').marc_values(@one)
93
+ a.should.equal ac
94
+ ac.should.equal ca
95
+ ca.should.equal allrange
96
+ end
97
+
98
+ it "should get all three 700a's" do
99
+ a = MARCSpec::VariableFieldSpec.new('700', 'a').marc_values(@one)
100
+ a.should.equal ["Lomax, John Avery, 1867-1948", "Lomax, Ruby T. (Ruby Terrill)", "Taylor, Beale D."]
101
+ end
102
+
103
+ it "should round trip" do
104
+ ac = MARCSpec::VariableFieldSpec.new('260', ['a', 'c'])
105
+ ac2 = MARCSpec::VariableFieldSpec.fromPPString(ac.asPPString)
106
+ ac.should.equal ac2
107
+ end
108
+
109
+ end
@@ -0,0 +1,10 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+