bridge.pipelines.bt2gh_for_pr_issues.map_funcs.citation module#
Generate a CITATION.cff file from bio.tools publication metadata.
This module retrieves publications from a bio.tools entry, resolves them via the Europe PMC REST API, and converts the resulting bibliographic information into the Citation File Format (CFF).
If a CITATION.cff already exists in the GitHub repository, its non-publication metadata is preserved where present, and its publication list is merged with publications discovered via bio.tools / Europe PMC. References are deduplicated, and a preferred citation is chosen with a clear precedence: existing preferred-citation (if any) > bio.tools primary publications > other publications.
- async bridge.pipelines.bt2gh_for_pr_issues.map_funcs.citation.map_citation(gh_citation_cff, bt_params)[source]#
Generate or update a CITATION.cff file based on bio.tools and Europe PMC metadata.
Steps performed: 1. Reads publication metadata from a bio.tools tool entry. 2. Resolves each publication via the Europe PMC API to obtain
bibliographic metadata.
Optionally parses an existing CITATION.cff (if provided) and extracts existing references and a preferred-citation.
Merges existing references and new references, deduplicating based on DOI/PMID/PMCID/title.
Chooses a preferred citation following the configured precedence rules.
Merges top-level metadata from the existing CFF and bio.tools.
Returns a dictionary mapping “CITATION.cff” to the YAML-serialized CFF content.
- Parameters:
gh_citation_cff (dict[str, Any]) – Parsed content of an existing CITATION.cff file from the GitHub repository.
bt_params (dict[str, Any]) – The bio.tools tool metadata as a dictionary. Expected keys include: - ‘publication’ : list of publication items from bio.tools metadata. - ‘name’ : name of the tool. - ‘biotoolsID’ : bio.tools identifier. - ‘homepage’ : homepage or repository URL. - ‘license’ : license identifier. - ‘topic’ : list of topics. - ‘description’ : description of the tool.
- Returns:
A dictionary with the filename “CITATION.cff” as key, and the YAML-formatted CFF content as value.
- Return type:
dict[str, str]