From 4f3be55f788d045d44586580a49991f904746363 Mon Sep 17 00:00:00 2001 From: Steven Thompson Date: Tue, 14 Aug 2018 09:41:04 +0100 Subject: [PATCH 1/2] Updated tags and reference types based on https://en.wikipedia.org/wiki/RIS_(file_format). --- src/LibRIS/RISTags.php | 276 +++++++++++++++++++++++++++-------------- 1 file changed, 183 insertions(+), 93 deletions(-) diff --git a/src/LibRIS/RISTags.php b/src/LibRIS/RISTags.php index 39a7e37..76bbe66 100644 --- a/src/LibRIS/RISTags.php +++ b/src/LibRIS/RISTags.php @@ -3,23 +3,23 @@ namespace LibRIS; class RISTags { - + public static function getTags() { return array_keys(self::$tagMap); } - + public static function getTypes() { return array_keys(self::$typeMap); } - + public static function describeTag($tag) { return self::$tagMap[$tag]; } - + public static function describeType($type) { return self::$typeMap[$type]; } - + /** * The definitive list of all fields. * @var array @@ -27,103 +27,171 @@ public static function describeType($type) { * @see http://www.refman.com/support/risformat_intro.asp */ public static $tagMap = array( - 'TY' => 'Type', - 'ID' => 'Reference ID', - 'T1' => 'Title', - 'TI' => 'Book title', - 'CT' => 'Title of unpublished reference', - 'A1' => 'Primary author', + 'TY' => 'Type of reference', + 'A1' => 'First author', 'A2' => 'Secondary author', + 'A3' => 'Tertiary author', + 'A4' => 'Subsidiary author', + 'AB' => 'Abstract', + 'AD' => 'Author address', + 'AN' => 'Accession number', 'AU' => 'Author', - 'Y1' => 'Primary date', - 'PY' => 'Publication year', - 'N1' => 'Notes', - 'KW' => 'Keywords', - 'RP' => 'Reprint status', - 'SP' => 'Start page', - 'EP' => 'Ending page', - 'JF' => 'Periodical full name', - 'JO' => 'Periodical standard abbreviation', - 'JA' => 'Periodical in which article was published', + 'AV' => 'Location in archives', + 'BT' => 'T2', + 'C1' => 'Custom 1', + 'C2' => 'Custom 2', + 'C3' => 'Custom 3', + 'C4' => 'Custom 4', + 'C5' => 'Custom 5', + 'C6' => 'Custom 6', + 'C7' => 'Custom 7', + 'C8' => 'Custom 8', + 'CA' => 'Caption', + 'CN' => 'Call number', + 'CP' => '', + 'CT' => 'Title of unpublished reference', + 'CY' => 'Place published', + 'DA' => 'Date', + 'DB' => 'Name of database', + 'DO' => 'DOI', + 'DP' => 'Database provider', + 'ED' => 'Editor', + 'EP' => 'End page', + 'ET' => 'Edition', + 'ID' => 'Reference ID', + 'IS' => 'Issue number', 'J1' => 'Periodical name - User abbreviation 1', - 'J2' => 'Periodical name - User abbreviation 2', - 'VL' => 'Volume', - 'IS' => 'Issue', - 'T2' => 'Title secondary', - 'CY' => 'City of Publication', - 'PB' => 'Publisher', - 'U1' => 'User 1', - 'U2' => 'User 2', - 'U3' => 'User 3', - 'U4' => 'User 4', - 'U5' => 'User 5', - 'T3' => 'Title series', - 'N2' => 'Abstract', - 'SN' => 'ISSN/ISBN/ASIN', - 'AV' => 'Availability', - 'M1' => 'Misc. 1', - 'M2' => 'Misc. 2', - 'M3' => 'Misc. 3', - 'AD' => 'Address', - 'UR' => 'URL', + 'J2' => 'Alternate title', + 'JA' => 'Periodical name: standard abbreviation', + 'JF' => 'Journal/Periodical name', + 'JO' => 'Journal/Periodical name', + 'KW' => 'Keywords', 'L1' => 'Link to PDF', - 'L2' => 'Link to Full-text', + 'L2' => 'Link to full-text', 'L3' => 'Related records', - 'L4' => 'Images', - 'ER' => 'End of Reference', - - // Unsure about the origin of these - 'Y2' => 'Primary date 2', - 'BT' => 'Institution [?]', - ); - + 'L4' => 'Image(s)', + 'LA' => 'Language', + 'LB' => 'Label', + 'LK' => 'Website link', + 'M1' => 'Number', + 'M2' => 'Miscellaneous 2', + 'M3' => 'Type of work', + 'N1' => 'Notes', + 'N2' => 'Abstract', + 'NV' => 'Number of volumes', + 'OP' => 'Original publication', + 'PB' => 'Publisher', + 'PP' => 'Publishing place', + 'PY' => 'Publication year', + 'RI' => 'Reviewed item', + 'RN' => 'Research notes', + 'RP' => 'Reprint edition', + 'SE' => 'Section', + 'SN' => 'ISBN/ISSN', + 'SP' => 'Start page', + 'ST' => 'Short title', + 'T1' => 'Primary title', + 'T2' => 'Secondary title', + 'T3' => 'Tertiary title', + 'TA' => 'Translated author', + 'TI' => 'Title', + 'TT' => 'Translated title', + 'U1' => 'User definable 1', + 'U2' => 'User definable 2', + 'U3' => 'User definable 3', + 'U4' => 'User definable 4', + 'U5' => 'User definable 5', + 'UR' => 'URL', + 'VL' => 'Volume number', + 'VO' => 'Published standard number', + 'Y1' => 'Primary date', + 'Y2' => 'Access date', + 'ER' => 'End of reference', + ); + public static $tagDescriptions = array( 'TY' => 'Type of reference (must be the first tag)', - 'ID' => 'Reference ID (not imported to reference software)', - 'T1' => 'Primary title', - 'TI' => 'Book title', + 'A1' => 'First author', + 'A2' => 'Secondary author (each author on its own line preceded by the tag)', + 'A3' => 'Tertiary author (each author on its own line preceded by the tag)', + 'A4' => 'Subsidiary author (each author on its own line preceded by the tag)', + 'AB' => 'Abstract', + 'AD' => 'Author address', + 'AN' => 'Accession number', + 'AU' => 'Author (each author on its own line preceded by the tag)', + 'AV' => 'Location in archives', + 'BT' => 'This field maps to T2 for all reference types except for Whole Book and Unpublished Work references. It can contain alphanumeric characters. There is no practical limit to the length of this field.', + 'C1' => 'Custom 1', + 'C2' => 'Custom 2', + 'C3' => 'Custom 3', + 'C4' => 'Custom 4', + 'C5' => 'Custom 5', + 'C6' => 'Custom 6', + 'C7' => 'Custom 7', + 'C8' => 'Custom 8', + 'CA' => 'Caption', + 'CN' => 'Call number', + 'CP' => 'This field can contain alphanumeric characters. There is no practical limit to the length of this field.', 'CT' => 'Title of unpublished reference', - 'A1' => 'Primary author', - 'A2' => 'Secondary author (each name on separate line)', - 'AU' => 'Author (syntax. Last name, First name, Suffix)', - 'Y1' => 'Primary date', - 'PY' => 'Publication year (YYYY/MM/DD)', - 'N1' => 'Notes ', - 'KW' => 'Keywords (each keyword must be on separate line preceded KW -)', - 'RP' => 'Reprint status (IN FILE, NOT IN FILE, ON REQUEST (MM/DD/YY))', - 'SP' => 'Start page number', - 'EP' => 'Ending page number', - 'JF' => 'Periodical full name', - 'JO' => 'Periodical standard abbreviation', - 'JA' => 'Periodical in which article was published', - 'J1' => 'Periodical name - User abbreviation 1', - 'J2' => 'Periodical name - User abbreviation 2', - 'VL' => 'Volume number', + 'CY' => 'Place published', + 'DA' => 'Date', + 'DB' => 'Name of database', + 'DO' => 'DOI', + 'DP' => 'Database provider', + 'ED' => 'Editor', + 'EP' => 'End page', + 'ET' => 'Edition', + 'ID' => 'Reference ID', 'IS' => 'Issue number', - 'T2' => 'Title secondary', - 'CY' => 'City of Publication', + 'J1' => 'Periodical name - User abbreviation 1. This is an alphanumeric field of up to 255 characters.', + 'J2' => 'Alternate title (this field is used for the abbreviated title of a book or journal name, the latter mapped to T2)', + 'JA' => 'Periodical name: standard abbreviation. This is the periodical in which the article was (or is to be, in the case of in-press references) published. This is an alphanumeric field of up to 255 characters.', + 'JF' => 'Journal/Periodical name: full format. This is an alphanumeric field of up to 255 characters.', + 'JO' => 'Journal/Periodical name: full format. This is an alphanumeric field of up to 255 characters.', + 'KW' => 'Keywords (keywords should be entered each on its own line preceded by the tag)', + 'L1' => 'Link to PDF. There is no practical limit to the length of this field. URL addresses can be entered individually, one per tag or multiple addresses can be entered on one line using a semi-colon as a separator.', + 'L2' => 'Link to full-text. There is no practical limit to the length of this field. URL addresses can be entered individually, one per tag or multiple addresses can be entered on one line using a semi-colon as a separator.', + 'L3' => 'Related records. There is no practical limit to the length of this field.', + 'L4' => 'Image(s). There is no practical limit to the length of this field.', + 'LA' => 'Language', + 'LB' => 'Label', + 'LK' => 'Website link', + 'M1' => 'Number', + 'M2' => 'Miscellaneous 2. This is an alphanumeric field and there is no practical limit to the length of this field.', + 'M3' => 'Type of work', + 'N1' => 'Notes', + 'N2' => 'Abstract. This is a free text field and can contain alphanumeric characters. There is no practical length limit to this field.', + 'NV' => 'Number of volumes', + 'OP' => 'Original publication', 'PB' => 'Publisher', - 'U1' => 'User definable 1', - 'U2' => 'User definable 2', - 'U3' => 'User definable 3', - 'U4' => 'User definable 4', - 'U5' => 'User definable 5', - 'T3' => 'Title series', - 'N2' => 'Abstract', - 'SN' => 'ISSN/ISBN (e.g. ISSN XXXX-XXXX)', - 'AV' => 'Availability', - 'M1' => 'Misc. 1', - 'M2' => 'Misc. 2', - 'M3' => 'Misc. 3', - 'AD' => 'Address', - 'UR' => 'Web/URL', - 'L1' => 'Link to PDF', - 'L2' => 'Link to Full-text', - 'L3' => 'Related records', - 'L4' => 'Images', - 'ER' => 'End of Reference (must be the last tag)', + 'PP' => 'Publishing place', + 'PY' => 'Publication year (YYYY/MM/DD)', + 'RI' => 'Reviewed item', + 'RN' => 'Research notes', + 'RP' => 'Reprint edition', + 'SE' => 'Section', + 'SN' => 'ISBN/ISSN', + 'SP' => 'Start page', + 'ST' => 'Short title', + 'T1' => 'Primary title', + 'T2' => 'Secondary title (journal title, if applicable)', + 'T3' => 'Tertiary title', + 'TA' => 'Translated author', + 'TI' => 'Title', + 'TT' => 'Translated title', + 'U1' => 'User definable 1. This is an alphanumeric field and there is no practical limit to the length of this field.', + 'U2' => 'User definable 2. This is an alphanumeric field and there is no practical limit to the length of this field.', + 'U3' => 'User definable 3. This is an alphanumeric field and there is no practical limit to the length of this field.', + 'U4' => 'User definable 4. This is an alphanumeric field and there is no practical limit to the length of this field.', + 'U5' => 'User definable 5. This is an alphanumeric field and there is no practical limit to the length of this field.', + 'UR' => 'URL', + 'VL' => 'Volume number', + 'VO' => 'Published standard number', + 'Y1' => 'Primary date', + 'Y2' => 'Access date', + 'ER' => 'End of reference (must be the last tag)', ); - + /** * Map of all types (tag TY) defined for RIS. * @var array @@ -133,24 +201,45 @@ public static function describeType($type) { public static $typeMap = array( 'ABST' => 'Abstract', 'ADVS' => 'Audiovisual material', - 'ART' => 'Art Work', + 'AGGR' => 'Aggregated database', + 'ANCIENT' => 'Ancient text', + 'ART' => 'Art work', + 'BILL' => 'Bill', + 'BLOG' => 'Blog', 'BOOK' => 'Whole book', 'CASE' => 'Case', 'CHAP' => 'Book chapter', + 'CHART' => 'Chart', + 'CLSWK' => 'Classical work', 'COMP' => 'Computer program', 'CONF' => 'Conference proceeding', + 'CPAPER' => 'Conference paper', 'CTLG' => 'Catalog', 'DATA' => 'Data file', - 'ELEC' => 'Electronic Citation', + 'DBASE' => 'Online database', + 'DICT' => 'Dictionary', + 'EBOOK' => 'Electronic book', + 'ECHAP' => 'Electronic book section', + 'EDBOOK' => 'Edited book', + 'ELEC' => 'Web page', + 'EJOUR' => 'Electronic article', + 'ENCYC' => 'Encyclopedia', + 'EQUA' => 'Equation', + 'FIGURE' => 'Figure', 'GEN' => 'Generic', + 'GOVDOC' => 'Government document', + 'GRANT' => 'Grant', 'HEAR' => 'Hearing', 'ICOMM' => 'Internet Communication', 'INPR' => 'In Press', 'JFULL' => 'Journal (full)', 'JOUR' => 'Journal', + 'LEGAL' => 'Legal rule or regulation', + 'MANSCPT' => 'Manuscript', 'MAP' => 'Map', 'MGZN' => 'Magazine article', 'MPCT' => 'Motion picture', + 'MULTI' => 'Online multimedia', 'MUSIC' => 'Music score', 'NEWS' => 'Newspaper', 'PAMP' => 'Pamphlet', @@ -160,6 +249,7 @@ public static function describeType($type) { 'SER' => 'Serial publication', 'SLIDE' => 'Slide', 'SOUND' => 'Sound recording', + 'STAND' => 'Standard', 'STAT' => 'Statute', 'THES' => 'Thesis/Dissertation', 'UNPB' => 'Unpublished work', From 5e832c39918c926f7e62ed89d84fa91c3db8b1e5 Mon Sep 17 00:00:00 2001 From: Steven Thompson Date: Thu, 16 Aug 2018 09:54:43 +0100 Subject: [PATCH 2/2] Changed the package name to enable this fork to be installed with composer via Git rather than Packagist. --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index f87fd0e..96e390a 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,10 @@ { - "name": "technosophos/LibRIS", - "description": "An RIS parser. RIS is a format for reference metadata.", + "name": "thompsonsj/LibRIS", + "description": "An RIS parser. RIS is a format for reference metadata. A fork of technosophos/LibRIS.", "type": "library", "keywords": ["RIS", "File parser", "Reference", "Bibliography"], "license": "MIT or GPLv2", - "homepage": "https://github.com/technosophos/LibRIS", + "homepage": "https://github.com/thompsonsj/LibRIS", "authors": [ { "name" : "M Butcher",