citation-file-format / cffconvert

Command line program to validate and convert CITATION.cff files.
Apache License 2.0
95 stars 28 forks source link

Add support for biblatex-software #391

Open joenio opened 2 months ago

joenio commented 2 months ago

This Pull-Request adds support for converting CITATION.cff to biblatex-software format adding the new --format biblatex, eg:

cffconvert -i CITATION.cff -f biblatex -o biblatex.bib

The Bibtex format --format bibtex was not changed, and the new format --format biblatex was added, the new format biblatex was build on top of the bibtex implementation, the source code of Bibtex was duplicated and modified to add the new fields below:

Important to mention that the fields institution and editor doesn't have a straight match with any field from CFF format, AFAIK. My approach was to collect it from the field contact from the CITATION.cff.

The biblatex-software documentation defines the field institution such as:

I am not sure we have this kind of field on CITATION.cff, the strategy adopted here for the institution field is:

The biblatex-software documentation defines the field editor such as:

Again, I am not sure we have this kind of field on CITATION.cff, the strategy adopted here for the editor field is:

Below you can see how the results between bibtex and biblatex differs for the same input file.

Example of use for the bibtex format

cffconvert -i tests/cli/cff_1_0_3/CITATION.cff -f bibtex
@misc{YourReferenceHere,
author = {Spaaks, Jurriaan H. and Klaver, Tom},
doi = {10.5281/zenodo.1162057},
month = {1},
title = {cffconvert},
url = {https://github.com/citation-file-format/cffconvert},
year = {2018}
}

Example of use for the biblatex format

cffconvert -i tests/cli/cff_1_0_3/CITATION.cff -f biblatex
@software{YourReferenceHere,
author = {Spaaks, Jurriaan H. and Klaver, Tom},
doi = {10.5281/zenodo.1162057},
month = {1},
title = {cffconvert},
url = {https://github.com/citation-file-format/cffconvert},
year = {2018},
date = {2018-01-16},
repository = {https://github.com/citation-file-format/cffconvert},
license = {Apache-2.0},
version = {1.0.0},
keywords = {citation, bibliography, cff, CITATION.cff}
}

Questions

I believe the code added by this PR is good but not good enough, I think I need some inputs from the more-experienced here about the compatibility between the CFF schema and the biblatex-software schema, specially for the fields editor and institution, the strategy that I've adopted is based on my experience using CITATION.cff to document some of my projects, where I have used the CITATION.cff contact field to describe who is the institution and the editors of the software project I am working on.

That said, I would like to ask: What do you think about the code proposed here, and about the strategy adopted for the fields I've mentioned?

Thanks for you time and your attention.

Closes: #152