Page MenuHomePhabricator

Add PMID to all citation objects that contain a DOI using PubMub API
Closed, ResolvedPublic

Description

In method addPMID() in the file lib/zotero.js, currently the PMID is extracted from the extra field in the citation object. However, the PMID is only found in the extra field when the metadata is being extracted from a link directly from http://www.ncbi.nlm.nih.gov/, but not if a different URL to the paper is used, such as one on the publisher's website. If a citation object contains a DOI (citation.DOI), you can use the DOI to look up the PMID and add that to the citation using the PubMed API: http://www.ncbi.nlm.nih.gov/pmc/tools/id-converter-api/ If there is no citation.DOI field, you should not do anything as the source either does not have a PMID or if it does, would be very difficult to find without the DOI.

Hint: use the "request" library: https://www.npmjs.org/package/request
Hint: JSON is a great format to use in conjunction with Javascript because it is very Javascript object-like!

Bonus points: Add the other IDs available from the PubMed API to to the citation object. You should think about how the code should be structured in order to avoid making more than one request for the same information.

Revisions and Commits

Event Timeline

Mvolz raised the priority of this task from to Low.
Mvolz updated the task description. (Show Details)
Mvolz added a project: Citoid.
Mvolz changed Security from none to None.
Mvolz moved this task from Backlog to IO Tasks on the Citoid board.
Mvolz added a subscriber: Mvolz.
Mvolz renamed this task from Add PMID to all works with one assigned using nih API to Add PMID to all citation objects with a DOI using PubMub API.Nov 9 2014, 11:44 PM
Mvolz updated the task description. (Show Details)

I've approved this task, but I'd appreciate acceptance criteria to be slightly clearer:

If a citation object contains a DOI

does this only mean a citation object as already available to addPMID(), as I understood it? In other words, this task is not about finding any additional DOI, is it?

Yes, that's correct. If the citation already available to addPMID doesn't already have a DOI field (citation.DOI), it's highly probable that it doesn't have a PMID at all, and if it does have one it's going to be nearly impossible to find without finding the DOI first- which I'm definitely not asking people to try to do!

So below are two links to the exact same paper:

http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1002947

If you get metadata from the above link, it will currently come back with a DOI but no PMID.

Using the link to the paper on the pubmed website will currently come back with a PMID:

http://www.ncbi.nlm.nih.gov/pubmed/23555203

The goal of this is to have a PMID come back from either link to the same paper, not just links to the pubmed website.

Mvolz renamed this task from Add PMID to all citation objects with a DOI using PubMub API to Add PMID to all citation objects that contain a DOI using PubMub API.Dec 1 2014, 11:13 AM
Mvolz updated the task description. (Show Details)

Change 176921 had a related patch set uploaded (by Unicodesnowman):
Add missing PMIDs by looking up DOI

https://gerrit.wikimedia.org/r/176921

Patch-For-Review

Change 176921 merged by Mvolz:
Add missing PMIDs by looking up DOI, create pubMedRequest.js

https://gerrit.wikimedia.org/r/176921

Diffusion added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:14 AM