From: dbs Date: Mon, 9 Nov 2009 02:03:42 +0000 (+0000) Subject: Backport minimal fixes from r14825 and r14826 to address ISSN ingest and retrieval... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e18ae0237bc273e0efb9743827687b59b052bd6d;p=Evergreen.git Backport minimal fixes from r14825 and r14826 to address ISSN ingest and retrieval bugs git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4@14834 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm index 5756291b10..d0725535a8 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm @@ -706,8 +706,9 @@ sub xpath_to_string { } } - $string =~ s/(\w+)\/(\w+)/$1 $2/sgo; - $string =~ s/(\d{4})-(\d{4})/$1 $2/sgo; + $string =~ s/(\w+)\/(\w+)/$1 $2/sgo; + # Split date ranges and ISSNs on the hyphen + $string =~ s/(\d{4})-(\d{3,4}x?)/ $1 $2 /goi; return NFD($string); } @@ -914,8 +915,9 @@ sub _marcxml_to_full_rows { $val =~ s/\pM+//sgo; $val =~ s/\pC+//sgo; $val =~ s/\W+$//sgo; - $val =~ s/(\w+)\/(\w+)/$1 $2/sgo; - $val =~ s/(\d{4})-(\d{4})/$1 $2/sgo; + $val =~ s/(\w+)\/(\w+)/$1 $2/sgo; + # Split date ranges and ISSNs on the hyphen + $val =~ s/(\d{4})-(\d{3,4}x?)/ $1 $2 /goi; $ns->value( lc($val) ); push @ns_list, $ns; diff --git a/Open-ILS/src/sql/Pg/reporter-schema.sql b/Open-ILS/src/sql/Pg/reporter-schema.sql index bd65b9dc83..660a1effae 100644 --- a/Open-ILS/src/sql/Pg/reporter-schema.sql +++ b/Open-ILS/src/sql/Pg/reporter-schema.sql @@ -127,7 +127,7 @@ SELECT r.id, series_statement.value AS series_statement, summary.value AS summary, ARRAY_ACCUM( SUBSTRING(isbn.value FROM $$^\S+$$) ) AS isbn, - ARRAY_ACCUM( SUBSTRING(issn.value FROM $$^\S+$$) ) AS issn, + ARRAY_ACCUM( REGEXP_REPLACE(issn.value, E'^\\S*(\\d{4})[-\\s](\\d{3,4}x?)', E'\\1 \\2') ) AS issn, ARRAY((SELECT DISTINCT value FROM metabib.full_rec WHERE tag = '650' AND subfield = 'a' AND record = r.id)) AS topic_subject, ARRAY((SELECT DISTINCT value FROM metabib.full_rec WHERE tag = '651' AND subfield = 'a' AND record = r.id)) AS geographic_subject, ARRAY((SELECT DISTINCT value FROM metabib.full_rec WHERE tag = '655' AND subfield = 'a' AND record = r.id)) AS genre,