Cut over to RDFa Lite instead of microdata for schema.org
authorDan Scott <dscott@laurentian.ca>
Tue, 16 Jul 2013 19:33:49 +0000 (15:33 -0400)
committerDan Scott <dscott@laurentian.ca>
Mon, 19 Aug 2013 14:37:10 +0000 (10:37 -0400)
RDFa Lite is more easily extensible and as accepted as microdata.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
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
Open-ILS/src/templates/opac/parts/record/summary.tt2

index d334acc..360368e 100644 (file)
@@ -4,8 +4,7 @@
     stop_parms = ['expand','cnoffset','copy_offset','copy_limit'];
     ctx.record_attrs = attrs; # capture for JS
 %]
-<div id='canvas_main' class='canvas' itemscope itemtype='[% args.schema.itemtype %]'>
-    <link itemprop="additionalType" href="http://schema.org/Product" />
+<div id='canvas_main' class='canvas' vocab="http://schema.org" typeof='[% args.schema.itemtype %] Product'>
     [%- INCLUDE "opac/parts/record/navigation.tt2" %]
     [%- IF ctx.bib_is_dead %]
     <div id='rdetail_deleted_exp'>
index fb78392..c5e89fb 100644 (file)
@@ -17,9 +17,9 @@
             ou_name = cp_org_unit.name;
             displayed_ous.$ou_name = 1;
     %]
-    <li itemprop="offers" itemscope itemtype="http://schema.org/AggregateOffer">
-        <meta itemprop="offerCount" content="[% ou_avail %]">
-        <meta itemprop="seller/library" content="[% ou_name | html %]">
+    <li property="offers" typeof="AggregateOffer">
+        <meta property="offerCount" content="[% ou_avail %]">
+        <meta property="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 %]
@@ -37,9 +37,9 @@
         UNLESS depth < 0 || displayed_ous.exists(ou_name);
     %]
     [%- IF attrs.plib_copy_counts.$depth.count > 0; %]
-    <li class="preferred" itemprop="offers" itemscope itemtype="http://schema.org/AggregateOffer">
-        <meta itemprop="offerCount" content="[% ou_avail %]">
-        <meta itemprop="seller" content="[% ou_name | html %]">
+    <li class="preferred" property="offers" typeof="AggregateOffer">
+        <meta property="offerCount" content="[% ou_avail %]">
+        <meta property="seller" content="[% ou_name | html %]">
     [%-
         l('[_1] of [quant,_2,copy,copies] available at [_3].',
             attrs.plib_copy_counts.$depth.available,
index c339e65..491a5b3 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 itemprop="isRelatedTo" itemscope itemtype="http://schema.org/Product">
+        <ul><li property="isRelatedTo" typeof="Product">
             <span class="bib_peer_type">[% bib.peer_type.name | 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> / 
+            <a property="url" href="[% mkurl(ctx.opac_root _ '/record/' _ bib.target_copy.call_number.record) %]">
+                <span class="bib_peer_title" property="name">[% peer.title | html %]</span> / 
                 <span class="bib_peer_author">[% peer.author | html %]</span>
             </a>
         </li></ul>
@@ -89,11 +89,11 @@ END; # FOREACH bib
                 callnum = callnum  _ " " _ callnum_suffix;
             END;
         -%]
-        <tr itemprop="offers" itemscope itemtype="http://schema.org/Offer">
+        <tr property="offers" typeof="Offer">
             [%- 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/library">
+            [%- ELSE %]<td header='copy_header_library' property="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/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>
+            <td header='copy_header_callnumber'><span property="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/barcode">
+            <td header='copy_header_barcode' property="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/isbn13" content="' _ attrs.gtin13 _ '" />';
+                    '<meta property="gtin13/isbn13" content="' _ attrs.gtin13 _ '" />';
                 END; -%]
             </td>
-            <td header='copy_header_shelfloc' itemprop="availableAtOrFrom/shelvingLocation">[% copy_info.copy_location | html %]</td>
+            <td header='copy_header_shelfloc' property="availableAtOrFrom/shelvingLocation">[% copy_info.copy_location | html %]</td>
             [%- IF ctx.is_staff %]
             <td header='copy_header_age_hold'>
                 [% copy_info.age_protect ?
@@ -178,13 +178,13 @@ END; # FOREACH bib
             <td header='copy_header_status'>[%-
                 # Hard-coded to match defaults in config.copy_status
                 IF (copy_info.status_code == 0 OR copy_info.status_code == 7);
-                    '<link itemprop="availability" href="http://schema.org/InStock" />';
+                    '<link property="availability" href="http://schema.org/InStock" />';
                 ELSIF copy_info.status_code == 1;
-                    '<link itemprop="availability" href="http://schema.org/OutOfStock" />';
+                    '<link property="availability" href="http://schema.org/OutOfStock" />';
                 ELSIF copy_info.status_code == 9;
-                    '<link itemprop="availability" href="http://schema.org/PreOrder" />';
+                    '<link property="availability" href="http://schema.org/PreOrder" />';
                 ELSIF copy_info.status_code == 12;
-                    '<link itemprop="availability" href="http://schema.org/InStoreOnly" />';
+                    '<link property="availability" href="http://schema.org/InStoreOnly" />';
                 END;
                 copy_info.copy_status | html;
             -%]</td>
@@ -212,9 +212,9 @@ END; # FOREACH bib
         attrs = {marc_xml => bib};
         PROCESS get_marc_attrs args=attrs %]
 [%- IF attrs.bibid != ctx.bre_id; %]
-    <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>
+    <li property="isRelatedTo/boundWith" typeof="Product">
+        <a property="url" href="[% mkurl(ctx.opac_root _ '/record/' _ attrs.bibid) %]">
+            <span class="bib_peer_title" property="name">[% attrs.title | html %]</span>
             / <span class="bib_peer_author">[% attrs.author | html %]</span>
         </a>
     </li>
index db3f4ca..4be6b33 100644 (file)
@@ -61,7 +61,7 @@
             <img alt="[% attrs.format_label %]" title="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
         </div>
         [%- END %]
-        <h1 id='rdetail_title' itemprop="name">[% attrs.title_extended | html %]</h1>
+        <h1 id='rdetail_title' property="name">[% attrs.title_extended | html %]</h1>
         [%-
             FOR link880 IN attrs.graphic_titles;
                 FOR alt IN link880.graphic;
@@ -109,13 +109,13 @@ IF num_uris > 0;
     [%- IF num_uris > 1 %]<ul>[% END %]
     [%- FOR uri IN merged_uris %]
         [%- IF num_uris == 1 -%]
-            <p class="rdetail_uri" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
+            <p class="rdetail_uri" property="offers" vocab="http://schema.org" typeof="Offer">
         [%- ELSE -%]
-            <li class="rdetail_uri" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
+            <li class="rdetail_uri" property="offers" vocab="http://schema.org" typeof="Offer">
         [%- END -%]
         <a href="[% uri.href %]">[% uri.link %]</a>[% ' - ' _ uri.note IF uri.note %]
-        <link itemprop="availability" href="http://schema.org/OnlineOnly" />
-        [%- IF attrs.gtin13; '<meta itemprop="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]
+        <link property="availability" href="http://schema.org/OnlineOnly" />
+        [%- IF attrs.gtin13; '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />'; END; %]
         [%- IF num_uris == 1 %]</p>[% ELSE %]</li>[% END %]
     [%- END %]
     [%- IF num_uris > 1 %]</ul>[% END %]
@@ -154,7 +154,7 @@ IF num_uris > 0;
     [%- IF attrs.isbns.0; FOR isbn IN attrs.isbns %]
     <li class='rdetail_isbns'>
         <strong class='rdetail_label'>[% l('ISBN:'); %]</strong>
-        <span class='rdetail_value' itemprop='isbn'>[% isbn | html  %]</span>
+        <span class='rdetail_value' property='isbn'>[% isbn | html  %]</span>
     </li>
         [%- END %]
     [%- END %]
@@ -195,14 +195,14 @@ IF num_uris > 0;
     [%- IF attrs.publisher %]
     <li id='rdetail_publisher'>
         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
-        <span class='rdetail_value' itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
+        <span class='rdetail_value' property="publisher" typeof="Organization">
         [%- IF attrs.pubplace; %]
-            <span itemprop="location">[% attrs.pubplace | html; %]</span>
+            <span property="location">[% attrs.pubplace | html; %]</span>
         [%- END; %]
-            <span itemprop="name">[% attrs.publisher | html; %]</span>
+            <span property="name">[% attrs.publisher | html; %]</span>
         </span>
         [%- IF attrs.pubdate; %]
-            <span itemprop="datePublished">[% attrs.pubdate | html; %]</span>
+            <span property="datePublished">[% attrs.pubdate | html; %]</span>
         [%- END; %]
         [%-
         IF attrs.graphic_pubinfos.size > 0;