larsgw / citation.js

Citation.js converts formats like BibTeX, Wikidata JSON and ContentMine JSON to CSL-JSON to convert to other formats like APA, Vancouver and back to BibTeX.
https://citation.js.org/
MIT License
219 stars 30 forks source link

RIS Input - Missing "issue" for type magazine #215

Closed itsmhuang closed 2 years ago

itsmhuang commented 3 years ago

Hi, this is similar to my previously submitted issue of a missing mapping.

My RIS:

TY  - MGZN
TI  - New Health Center Targets County's Uninsured Patients
AU  - Brubaker, Bill
T2  - Washington Post
DA  - 2019/03//
PY  - 2019
VL  - 5
IS  - 2
SP  - 10
EP  - 12
UR  - washingtonpost.com

My code:

const Cite = require('citation-js');
const result = new Cite(risInput);
const resultFormatted = result.format('data', { format: 'object' });
console.log(resultFormatted);

The output:

[
    {
        author: [
            { family: 'Brubaker', given: 'Bill' },
        ],
        issued: { 'date-parts': [[2019, 3]] },
        page: '10-12',
        'container-title': 'Washington Post',
        title: "New Health Center Targets County's Uninsured Patients",
        type: 'article-magazine',
        URL: 'washingtonpost.com',
        volume: 5,
        graph: [...],
        id: 'temp_id_9073674349851302',
    },
]

I expect IS to be returned in the output as issue as 2, but it isn't. If the type is journal, which is similar to magazine, I see that issue is returned, so perhaps that mapping can be extended to magazine. TIA!

larsgw commented 3 years ago

In the "new" RIS specification, which your file follows for the most part, the issue of MGZN entries should actually be put in the M1 tag. That doesn't really make sense to me, but it's what the version of the specification I used to implement RIS support says.

larsgw commented 3 years ago

I forgot to add: perhaps another non-spec addition is warranted here. A lot of sites export RIS files that are not valid in either the new or the old specification, but in some cases it can be hard to fix that. Since MGZN does not have a different value associated with IS it might be good to add anyway.

itsmhuang commented 3 years ago

So I am exporting RIS files from Zotero (v. 5.0.96.1), which is a pretty popular app for handling citation data. Sucks that it might be exporting outdated formats though.

larsgw commented 3 years ago

I was afraid that was the case, I'll add it. Just to be clear, I don't think it makes sense for them to stick exactly to the specification either. Unless everyone fixes their implementation of a defunct specification that is only accessible through the Web Archive at once, I think all the RIS-producing and RIS-parsing programs are stuck with each other.