Citation relations tab doesn't work properly!
JabRef version
JabRef 6.0-alpha.493--2025-04-18--224290a
Operating system
GNU / Linux
Details on version and operating system
Ubuntu 24.04 (64 bit)
Checked with the latest development build (copy version output from About dialog)
- [x] I made a backup of my libraries before testing the latest development version.
- [x] I have tested the latest development version and the problem persists
Steps to reproduce the behaviour
Citation relations are a very useful feature of JabRef, But very often this function does not work correctly.
To make sure of this, you need to take the following steps:
-
For example create the biblatex entry like this:
@Article{Raftari_2015_Self_V_118_N_20_EN, author = {Raftari, B. and Budko, N. V. and Vuik, C.}, date = {2015}, doi = {10.1063/1.4936201}, file = {:2015_Self-consistent_drift-diffusion-reaction_model_[SDMFTEBIWDS]_V_118_N_20_(B_Raftari).pdf:PDF}, groups = {eBook, Charging Models, SiO2, Al2O3, GR}, journal = {Journal of Applied Physics}, journaltitle = {Journal of Applied Physics}, language = {english}, number = {20}, pages = {204101}, status = {checked}, title = {Self-consistent drift-diffusion-reaction model for the electron beam interaction with dielectric samples}, volume = {118}, xmp_metadata = {+}, availability = {on}, priority = {prio2}, publisher = {AIP Publishing}, readstatus = {skimmed}, } -
In an open Entry, open the Citation relations and after download the Cited by tab and scroll down to **Numerical simulation of electron beam-induced dielectric charging using advanced computational scheme for solving semilinear reaction-diffusion equation **. After that, add selected entry to the database.
Next we see that the bib record was added with the wrong Entry type Misc, but the original type is InProceedings. Of course this is not the main problem!
-
Reload the JabRef or the entry (Raftari_2015_Self_V_118_N_20_EN) to see the changes in the Citation relations -> Cited By. Now we see that Pavelchuk's article that quotes Raftari has been added to our library and is highlighted in green. It works correctly!
-
As an example, you just need to change the bookmark type from Misk (for just added Entry of the Pavelchuk) for example to a book or article and open the Raftari Entry again. Looking through the Citation relations -> Cided By for the Raftari Entry, we see that Pavelchuk's article has disappeared from those added to the library, although it is actually present in the library.
This is far from the only example when the program does not see already added elements. Especially if they were added not through the Cited By utility but by citation on the articles's website.
Often, simply changing lowercase characters to uppercase in the DOI will produce these results.
Is this issue still occurring ? if yes, I can work in this without problem?
/assign-me
👋 Hey @SalvadorRomo, thank you for your interest in this issue! 🎉
We're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.
For questions on JabRef functionality and the code base, you can consult the JabRef Guru or ask on our Gitter chat.
In case you encounter failing tests during development, please check our developer FAQs!
Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.
Happy coding! 🚀
@NeymanDmitry I see that this is an old bug, so not sure if it was already fixed or a fix is still needed?
@NeymanDmitry I see that this is an old bug, so not sure if it was already fixed or a fix is still needed?
@SalvadorRomo The PR description gave a step-by-step guide. At which step did your experiments diverge from the the PR description?
No, at any steps, I just wondered since the issue has been there for quite longer maybe i thought it was already resolved. But ok, will follow the steps to reproduce it.
Just because the issue is open so long doesn't mean its fixed. Always first try to reproduce; if not, or no longer reproducible issue can be closed
Hey, could reproduce the issue, but want to understant a phew things. So, first you select an entry in the cited by tab from an article, then this is added to the library and selected in green(which is good), but then, you realize it has the wrong bookmark, you then change it to Article, but then it was deselected (no green anynomere in the citedBy tab) , So what you want for that entry is to continue being selected in green even though you change the bookmark?
If an article (book, etc.) is already in the library, then regardless of the name of the card, it must be identified as being in this library. If there are several copies, their number must be displayed next to the corresponding entry in the Citation relations so that they can be accessed by analogy with the access to the list of articles in the library during a search for further editing.
Ideally, when identifying articles referring to this one and those referred to by this article, they should be automatically cross-referenced within the JabRef library (possibly using fields like cites, citedBy, or others).
Note on links to other entries: https://docs.jabref.org/advanced/entryeditor/entrylinks - cites is supported.
@SalvadorRomo there are multiple ways how you could approach this issue.
-
You could add an additional step after citation relations have been fetched from (I believe) semanticscholar.org and compare and merge the information with content provided by the DOI and other ID fetchers. Prefer precise entry types like "article" over "misc". Only show the merged citations in the GUI. I think this would be a good solution.
-
Add logic to always check lowercase AND uppercase of DOI?
-
Maybe even automatically convert all DOIs during the import to upercase to lowercase or the other way round, but maybe that complicates thins, if remote metadata providers offer both uppercase and lowercase and JabRef will be eternally non-compliant with the "official" metadata as provided by metadata providers.
-
You could automatically store "links" to already existing entries in the library, so if that entry is changed, the "link" still exists. But what if users add entries to the library without using the "citation relations" tab (soon to be called citations tab) and the link thereby was never established? Then we are back to 1, 2 or 3. Or maybe you can think of other approaches.
Prefer precise entry types like "article" over "misc"
We have this kind of logic in org.jabref.gui.mergeentries.threewaymerge.FieldRowViewModel#autoSelectBetterValue
Welcome to refactor that to be available in logic and that callers can use it. Maybe with a result type enum LEFT and RIGHT. And parameters Field, leftValue, rightValue?
2. Add logic to always check lowercase AND uppercase of DOI?
We do have case-ignoring comparison at DOIs: org.jabref.model.entry.identifier.DOI#equals.
As first step, I would propose to re-engineer the requirements on the citation relations tab to the folder docs/requirements as citation-relations.md. Small Howto at https://github.com/JabRef/jabref/blob/main/docs/requirements/index.md
In parallel, a small documentation can be added to https://docs.jabref.org/advanced/entryeditor.
@SalvadorRomo A real learning excersice is to try to document the curent citation relations tab using UML diagrams - e.g., sequence diagrams for the interactions. In Markdown. In https://github.com/JabRef/jabref/tree/main/docs/code-howtos. And link from https://github.com/JabRef/jabref/blob/main/docs/architecture-and-components.md.
thank you all for all your insights/hints, they were super helpful. Ok I think i found the root cause, @ThiloteE I noticed the entry for the failing case stated by @NeymanDmitry doesn't have a DOi, so that is why this method exist DuplicateCheck#compareOptionalFields which checks similitud between entries taking into account entries fields. Now, in order to that method validate equality, it before checks if entry one and two has similiar type, else it assumes entries are not equal. One easy solution is to just remove the validation haveDifferentEntryType and that will do the work because even thought two entries have different type, they will have a similar kind of checksum that met a thresolhod condition. The only disadvantage of this is that type between entries won't match anymore, but does it matter? I don't know, but then I need to understand from final a users use case why they would need to change the type, because instead why not disable such feature of allowing modification in already imported entires and remove haveDifferentEntryType validation? Moreover, lets assume a user adds an empty entry and start filling it manually, if they include doi, ISSN, we are good, but if no DOI is available for that entry, it will rely on field validation and that should be considered as new entry even though appears in the in the citedBy tab for an existing paper becuase fields are not exactly equal. Then, we might start to think in removing the adding button for empty entires, because the more permissive in inputs users , the less control you will have in the business rules. Don't get me wrong, this is juts an opinion, if you decide to go with a robust solution I'll be happy to implement it and collaborate with you!!
if (haveDifferentEntryType(one, two) ||
haveDifferentEditions(one, two) ||
haveDifferentChaptersOrPagesOfTheSameBook(one, two)) {
return false;
}
I think opening a pull-request that allows people to try it in JabRef and review the code is better than discussing the coding related stuff here.
Also, I don't have a formal IT background, so I am badly qualified to comment on your code. I was just trying to push you in the right direction.
Maybe the fetcher just lacks fetching the publicationtypes (or doesn't have a corresponding mapping from their types to bibtex and biblatex types) from the semantic scholar API:
https://api.semanticscholar.org/api-docs/#tag/Paper-Data/operation/get_graph_paper_relevance_search
I think disabling the duplicate check seem dubious. I think we want to have a duplicate check. We just want to have the best result AFTER the duplicate check, right?
Duplicate check is hard stuff. We need to add more test cases describing user behavior. Then adapt the code. This is also called "test-driven development".
I am not sure about the implications of removing the type equality check. We included the check in the "strict" comparison.
(I am on the road and cannot think through completely. But TDD is always a good thing 😅)