[open-ils-commits] [GIT] Evergreen ILS branch master updated. d87a117dab9abe66fe1106a3ccdd7199af0c916a

Evergreen Git git at git.evergreen-ils.org
Thu Apr 18 15:19:21 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  d87a117dab9abe66fe1106a3ccdd7199af0c916a (commit)
       via  647c014f8c2f2e3e2a9cfc95ddcd6b1fb65319df (commit)
       via  c670e8426c2a0e48d57be32194c0fa799f4f3320 (commit)
      from  b83e736ab52d4c35cf770e9143661898831d509c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d87a117dab9abe66fe1106a3ccdd7199af0c916a
Author: Dan Scott <dscott at laurentian.ca>
Date:   Sun Apr 7 18:14:58 2013 -0400

    TPAC schema.org: Add Organization types for contributors
    
    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 at laurentian.ca>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/opac/parts/record/authors.tt2 b/Open-ILS/src/templates/opac/parts/record/authors.tt2
index 94a887b..7205e8f 100644
--- a/Open-ILS/src/templates/opac/parts/record/authors.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/authors.tt2
@@ -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;

commit 647c014f8c2f2e3e2a9cfc95ddcd6b1fb65319df
Author: Dan Scott <dscott at laurentian.ca>
Date:   Fri Apr 5 16:10:01 2013 -0400

    TPAC: Fix schema.org name / dates for authors
    
    Per http://schema.org/Person, the birth date and death date are not
    supposed to be part of the name of a Person. We can separate these out
    correctly based on subfield d for 100 fields.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/opac/parts/record/authors.tt2 b/Open-ILS/src/templates/opac/parts/record/authors.tt2
index 43a3060..94a887b 100644
--- a/Open-ILS/src/templates/opac/parts/record/authors.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/authors.tt2
@@ -28,7 +28,10 @@ BLOCK build_author_links;
         qterm = '';
         iprop = '';
         tlabel = '';
+        birthdate = '';
+        deathdate = '';
         graphics = [];
+        tag = node.getAttribute('tag');
         FOR subfield IN node.childNodes;
             NEXT UNLESS subfield.nodeName == "subfield";
             code = subfield.getAttribute('code');
@@ -37,17 +40,27 @@ BLOCK build_author_links;
                 tlabel = relators.$relcode || label;
             END;
             IF code == '6';
+               target_field = tag;
                linked_fields = [subfield.textContent()];
-               target_field = node.getAttribute('tag');
                get_linked_880s;
             END;
             NEXT UNLESS code.match('[a-z]');
             sf = subfield.textContent | html;
-            term = term _ ' ' _ sf;
             IF code.match('[acdq]');
                 sf_raw = subfield.textContent.replace('[#"^$\+\-,\.:;&|\[\]()]', ' ');
                 qterm = qterm _ ' ' _ sf_raw;
             END;
+            # Only Persons have birth/death dates in schema.org
+            IF code.match('d') && tag.substr(1,2) == '00';
+                IF subfield.textContent.match('^\s*\d{4}');
+                    birthdate = subfield.textContent.replace('^\s*(\d{4}).*$', '$1');
+                END;
+                IF subfield.textContent.match('-\d{4}\s*$');
+                    deathdate = subfield.textContent.replace('^\s*.{4}\-(\d{4})\s*$', '$1');
+                END;
+            ELSE;
+                term = term _ ' ' _ sf;
+            END;
         END;
         url = mkurl(ctx.opac_root _ '/results', {query => qterm, qtype => 'author'}, ['page', 'expand']);
         author_type = (tlabel || label) | html;
@@ -57,7 +70,7 @@ BLOCK build_author_links;
             IF args.schema.itemtype && args.schema.itemtype.match('MusicAlbum');
                 iprop = ' itemtype="http://schema.org/MusicGroup" itemscope itemprop="byArtist"';
             ELSE;
-                iprop = ' itemprop="accountablePerson"';
+                iprop = ' itemtype="http://schema.org/Person" itemscope itemprop="author"';
             END;
         ELSIF type == 'added';
             iprop = ' itemprop="contributor"';
@@ -66,6 +79,12 @@ BLOCK build_author_links;
         IF iprop; '<span itemprop="name">'; END;
         term.replace('^\s+', '');
         IF iprop; '</span>'; END;
+        IF birthdate;
+            ' <span itemprop="birthDate">' _ birthdate _ '</span>-';
+        END;
+        IF deathdate;
+            '<span itemprop="deathDate">' _ deathdate _ '</span>';
+        END;
         '</a>';
         FOREACH link880 IN graphics;
             diratt = '';

commit c670e8426c2a0e48d57be32194c0fa799f4f3320
Author: Dan Scott <dscott at laurentian.ca>
Date:   Fri Apr 5 13:21:47 2013 -0400

    Fix schema.org mapping for MusicAlbum, add Map
    
    We had set LDR[06] = j to MusicRecording, but that is really meant for
    individual songs. Use MusicAlbum instead, and per
    http://schema.org/MusicAlbum, use a new MusicGroup itemtype with a
    'byArtist' property for the primary artist rather than the generic
    'accountablePerson'.
    
    Also map LDR[06] = e to Map, because that seems like a safe bet.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index bddab42..fa3ed90 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -88,7 +88,8 @@
         args.schema.itemtype = {};
         schema_typemap = {};
         schema_typemap.a = 'http://schema.org/Book';
-        schema_typemap.j = 'http://schema.org/MusicRecording';
+        schema_typemap.e = 'http://schema.org/Map';
+        schema_typemap.j = 'http://schema.org/MusicAlbum';
 
         args.isbns = [];
         FOR isbn IN xml.findnodes('//*[@tag="020"]/*[@code="a"]');
diff --git a/Open-ILS/src/templates/opac/parts/record/authors.tt2 b/Open-ILS/src/templates/opac/parts/record/authors.tt2
index b52aea3..43a3060 100644
--- a/Open-ILS/src/templates/opac/parts/record/authors.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/authors.tt2
@@ -54,11 +54,19 @@ BLOCK build_author_links;
         
         # schema.org changes
         IF type == 'author';
-            iprop = ' itemprop="accountablePerson"';
+            IF args.schema.itemtype && args.schema.itemtype.match('MusicAlbum');
+                iprop = ' itemtype="http://schema.org/MusicGroup" itemscope itemprop="byArtist"';
+            ELSE;
+                iprop = ' itemprop="accountablePerson"';
+            END;
         ELSIF type == 'added';
             iprop = ' itemprop="contributor"';
         END;
-        '<a href="' _ url _ '"' _ iprop _ '>' _ term.replace('^\s+', '') _ '</a>';
+        '<a href="' _ url _ '"' _ iprop _ '>';
+        IF iprop; '<span itemprop="name">'; END;
+        term.replace('^\s+', '');
+        IF iprop; '</span>'; END;
+        '</a>';
         FOREACH link880 IN graphics;
             diratt = '';
             IF link880.dir;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/opac/parts/misc_util.tt2    |    3 +-
 .../src/templates/opac/parts/record/authors.tt2    |   43 +++++++++++++++++--
 2 files changed, 40 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list