Extend schema.org attributes for bibliographic focus
authorDan Scott <dscott@laurentian.ca>
Mon, 15 Jul 2013 20:13:14 +0000 (16:13 -0400)
committerDan Scott <dscott@laurentian.ca>
Mon, 19 Aug 2013 14:37:10 +0000 (10:37 -0400)
For example, instead of Offer.seller and Offer.sku, use
Offer.seller/library and Offer.sku/callNumber, per the schema.org
extension mechanism documented at http://schema.org/docs/extension.html

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates/opac/parts/record/copy_counts.tt2
Open-ILS/src/templates/opac/parts/record/copy_table.tt2

index e2a865a..fb78392 100644 (file)
@@ -19,7 +19,7 @@
     %]
     <li itemprop="offers" itemscope itemtype="http://schema.org/AggregateOffer">
         <meta itemprop="offerCount" content="[% ou_avail %]">
-        <meta itemprop="seller" content="[% ou_name | html %]">
+        <meta itemprop="seller/library" content="[% ou_name | html %]">
     [% l('[quant,_1,copy,copies] at [_2].', ou_avail, ou_name) | html %]
     [%- this_depth = ctx.get_aou(ou_id).ou_type.depth;
         IF ou_avail > 0 && this_depth != ctx.copy_depth %]
index 1b4c588..c339e65 100644 (file)
@@ -57,10 +57,10 @@ END;
     <tr><td header='copy_header_shelfloc'>
     [%- bib_lib_name = ctx.get_aou(bib.target_copy.circ_lib).name | html;
         l("[_1] (foreign item)", bib_lib_name); -%]
-        <ul><li>
+        <ul><li itemprop="isRelatedTo" itemscope itemtype="http://schema.org/Product">
             <span class="bib_peer_type">[% bib.peer_type.name | html %]</span>:
-            <a href="[% mkurl(ctx.opac_root _ '/record/' _ bib.target_copy.call_number.record) %]">
-                <span class="bib_peer_title">[% peer.title | html %]</span> / 
+            <a itemprop="url" href="[% mkurl(ctx.opac_root _ '/record/' _ bib.target_copy.call_number.record) %]">
+                <span class="bib_peer_title" itemprop="name">[% peer.title | html %]</span> / 
                 <span class="bib_peer_author">[% peer.author | html %]</span>
             </a>
         </li></ul>
@@ -93,7 +93,7 @@ END; # FOREACH bib
             [%- IF serial_holdings %]<td header='copy_header_holding_label' class='rdetail-issue-issue'>
                 [%- copy_info.holding_label | html; -%]
             </td>
-            [%- ELSE %]<td header='copy_header_library' itemprop="seller">
+            [%- ELSE %]<td header='copy_header_library' itemprop="seller/library">
             [%-
                 org_name = ctx.get_aou(copy_info.circ_lib).name;
                 lib_url = ctx.get_org_setting(copy_info.circ_lib, 'lib.info_url');
@@ -102,20 +102,20 @@ END; # FOREACH bib
                 IF lib_url; '</a>'; END;
             -%]
             </td>[% END %]
-            <td header='copy_header_callnumber'><span itemprop="sku">[% callnum | html %]</span> [% IF ctx.get_org_setting(CGI.param('loc') OR ctx.aou_tree.id, 'sms.enable') == 1 %](<a href="[% mkurl(ctx.opac_root _ '/sms_cn', {copy_id => copy_info.id}) %]">Text</a>)[% END %]</td>
+            <td header='copy_header_callnumber'><span itemprop="sku/callNumber">[% callnum | html %]</span> [% IF ctx.get_org_setting(CGI.param('loc') OR ctx.aou_tree.id, 'sms.enable') == 1 %](<a href="[% mkurl(ctx.opac_root _ '/sms_cn', {copy_id => copy_info.id}) %]">Text</a>)[% END %]</td>
             [%- IF has_parts == 'true' %]
             <td header='copy_header_part'>[% copy_info.part_label | html %]</td>
             [%- END %]
-            <td header='copy_header_barcode' itemprop="serialNumber">
+            <td header='copy_header_barcode' itemprop="serialNumber/barcode">
                 [%- IF ctx.is_staff -%]
                     <a href="javascript:void(0)" onclick="xulG.new_tab(xulG.urls.XUL_COPY_STATUS, {}, {'from_item_details_new': true, 'barcodes': ['[%- copy_info.barcode | html | replace('\'', '\\\'') -%]']})">[% copy_info.barcode | html %]</a>
                 [%- ELSE -%][% copy_info.barcode | html %]
                 [%- END -%]
                 [%- IF attrs.gtin13;
-                    '<meta itemprop="gtin13" content="' _ attrs.gtin13 _ '" />';
+                    '<meta itemprop="gtin13/isbn13" content="' _ attrs.gtin13 _ '" />';
                 END; -%]
             </td>
-            <td header='copy_header_shelfloc' itemprop="availableAtOrFrom">[% copy_info.copy_location | html %]</td>
+            <td header='copy_header_shelfloc' itemprop="availableAtOrFrom/shelvingLocation">[% copy_info.copy_location | html %]</td>
             [%- IF ctx.is_staff %]
             <td header='copy_header_age_hold'>
                 [% copy_info.age_protect ?
@@ -212,7 +212,12 @@ END; # FOREACH bib
         attrs = {marc_xml => bib};
         PROCESS get_marc_attrs args=attrs %]
 [%- IF attrs.bibid != ctx.bre_id; %]
-    <li><a href="[% mkurl(ctx.opac_root _ '/record/' _ attrs.bibid) %]">[% attrs.title | html %] / [% attrs.author | html %]</a></li>
+    <li itemprop="isRelatedTo/boundWith" itemscope itemtype="http://schema.org/Product">
+        <a itemprop="url" href="[% mkurl(ctx.opac_root _ '/record/' _ attrs.bibid) %]">
+            <span class="bib_peer_title" itemprop="name">[% attrs.title | html %]</span>
+            / <span class="bib_peer_author">[% attrs.author | html %]</span>
+        </a>
+    </li>
 [%- END; # IF attrs.bibid %]
 [%- END; # FOREACH bib in copy_info.peer_bib_marc
 '</ul>';