Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial conference paper bibliography consistency check #10778

Merged
merged 4 commits into from
Jan 27, 2024

Conversation

koppor
Copy link
Member

@koppor koppor commented Jan 13, 2024

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
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
Member

Choose a reason for hiding this comment

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

make this constants

Copy link
Member

@Siedlerchr Siedlerchr left a comment

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
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
Copy link
Member Author

koppor commented Jan 16, 2024

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

Copy link
Contributor

github-actions bot commented Jan 16, 2024

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

@Siedlerchr
Copy link
Member

Should we merge this first draft?

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

koppor commented Jan 27, 2024

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
18 checks passed
@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