ucd-library / vessel

Vivo schema + fusEki + elaStic Search; rEsearch profiLes
MIT License
0 stars 0 forks source link

citeproc RIS translation (dates for CONF) #76

Open qjhart opened 2 years ago

qjhart commented 2 years ago

On 2022-11-02, VE had an emergency request, that we update the RIS format, for type paper-conference. The problem is that the citation.js module will translate the issued component into a C2 entry in RIS. Currently, MIV doesn't support that as an entry.

I executed a MC, on the api container, and modified the translation JSON code, removing this line, https://github.com/citation-js/citation-js/blob/857524c92c8389f3a9e3a962bb31a87cc3c97bbc/packages/plugin-ris/src/spec/new.json#L679

The problem is clearly not with our code. We need to better understand where this particular mapping came from, and either; 1) submit a patch to reorder these, or 2) maybe a patch to include every potential RIS code on translation.

I haven't been able to discover where these mappings came from. Every publisher seems to just make their own mappings for example elsevier uses a different mapping

qjhart commented 2 years ago

This example from citation .js shows this problem. This converts citeproc.js to RIS

echo '{"type":"paper-conference","title":"Foo","issued":{"date-parts":[[2022,1,31]]}}' | citation-js -s ris

Results in:

[{"C2":"2022/1/31/","ID":"temp_id_540570882210","TI":"Foo","TY":"CONF"}]

which is

echo '{"type":"paper-conference","title":"Foo","issued":{"date-parts":[[2022,1,31]]}}' | citation-js -s ris | citation-js | jq .

Results in:

[
  {
    "issued": {
      "date-parts": [
        [
          2022,
          1,
          31
        ]
      ]
    },
    "id": "temp_id_343075037055",
    "title": "Foo",
    "type": "paper-conference",
    "_graph": [
      {
        "type": "@else/json",
        "data": "[{\"C2\":\"2022/1/31/\",\"ID\":\"temp_id_343075037055\",\"TI\":\"Foo\",\"TY\":\"CONF\"}]\n"
      },
      {
        "type": "@else/list+object"
      },
      {
        "type": "@ris/record",
        "data": {
          "C2": "2022/1/31/",
          "ID": "temp_id_343075037055",
          "TI": "Foo",
          "TY": "CONF"
        }
      },
      {
        "type": "@csl/object"
      },
      {
        "type": "@csl/list+object"
      }
    ]
  }
]
UcDust commented 2 years ago

We have a few options here:

  1. We could modify the api code to fix the code RIS translation code, essentially replacing the C2 code with DA.
  2. We could modify the Dockerfile to copy in our own translation file with a fix, to essentially override the file in citation-js.
  3. We could create a PR in the citation-js repo and hope they'll allow it to be merged, or possibly get MIV to accept the C2 code that's breaking things.

We'll have to discuss with @qjhart and @jrmerz.

UcDust commented 1 year ago

As a stopgap we went with the Dockerfile build step to copy over a locally modified new.json file into the citation-js package. Also we opened an issues here.