zotero/translators — pull request #745 by agraboso (2014-06-04 16:51:43+00:00)
Title: Add import and export of MR numbers

The MR (=Mathematical Reviews) number is the unique identifier for records in the MathSciNet database. It consists of seven digits (leading zeroes may be omitted). For backwards compatibility with the paper publication Mathematical Reviews, additional identifiers may be added to the MR number between parentheses. For a more detailed discussion, see [this link](http://www.ams.org/mathscinet/help/field_help.html#mrnumber).

The MathSciNet translator pulls BibTeX records, that are then fed to the BibTeX translator. These BibTeX entries contain a field named "MRNUMBER" that contains the seven-digit ID code plus the additional identifiers mentioned above. The first thing this pull request contains is code (lines 1819-1829) for import of the information in an "MRNUMBER" field of a BibTeX entry into the "Extra" field of a Zotero record ---as suggested by adamsmith in [this forum post] (https://forums.zotero.org/discussion/37213/mrnumber-and-mrclass-in-mathscinet-translator/) (which contains an example too). Only the seven-digit code is kept, and is prefixed by the string "MR".

Exporting BibTeX records should also produce an "MRNUMBER" field ---if it is present in the "Extra" field. Lines 2563-2588 parse the "Extra" field of a Zotero record. If it finds the string "MR" followed by a number, it extracts that information and puts it in an "MRNUMBER" field. The rest of the "Extra" field is output to the "note" field, as it was done before.

I've tested both the import and export parts of the code with several MathSciNet records, and everything seems to work as expected. I have also added a test case in the code (lines 3093-3126) containing an "MRNUMBER" field (the one from the forum post linked above). It is in this part that I'm finding a difficulty: Scaffold does not quite like it and gives the output below.

```
12:39:40 TranslatorTester: Running 1 test for BibTeX
12:39:40
TranslatorTester: Running BibTeX Test 1
12:39:40 TranslatorTester: Translating
12:39:40 Scanning 398 characters for BibTeX
12:39:40 Replace -- in 199--213 with –
12:39:40 Translation successful
12:39:40 TranslatorTester: Data mismatch detected:
12:39:40 {
"itemType": "journalArticle"
"creators": [
{
"firstName": "Nicholas M."
"lastName": "Katz"
"creatorType": "author"
}
{
"firstName": "Tadao"
"lastName": "Oda"
"creatorType": "author"
}
]
"notes": []
"tags": []
"seeAlso": []
"attachments": []
"itemID": "MR0237510"
"journalAbbreviation": "J. Math. Kyoto Univ."
"extra": "MR0237510"
"publicationTitle": "Journal of Mathematics of Kyoto University"
- "pages": "199-213"
+ "pages": "199–213"
"title": "On the differentiation of de Rham cohomology classes with respect to parameters"
"volume": "8"
"date": "1968"
+ "ISSN": "0023-608X"
}
12:39:40 TranslatorTester: BibTeX Test 1: unknown (Item 0 does not match)
```