qterm = '';
iprop = '';
tlabel = '';
+ birthdate = '';
+ deathdate = '';
graphics = [];
+ tag = node.getAttribute('tag');
FOR subfield IN node.childNodes;
NEXT UNLESS subfield.nodeName == "subfield";
code = subfield.getAttribute('code');
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;
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"';
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 = '';