Schema.org: relate offers to record explicitly
authorDan Scott <dscott@laurentian.ca>
Thu, 22 Aug 2013 22:30:34 +0000 (18:30 -0400)
committerBen Shum <bshum@biblio.org>
Mon, 26 Aug 2013 16:16:45 +0000 (12:16 -0400)
Although schema.org defines the nested child elements as implicit
relationships that should be good enough for the Offer-to-Product
relationship, defining that relationship explicitly can't hurt.

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

index b8ba910..bdb5f41 100644 (file)
@@ -4,7 +4,7 @@
     stop_parms = ['expand','cnoffset','copy_offset','copy_limit'];
     ctx.record_attrs = attrs; # capture for JS
 %]
-<div id='canvas_main' class='canvas' vocab="http://schema.org/" typeof='[% args.schema.itemtype %] Product'>
+<div id='canvas_main' class='canvas' vocab="http://schema.org/" typeof='[% args.schema.itemtype %] Product' resource="#schemarecord">
     [%- INCLUDE "opac/parts/record/navigation.tt2" %]
     [%- IF ctx.bib_is_dead %]
     <div id='rdetail_deleted_exp'>
index fd97eab..9f86bc7 100644 (file)
@@ -18,6 +18,7 @@
             displayed_ous.$ou_name = 1;
     %]
     <li property="offers" typeof="AggregateOffer">
+        <link property="itemOffered" href="#schemarecord">
         <meta property="offerCount" content="[% ou_avail %]">
         <meta property="seller" content="[% ou_name | html %]">
     [% l('[quant,_1,copy,copies] at [_2].', ou_avail, ou_name) | html %]
@@ -38,6 +39,7 @@
     %]
     [%- IF attrs.plib_copy_counts.$depth.count > 0; %]
     <li class="preferred" property="offers" typeof="AggregateOffer">
+        <link property="itemOffered" href="#schemarecord">
         <meta property="offerCount" content="[% ou_avail %]">
         <meta property="seller" content="[% ou_name | html %]">
     [%-
index b275c9f..41268f3 100644 (file)
@@ -102,6 +102,7 @@ END; # FOREACH bib
                 IF lib_url; '</a>'; END;
             -%]
                 <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
+                <link property="itemOffered" href="#schemarecord">
             </td>[% END %]
             <td header='copy_header_callnumber'><span property="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>
             [%- IF has_parts == 'true' %]