Skip to content

Craft round-trip test for CFF importer/exporter #10993

@jeanprbt

Description

@jeanprbt

As mentioned in #10917 (comment), it would be great to craft a round-trip test for the cff format, since we now have both an importer and an exporter.

The round-trip test should work importing https://github.com/JabRef/jabref/blob/main/CITATION.cff.

The current problem is that the importer only parses imports to BibEntry software type, as it was primarily intended by the Citation-File Format. On the other hand, the exporter uses the field preferred-citation to parse entries to their actual type, even if it is different that software. Also, the exporter uses the preferred-citation field even when the type is Software, which is not the expected behavior according to the CFF format.

There are four main things to implement in order for this round-trip test to work.

  • make the importer parse the preferred-citation field, and in this case create another BibEntry for what is contained.
  • make the exporter parse the BibEntry Software type, and in this case output a cff file without any preferred-citation field.
  • parse the author's first name and last name separately, so that the exporter could use the fields given-names and family-names instead of the generic field name in the authors section.
  • (more simple) parse all the fields from https://github.com/JabRef/jabref/blob/main/CITATION.cff in both importer and exporter

The exporter works using org.jabref.logic.exporter.TemplateExporter and the src/main/resources/resource/layout/cff.layout file. Importer is located in org.jabref.logic.importer.fileformat.CffImporter.

Some work was done in #10957 but then abandoned, it may help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions