From fc4619d7c2c05f1e80eabf1a7866024e7baf0af2 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Fri, 1 Aug 2014 00:46:45 -0400 Subject: [PATCH] LP#1304462: Add schema.org copyrightYear, manufacturer for RDA 264 fields It looks like the best we can do is to define a "manufacturer" property (and corresponding Organization entity) when 264 ind2="3"; and we can provide a copyrightYear when we have 264 ind2="4". Even then, MARC / RDA cataloging practices end up giving us copyright notices like '@2012' instead of actual dates, so we have to regex the year out of the notice to satisfy the Integer range for copyrightYear. Theoretically we'll be in trouble if the copyright notice includes some other 4-digit number (for example, a multipart work catalogued in a single record that has a date range), but what are you gonna do? It's MARC / RDA. Same for manufacturer name, which seems likely (if the LoC examples that Yamil provided are any guide) to include statements like "Manufactured by Foobar" instead of cleanly structured data. The RDA fields were added to MARC21 in 2011, you would have thought that the benefits of providing clean data would have been obvious by then. Grumble grumble grumble. Yes, this is meant to be a transcription field, and theoretically one could use a 7xx to record the publisher/distributor/manufacturer/producer in a more cleanly stated factual way that would lend itself to actual linked data (hey, maybe even providing a link to an external resource that could act as an identifier), but NOBODY DOES THAT. So we do the best we can and soldier on. Signed-off-by: Dan Scott Signed-off-by: Ben Shum --- Open-ILS/src/templates/opac/parts/misc_util.tt2 | 7 +++++++ .../src/templates/opac/parts/record/summary.tt2 | 13 +++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index 33d1c3f294..9fc373efdf 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -211,6 +211,13 @@ END; args.copyright = (args.copyrights.size) ? args.copyrights.0 : ''; + IF args.copyright.length >= 4; + args.copyrightYear = args.copyright.match('(\d{4})'); + IF args.copyrightYear; + args.copyrightYear = args.copyrightYear.0; + END; + END; + # Get the RDA Production info. args.producers = []; FOR sub IN xml.findnodes('//*[@tag="264" and @ind2="0"]/*[@code="b"]'); diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2 index bdb1763914..44746c4054 100644 --- a/Open-ILS/src/templates/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2 @@ -264,11 +264,11 @@ IF num_uris > 0; [%- IF attrs.manufacturer %]
  • [% l("Manufacturer:") %] - + [%- IF attrs.manplace; %] - [% attrs.manplace | html; %] + [% attrs.manplace | html; %] [%- END; %] - [% attrs.manufacturer | html; %] + [% attrs.manufacturer | html; %] [%- IF attrs.mandate; %] [% attrs.mandate | html; %] [%- END; %] @@ -278,7 +278,12 @@ IF num_uris > 0; [%- IF attrs.copyright %]
  • [%- END %] -- 2.43.2