From 35f5da4d4914403cbd40e2f6986e592f4056da5c Mon Sep 17 00:00:00 2001 From: miker Date: Tue, 8 Jun 2010 13:46:33 +0000 Subject: [PATCH] Patch from Galen Charlton: [This] patch adds a new XSL transform for indexing purpose that converts MARC21 880 fields (which are used for alternate graphic representations, i.e., vernacular representations of foreign language strings) to the base tags. For example, if a MARC record for a Chinese book has 245.00 $6 880-01 $a Ba shi san nian duan pian xiao shuo xuan 880.00 $6 245-01/$1 $a\u516b\u5341\u4e09\u5e74\u77ed\u7bc7\u5c0f\u8aaa\u9078 this stylesheet will transform it to the equivalent of 245.00 $6 880-01 $a Ba shi san nian duan pian xiao shuo xuan 245.00 $6 245-01/$1 $a\u516b\u5341\u4e09\u5e74\u77ed\u7bc7\u5c0f\u8aaa\u9078 This allows an indexing XPath like //marc:datafield[@tag='245']/marc:subfield[@code='a'] to bring in both the vernacular and transliterated versions of the 245$a. [ED: pretend the \u-encoded unicode are real characters ... curse you, Chrome, for not giving me the raw string!] git-svn-id: svn://svn.open-ils.org/ILS/trunk@16623 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 1 + .../src/sql/Pg/954.data.marc21expand880.sql | 62 +++++++++++++++++ .../Pg/upgrade/0299.data.marc21expand880.sql | 68 +++++++++++++++++++ 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/sql/Pg/954.data.marc21expand880.sql create mode 100644 Open-ILS/src/sql/Pg/upgrade/0299.data.marc21expand880.sql diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index f32fa5ab5e..4596b9fbfc 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -65,7 +65,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0298'); -- Scott McKellar +INSERT INTO config.upgrade_log (version) VALUES ('0299'); -- Galen Charlton CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 242595de07..6ffbcfd4a7 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -24,6 +24,7 @@ INSERT INTO config.xml_transform VALUES ( 'mods', 'http://www.loc.gov/mods/', 'm INSERT INTO config.xml_transform VALUES ( 'mods3', 'http://www.loc.gov/mods/v3', 'mods3', ''); INSERT INTO config.xml_transform VALUES ( 'mods32', 'http://www.loc.gov/mods/v3', 'mods32', ''); INSERT INTO config.xml_transform VALUES ( 'mods33', 'http://www.loc.gov/mods/v3', 'mods33', ''); +INSERT INTO config.xml_transform VALUES ( 'marc21expand880', 'http://www.loc.gov/MARC21/slim', 'marc', '' ); INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, facet_field ) VALUES (1, 'series', 'seriestitle', oils_i18n_gettext(1, 'Series Title', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:relatedItem[@type="series"]/mods32:titleInfo$$, TRUE ); diff --git a/Open-ILS/src/sql/Pg/954.data.marc21expand880.sql b/Open-ILS/src/sql/Pg/954.data.marc21expand880.sql new file mode 100644 index 0000000000..762441bcff --- /dev/null +++ b/Open-ILS/src/sql/Pg/954.data.marc21expand880.sql @@ -0,0 +1,62 @@ +UPDATE config.xml_transform SET xslt = $$ + + + + + + + + + + + + + + + + + + + + + + + + + + + +$$ +where name = 'marc21expand880'; diff --git a/Open-ILS/src/sql/Pg/upgrade/0299.data.marc21expand880.sql b/Open-ILS/src/sql/Pg/upgrade/0299.data.marc21expand880.sql new file mode 100644 index 0000000000..cbf992660e --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0299.data.marc21expand880.sql @@ -0,0 +1,68 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0299'); -- Galen Charlton + +insert INTO CONFIG.xml_transform(name, namespace_uri, prefix, xslt) +VALUES ('marc21expand880', 'http://www.loc.gov/MARC21/slim', 'marc', $$ + + + + + + + + + + + + + + + + + + + + + + + + + + + +$$); + +COMMIT; -- 2.43.2