]> git.evergreen-ils.org Git - working/Evergreen.git/blob - docs/modules/cataloging/pages/authorities_advanced.adoc
LP1944205 Advanced Authority Documentation
[working/Evergreen.git] / docs / modules / cataloging / pages / authorities_advanced.adoc
1 = Advanced Authority =
2 :toc:
3
4 == General knowledge ==
5
6 Evergreen respects the full LoC standards when it comes to the Authority MARC. Authority headings are found in an authority record denoted by the 1XX field. Of which, there should only be one. The "related" bib record depends on the last two characters in the 1XX field.
7
8 All of the core definitions are here:
9
10 [source,sql]
11 ----
12
13 select
14 *
15 from 
16 authority.control_set_authority_field acsaf
17 join authority.heading_field ahf on (ahf.id=acsaf.heading_field)
18 order by tag,name;
19
20 -- And showing all* authority fields (some that do not connect to heading_field)
21
22 select 
23 *
24 from 
25 authority.control_set_authority_field 
26 order by tag,name
27
28 ----
29
30
31
32 [cols=3*]
33 |===
34
35 | *Tag*
36 | *Heading Name*
37 | *Purpose*
38
39 | 100
40 | Heading -- Personal Name
41 | main
42
43 | 110
44 | Heading -- Corporate Name
45 | main
46
47 | 111
48 | Heading -- Meeting Name
49 | main
50
51 | 130
52 | Heading -- Uniform Title
53 | main
54
55 | 150
56 | Heading -- Topical Term
57 | main
58
59 | 151
60 | Heading -- Geographic Name
61 | main
62
63 | 155
64 | Heading -- Genre/Form Term
65 | main
66
67 | 400
68 | See From Tracing -- Personal Name
69 | variant
70
71 | 410
72 | See From Tracing -- Corporate Name
73 | variant
74
75 | 411
76 | See From Tracing -- Meeting Name
77 | variant
78
79 | 430
80 | See From Tracing -- Uniform Title
81 | variant
82
83 | 450
84 | See From Tracing -- Topical Term
85 | variant
86
87 | 451
88 | See From Tracing -- Geographic Name
89 | variant
90
91 | 455
92 | See From Tracing -- Genre/Form Term
93 | variant
94
95 | 500
96 | See Also From Tracing -- Personal Name
97 | related
98
99 | 510
100 | See Also From Tracing -- Corporate Name
101 | related
102
103 | 511
104 | See Also From Tracing -- Meeting Name
105 | related
106
107 | 530
108 | See Also From Tracing -- Uniform Title
109 | related
110
111 | 550
112 | See Also From Tracing -- Topical Term
113 | related
114
115 | 551
116 | See Also From Tracing -- Geographic Name
117 | related
118
119 | 555
120 | See Also From Tracing -- Genre/Form Term
121 | related
122
123 |===
124
125
126
127 == Connection to bibs ==
128
129 Evergreen requires manual linking from bibs to authorities. This can be done from the Bib MARC edit interface. But there is a script that attempts to make some connections automatically (*authority_control_fields.pl*). This script is generally setup to run nightly, linking all of the bibs that were updated for the previous 24 hours.
130
131 Table *authority.bib_linking* table also retains the connection map.
132
133 When a connection is made, Evergreen will update the appropriate field in the MARC record (650, 100, etc) to match the Authority record (1XX) field. It will also append the magic *$0* field onto the bib record denoting which authority control record ID is controling that field. This makes it possible for Evergreen to update the controlled field when the authority record gets updated.
134
135 == Database functions ==
136
137 === authority.reingest_authority_full_rec ===
138
139 This function parses *authority.record_entry* and populates *authority.full_rec*.
140
141 === authority.propagate_changes ===
142
143 This gets called when an already-existing authority record gets updated. This will speed through all of the linked bibs (*authority.bib_linking* table contains the links) and make sure that the controlled field(s) within the bib record get the field language updated to match the heading from the authority record (1XX field in authority record).
144
145 === metabib.browse ===
146
147 Function responsible for returning related authority search results. It's possible for authority records to turn up in search results even without a linked bib.
148
149 === metabib.staged_browse ===
150
151 A secondary function that metabib.browse calls. This includes a section for authority record:
152
153 Excerpt from *metabib.staged_browse* function
154
155 [source,sql]
156 ----
157
158 ....
159 ...
160 ..
161
162     --Is unauthorized?
163     SELECT INTO unauthorized_entry *
164     FROM metabib.browse_entry_simple_heading_map mbeshm
165     INNER JOIN authority.simple_heading ash ON ( mbeshm.simple_heading = ash.id )
166     INNER JOIN authority.control_set_authority_field acsaf ON ( acsaf.id = ash.atag )
167     JOIN authority.heading_field ahf ON (ahf.id = acsaf.heading_field)
168     WHERE mbeshm.entry = rec.id
169     AND   ahf.heading_purpose = 'variant';
170 ..
171 ...
172 ....
173
174 ----
175
176 == Authority integration in search ==
177
178 As mentioned above, Evergreen will integrate browse search results from Authority control records. Standard search does not include Authority records. The Authority heading 1XX fields are the "main" search results from Authority records. However, the 4XX fields are "variant" fields and are also included as the "See" search result.
179
180 Search  references table: *metabib.browse_entry_simple_heading_map*. This table links to *authority.simple_heading*. *authority.simple_heading* links to *authority.control_set_authority_field* which defines the different authority control fields and their "purpose". Only fields that are defined as "variant" will be included in the "See" results.
181
182
183 === Making more authority fields "See" ===
184
185 As mentioned above, Evergreen has a feature that will cause some search results to give the user a *"See"* result. Giving the user a clue that their search term is "related" or is a *"variant"* of the search results. By default, only the 4XX fields are included for the "See" results. If you would like to add more defined authority record fields in the *"See"* results, you will need to update the definition of the defined field. The database functions: *metabib.browse* and *metabib.staged_browse* have a hard-coded definition of *"variant"*. Your desired fields need to be defined as *"variant"*.
186
187 Example of adding the "5XX" fields to the "See" search results
188
189 [source,sql]
190 ----
191
192 begin;
193
194     update authority.heading_field
195     set
196     heading_purpose='variant'
197     where
198     id in
199     (
200         select ahf.id
201         from
202         authority.control_set_authority_field acsaf
203         join authority.heading_field ahf on (ahf.id=acsaf.heading_field)
204         where
205         acsaf.tag ~'^5..' and
206         acsaf.tag !='555' and
207         heading_purpose='related'
208     );
209
210 commit;
211
212 ----
213
214 == Subject vs. Author vs. Title vs. Series ==
215
216 You might notice that when you import/create new authority records, you are not prompted to choose an index. Evergreen "figures out" the search index to which the authority record belongs. It does this based up on the heading field. You'll notice that some authority records have a 1XX field like "150" or "100". The second and third digit "means" which index it's for.
217
218 Though, I don't think that Evergreen pays much respect to the 008, I think it's worth mentioning.
219
220 There are some indicators in the 008 field defined by LoC:
221
222 link:https://www.loc.gov/marc/authority/ad008.html[Library of Congress Auth 008 def]
223
224 === 008 characters "14", "15", "16" definitions: ===
225
226 [cols=2*]
227 |===
228
229 | *008 Position*
230 | *Definition*
231
232 | 14
233 | Heading use-main or added entry
234
235 | 15
236 | Heading use-subject added entry
237
238 | 16
239 | Heading use-series added entry
240
241 |===
242
243
244 === Value definition ===
245
246 [cols=2*]
247 |===
248
249 | *Value*
250 | *Definition*
251
252 | a
253 | Appropriate
254
255 | b
256 | Not Appropriate
257
258 | \|
259 | No attempt to code
260
261 |===
262
263
264 NOTE: Evergreen will choose the destinition index for the authority record index based upon the 1XX heading definition.
265
266 === Putting Authority records into different indexes ===
267
268 You might find yourself wanting the Browse Subject index to also include some of the search terms that are found only in the Author index. Or visa versa. The "glue" that puts makes the connection between an index and an Authority heading can be queried like this:
269
270 [source,sql]
271 ----
272
273 select
274 acsaf.tag "Authority Tag",acsaf.name,cmf.field_class
275 from
276 authority.control_set_bib_field acsbf
277 join authority.control_set_authority_field acsaf on (acsbf.authority_field=acsaf.id)
278 join authority.control_set_bib_field_metabib_field_map acsbfmfm on(acsbfmfm.bib_field=acsbf.id)
279 join config.metabib_field cmf on (cmf.id=acsbfmfm.metabib_field)
280 order by 3,1
281
282
283 -- Another angle
284
285 select b.*,a.id,a.tag,a.name,m.field_class,m.label,m.name,m.id from 
286  authority.control_set_bib_field b
287 JOIN authority.control_set_authority_field a ON (b.authority_field = a.id),
288  config.metabib_field m,
289 authority.control_set_bib_field_metabib_field_map map
290 where
291 map.bib_field=b.id and
292 map.metabib_field=m.id
293 order by field_class
294
295
296 ----
297
298 NOTE: The main connection (glue) table is *authority.control_set_bib_field_metabib_field_map*
299
300 ==== And now the insert ====
301
302 [source,sql]
303 ----
304
305
306 -- Make new glue
307 begin;
308
309
310 -- Traditional AUTHOR getting applied to SUBJECT
311 INSERT INTO authority.control_set_bib_field_metabib_field_map (bib_field, metabib_field)
312     SELECT  DISTINCT b.id AS bib_field, m.id AS metabib_field
313       FROM  authority.control_set_bib_field b JOIN authority.control_set_authority_field a ON (b.authority_field = a.id), config.metabib_field m
314       WHERE a.tag = '110' AND m.name = 'topic_browse'
315
316       union
317
318 SELECT  DISTINCT b.id AS bib_field, m.id AS metabib_field
319       FROM  authority.control_set_bib_field b JOIN authority.control_set_authority_field a ON (b.authority_field = a.id), config.metabib_field m
320       WHERE a.tag = '100' AND m.name = 'topic_browse'
321       
322       union
323
324 SELECT  DISTINCT b.id AS bib_field, m.id AS metabib_field
325       FROM  authority.control_set_bib_field b JOIN authority.control_set_authority_field a ON (b.authority_field = a.id), config.metabib_field m
326       WHERE a.tag = '111' AND m.name = 'topic_browse'
327       
328       union
329
330 SELECT  DISTINCT b.id AS bib_field, m.id AS metabib_field
331       FROM  authority.control_set_bib_field b JOIN authority.control_set_authority_field a ON (b.authority_field = a.id), config.metabib_field m
332       WHERE a.tag = '130' AND m.name = 'topic_browse'
333       
334       union
335   
336 SELECT  DISTINCT b.id AS bib_field, m.id AS metabib_field
337       FROM  authority.control_set_bib_field b JOIN authority.control_set_authority_field a ON (b.authority_field = a.id), config.metabib_field m
338       WHERE a.tag = '151' AND m.name = 'topic_browse'
339       
340       union
341
342 -- Traditional SUBJECT getting applied to AUTHOR
343     SELECT  DISTINCT b.id AS bib_field, m.id AS metabib_field
344       FROM  authority.control_set_bib_field b JOIN authority.control_set_authority_field a ON (b.authority_field = a.id), config.metabib_field m
345       WHERE a.tag = '150' AND m.name = 'corporate'
346       
347       union
348
349 SELECT  DISTINCT b.id AS bib_field, m.id AS metabib_field
350       FROM  authority.control_set_bib_field b JOIN authority.control_set_authority_field a ON (b.authority_field = a.id), config.metabib_field m
351       WHERE a.tag = '130' AND m.name = 'corporate'
352
353 ;
354
355 commit;
356
357 ----
358
359 === Auxillary "axis" table ===
360
361 Evergreen has another table that makes refernces to "axis" (subject, author, title, topic) but it's not directly for the purpose of browse search results.
362
363 [source,sql]
364 ----
365
366 -- Show axis mappings
367 select abaafm.*,acsaf.tag from 
368 authority.browse_axis_authority_field_map abaafm,
369 authority.control_set_authority_field acsaf
370 where
371 acsaf.id=abaafm.field
372 order by 4;
373
374 ----
375
376 It can't hurt to also make the same connections in this table to mirror what you did above.
377
378 [source,sql]
379 ----
380
381 -- Edit axis mappings
382 begin;
383
384 -- Author headings (110) mapped to "subject"
385 insert into authority.browse_axis_authority_field_map(axis,field)
386 values('subject',2);
387
388 -- Subject headings (150) mapped to "Author"
389 insert into authority.browse_axis_authority_field_map(axis,field)
390 values('author',5);
391
392 commit;
393
394
395 ----
396
397