Skip to content

Initial conference paper bibliography consistency check#10778

Merged
Siedlerchr merged 4 commits into
mainfrom
add-quality-check
Jan 27, 2024
Merged

Initial conference paper bibliography consistency check#10778
Siedlerchr merged 4 commits into
mainfrom
add-quality-check

Conversation

@koppor

@koppor koppor commented Jan 13, 2024

Copy link
Copy Markdown
Member

When writing a paper, one copies BibTeX entries to the .bib file for the paper. Then, one deletes fields to make the library shorter. Maybe, one does not touch the entries at all. All in all, there will be inconsistencies in the bib file, which typically need manual investigation. (More discussion on that topic at #160)

This PR adds the logic to check the references of a given list of BibEntries for consistency: Do the entries of the same entry type have the same fields set?

The output is a CSV file.

For a real-life publication (pseudonymized here based on the from-aux functionality), the output is as follows

image


Future work is to provide an integration in the UI.


This PR gets reviewable if #10776 is merged. Therefore marked as draft.

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@koppor koppor mentioned this pull request Jan 13, 2024
6 tasks
@koppor koppor changed the title Initial anonymization Initial conference paper bibliography consistency check Jan 13, 2024
@koppor koppor force-pushed the add-quality-check branch from 06d336b to c79e252 Compare January 14, 2024 19:38
@koppor koppor marked this pull request as ready for review January 14, 2024 19:54
@koppor koppor marked this pull request as draft January 15, 2024 08:50
@koppor koppor marked this pull request as ready for review January 15, 2024 20:14
PaperConsistencyCheck.EntryTypeResult entries = mapEntry.getValue();
SequencedCollection<BibEntry> bibEntries = entries.sortedEntries();

bibEntries.forEach(Unchecked.consumer(bibEntry -> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor to own method

allFields.forEach(field -> {
theRecord.add(bibEntry.getField(field).map(value -> {
if (requiredFields.contains(field)) {
return "x";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this constants

@Siedlerchr Siedlerchr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some refactorings necessary

.get(entryType).stream()
.filter(entry -> !entry.getFields().equals(commonFields))
.sorted((e1, e2) -> {
int first = e1.getFields().size() - e2.getFields().size();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract this to a comparator method stuff

@koppor koppor marked this pull request as draft January 16, 2024 00:08
@koppor

koppor commented Jan 16, 2024

Copy link
Copy Markdown
Member Author

Will try to add Markdown output in this PR, too.

@github-actions

github-actions Bot commented Jan 16, 2024

Copy link
Copy Markdown
Contributor

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

@Siedlerchr

Copy link
Copy Markdown
Member

Should we merge this first draft?

@koppor koppor marked this pull request as ready for review January 27, 2024 21:11
@koppor

koppor commented Jan 27, 2024

Copy link
Copy Markdown
Member Author

Should we merge this first draft?

Very OK for me!

There won't be markdown, but an ASCII ouput (like the one of lychee) to really enable it for usage in a CI.

@Siedlerchr Siedlerchr added this pull request to the merge queue Jan 27, 2024
Merged via the queue into main with commit 0add5e3 Jan 27, 2024
@Siedlerchr Siedlerchr deleted the add-quality-check branch January 27, 2024 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants