nfdi4plants / Swate

Excel Add-In for annotation of experimental data and computational workflows.
https://swate-alpha.nfdi4plants.org
MIT License
31 stars 6 forks source link

[Feature Request]: Doi, PubMed, ORCID search #372

Closed JonasLukasczyk closed 7 months ago

JonasLukasczyk commented 7 months ago

Contact Details

No response

Is your feature request related to a problem?

-

Describe the solution you would like!

Below are the ARCitect code snippets that use the corresponding APIs.

// ------------------------
// DOI
// ------------------------
record = await getWebPageAsJson({
  host: 'api.crossref.org',
  path: '/works/'+ doi,
  method: 'GET'
});
title = record.message.title.join(', ');
authors = record.message.author.map(a=>a.given+' '+a.family).join(', ');

// ------------------------
// PubMedID
// ------------------------
record = await getWebPageAsJson({
  host: 'api.ncbi.nlm.nih.gov',
  path: '/lit/ctxp/v1/pubmed/?format=csl&id='+ id,
  method: 'GET'
});
title = record.title;
authors = record.author.map(a=>a.given+' '+a.family).join(', ');

// ------------------------
// ORCID
// ------------------------
record = await getWebPageAsJson({
  host: 'pub.orcid.org',
  path: '/v3.0/'+id+'/record',
  method: 'GET'
});

// name
firstName = record.person.name['given-names'].value;
lastName = record.person.name['family-name'].value;

// try to fetch first email if exists
try{
  eMail = record['person']['emails']['email'][0].email;
} catch(e){}

// try to fetch first organization if exists
try{
  organization = record['activities-summary']['employments']['affiliation-group'][0]['summaries'][0]['employment-summary'].organization;
  address = [organization.address.city,organization.address.region,organization.address.country].join(', ');
  affiliation = organization.name;
} catch(e){}

Additional context!

No response

Host

Applies to All

Host Details

-

Freymaurer commented 7 months ago

Do we have an ontology for "Publication is published"? @AngelaKranz @StellaEggels ? I refer to Publication.Status