JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.52k stars 2.47k forks source link

Include PMID in PubMed imports #11488

Closed ryan-carpenter closed 1 month ago

ryan-carpenter commented 1 month ago

The MEDLINE importer does not include PubMed IDs (PMID) when importing from PubMed text files.

This is problematic for two reasons:

  1. PMID is an important identifier
  2. JabRef includes PMID when importing via API, so the behavior is inconsistent

PubMed records also have an NLM unique identifier that JabRef imports, but this is not the same as the PMID and does not substitute for it. MEDLINE records produced by sources other than PubMed tend to include the PMID and not the NLM identifier, so the PMID is more useful for merging and deduplicating entries in JabRef. The PMID can also be used to visit the record on PubMed, fetch additional data, and so on.

The MEDLINE importer should include the PMID element from pubmed/medline files.

See MEDLINE/PubMed Data Element (Field) Descriptions for information about the elements included in PubMed text files.

ryan-carpenter commented 1 month ago

https://github.com/JabRef/jabref/blob/7e4e7d3fba39ed6c1813a522c3fac3e454165c8b/src/main/java/org/jabref/logic/importer/fileformat/MedlinePlainImporter.java#L145-L168

ryan-carpenter commented 1 month ago

Is this all it would take to resolve the issue?

hashMap.put("PMID", new UnknownField("pmid")); 
Siedlerchr commented 1 month ago

Yes, that should be enough. You can do it through the github UI (just click on Edit File). You might need to adjust the MedlinePlainImporterTest as well if it fails but CI will tell you that :)