CottageLabs / LanternPM

Lantern meta repository for product management
1 stars 0 forks source link

Some feedback on the /:job API endpoint #95

Open richard-jones opened 8 years ago

richard-jones commented 8 years ago

In the process of documenting, some oddities and inconsistencies which came up:

{
    "Article title" : "[title of the article]",
    "DOI" : "[article DOI]",
    "PMCID" : "[Europe PMC identifier for the article (starting with 'PMC')]",
    "PMID" : "[PubMed identifier for the article]"
}

Info about a job is:

{
    "process": "[per-identifier process id]",
    "PMID": "[pubmed id]",
    "DOI": "[doi]",
    "pmcid": "[EuropePMC id]",
    "title": "[Article title]"
}

Note differences in capitalisation, and "Article title" becomes "title"

Propose for overall consistency to use lower case keys everywhere, which would fix most of the oddities.

markmacgillivray commented 8 years ago

Oddities are mostly due to Wellcome things. Originally I lowercased and used pmid, doi, pmcid, title. But this was not acceptable to Wellcome, so I had shifted various bits of formatting into specific functions that handle formatting depending on whether Wellcome user or not, but as there has been no use of the API by them (and no other testing of it done yet), I probably missed some things that are writing them in different forms within the JSON data. I can check, and agree lowercasing is my preferred option anyway, and "article title" gets reduced to "title".

"process" is the ID of the process that will get the answer for the identifiers provided. There is a process for every row / set of identifiers provided in the job list. The process ID can be used to look up the processes on the processes endpoint - although this can be very short lived, so may not be useful. Very often, possibly now always, it will be the same as the _id of the process. This info could probably just be removed from the results if you prefer - as mentioned, to date I don't actually have any provided requirements for the API, beyond what the UI needed it do and what I wanted it to do.

When you create a job you get back the ID of the job. Then you use that ID to get at the job later. The job is the ID of the job.

I think progress report includes user email because of old Wellcome requirements, when things had to be fiddled to allow them to use the system without logins. This is probably no longer necessary due to the way progress is notified to users having changed, but the email address is still in there. Can be removed if you prefer.