TPAC schema.org: Add Organization types for contributors
authorDan Scott <dscott@laurentian.ca>
Sun, 7 Apr 2013 22:14:58 +0000 (18:14 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 18 Apr 2013 19:18:14 +0000 (15:18 -0400)
Given a 110 / 710 field, when generating the record details for authors
and contributors we can declare an http://schema.org/Organization
itemtype rather than just jamming the name under the "contributor"
property. This is more in accordance with schema.org directions.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/opac/parts/record/authors.tt2

index 94a887b..7205e8f 100644 (file)
@@ -69,11 +69,17 @@ BLOCK build_author_links;
         IF type == 'author';
             IF args.schema.itemtype && args.schema.itemtype.match('MusicAlbum');
                 iprop = ' itemtype="http://schema.org/MusicGroup" itemscope itemprop="byArtist"';
-            ELSE;
+            ELSIF tag.substr(1,2) == '00';
                 iprop = ' itemtype="http://schema.org/Person" itemscope itemprop="author"';
+            ELSE;
+                iprop = ' itemtype="http://schema.org/Organization" itemscope itemprop="author"';
             END;
         ELSIF type == 'added';
-            iprop = ' itemprop="contributor"';
+            IF tag.substr(1,2) == '00';
+                iprop = ' itemtype="http://schema.org/Person" itemscope itemprop="contributor"';
+            ELSE;
+                iprop = ' itemtype="http://schema.org/Organization" itemscope itemprop="contributor"';
+            END;
         END;
         '<a href="' _ url _ '"' _ iprop _ '>';
         IF iprop; '<span itemprop="name">'; END;