KMAIN 1911 Auth-to-auth audience linking
authorNick Duncan <nDuncan@catalystitservices.com>
Thu, 5 Nov 2015 18:44:01 +0000 (13:44 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Authority Records Now Only Link To Other Authority Records With The Same 008/11 (Audience)

Signed-off-by: Nick Duncan <nDuncan@catalystitservices.com>
KCLS/linking/authority_authority_linker.pl

index be854b4..326e216 100755 (executable)
@@ -157,6 +157,7 @@ while (my ($src, $links) = $sth->fetchrow_array) {
         my $src_rec = $e->retrieve_authority_record_entry($src) or
             die $e->die_event;
         my $src_marc = MARC::Record->new_from_xml($src_rec->marc);
+        my $Auth_Source_Indic = substr($src_marc->field('008')->data(), 10, 1);
 
         for my $link (split ';', $links) {
             my ($target, $field_id) = split ',', $link;
@@ -167,7 +168,7 @@ while (my ($src, $links) = $sth->fetchrow_array) {
                     die $e->die_event;
             my $target_marc = MARC::Record->new_from_xml($target_rec->marc);
             my $cni = $target_marc->field('003')->data;
-
+            my $Auth_Target_Indic = substr($target_marc->field('008')->data(), 10, 1);
             my $acsaf = get_acsaf($e, $field_id) or die $e->die_event;
 
             for my $field ($src_marc->field($acsaf->tag)) {
@@ -184,7 +185,7 @@ while (my ($src, $links) = $sth->fetchrow_array) {
                         $tfield, $acsaf->main_entry->display_sf_list, $acsaf->main_entry->joiner
                     );
 
-                    if ($target_string eq $src_string) {
+                    if ($target_string eq $src_string and $Auth_Source_Indic eq $Auth_Target_Indic) {
                         print "got a match ...\n" if $options{debug};
                         $field->update('0' => "($cni)$target");
                     }