LP#1304462: Add schema.org copyrightYear, manufacturer for RDA 264 fields
authorDan Scott <dscott@laurentian.ca>
Fri, 1 Aug 2014 04:46:45 +0000 (00:46 -0400)
committerBen Shum <bshum@biblio.org>
Fri, 8 Aug 2014 00:08:51 +0000 (20:08 -0400)
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 <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>

Open-ILS/src/templates/opac/parts/misc_util.tt2
Open-ILS/src/templates/opac/parts/record/summary.tt2

index 33d1c3f..9fc373e 100644 (file)
         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"]');
index bdb1763..44746c4 100644 (file)
@@ -264,11 +264,11 @@ IF num_uris > 0;
     [%- IF attrs.manufacturer %]
         <li id='rdetail_manufacturer'>
             <strong class='rdetail_label'>[% l("Manufacturer:") %]</strong>
-            <span class='rdetail_value'>
+            <span class='rdetail_value' property="manufacturer" typeof="Organization">
             [%- IF attrs.manplace; %]
-                <span>[% attrs.manplace | html; %]</span>
+                <span property="location">[% attrs.manplace | html; %]</span>
             [%- END; %]
-                <span>[% attrs.manufacturer | html; %]</span>
+                <span property="name">[% attrs.manufacturer | html; %]</span>
             [%- IF attrs.mandate; %]
                 <span>[% attrs.mandate | html; %]</span>
             [%- END; %]
@@ -278,7 +278,12 @@ IF num_uris > 0;
     [%- IF attrs.copyright %]
     <li id='rdetail_copyright'>
         <strong class='rdetail_label'>[% l("Copyright:") %]</strong>
-        <span class='rdetail_value'>[% attrs.copyright | html_entity; %]</span>
+        <span class='rdetail_value'>[% attrs.copyright | html_entity; %]
+        [%-# Provide the 4-digit year, cleansed of '@' and other junk %]
+        [%- IF attrs.copyrightYear -%]
+            <meta property='copyrightYear' content='[% attrs.copyrightYear | html; %]'>
+        [%- END -%]
+        </span>
     </li>
     [%- END %]
 </ul>