Use default `texkeys` when importing from `Inspirehep` web search with arxiv number
Is your suggestion for improvement related to a problem? Please describe.
When using inspirehep database in the web search, if one use normal inspirehep search syntax, the returned citekey would be what's on their website. But if one use arxiv number to search, the returned citekey will just be the url of the arxiv doi. I don't think using a long string of doi url is a good idea for a cite key.
Describe the solution you'd like The inspirehep api would give a key named "texkeys" that provides the cite key. This is the same for both the normal api and the api for arxiv/doi etc. I believe this key is used for the normal searches, but not searches with unique identifiers such as arxiv number. It should be a simple fix to include this information.
Additional context Add any other context or screenshots about the feature request here.
I'd like to take this on, but I've started looking at it and I'm having some trouble. It seems like an issue with the parser but I'm not sure how that works. Any direction would be appreciated.
@benlevycmp
- Check fetcher code. Find where inspire is used
- Look for the tests. Check for returned entries
- Search how
texkeysis included - Get the field content of
texkeysand put it as citation key (internal jabref field) in the inspire fetcher - Redo for arxiv fetcher
Longer task (not in scope)
This issue is a good thing to dive into our fetcher infrastructure: https://devdocs.jabref.org/code-howtos/fetchers.html
Currently, when pasting an Id, the IdFetcher is used. When searching normally, the selected fetcher is used. Maybe, there should be a combined fetching?
@Turgon-Aran-Gondolin JabRef has a decent key generation build in - to ensure consistent keys across fetchers. See https://docs.jabref.org/setup/citationkeypatterns - Have you seen this? Do you like this?
@koppor I'm aware of the built-in key generator in JabRef, and I'm personally fine with that. But in collaborations, there're reasons I'd prefer the inspire-generated keys. And I just realized that this is not just a cite key issue. Searching with arxiv number actually gives you a different entry with only arxiv information, even if the paper is published.
MWE: search for 2409.15408 in the INSPIRE web search box, the entry does not contain any information about the journal, even if it has been published; but search for "Renormalization of the SMEFT to dimension eight: Fermionic interactions I" will give you the correct entry with all the updated information. I suspect the 1st one is searching within arxiv database, not inspire's.
I suspect the 1st one is searching within arxiv database, not inspire's.
Yes.
Our heuristics: If a user inputs an id in the web search, the id should be searched. See https://github.com/JabRef/jabref/issues/7575 and https://github.com/JabRef/jabref/issues/9674 (this was you actually ^^).
Now you say: If some catalogue (e.g., inspire) has search results for this, we should use that result.
Ideas:
- If identifier is arXiv, search all "pre-configured" catalogues for the string first. If nothing found, use arXiv fetcher
- After searching at arXiv, search all "pre-configured" and enrich the search result by the result of that result
IMO, if one wants to use the arXiv fetcher, they should use the built-in 'new entry' option. When I deliberately choose the web search, I expect the results to come from the designated pre-configured catalogue. Therefore, I prefer your first idea.
I actually proposed in #9674 that doi in web search should be quoted internally (or any search string in that matter). One can still check if the input is an identifier, quote it, search for it using the selected web search, then if there's no hit, search for the id in default fetchers instead.
Alternative 3: DOI, arXiv Id fetcher selectable in the dropdown
If "normal" provider is selected, the string is routed as is to it (and no detour taken)
Alternativ 4: On entering of arXiv id, the id is prefixed with "arXiv:" in the field - and then a search done.
Hi! We are students from Australian National University. We are interested in this issue and would like to take it.
PR https://github.com/JabRef/jabref/pull/14099 was filed, but not followed-up. Maybe, this can be an inspiration for future contributors.
Hi, this is my second issue here. I read through the issue and the earlier comments. According to what i understood, the same paper can be fetched via two different routes (regular InspireHEP search vs. arXiv-based search), but JabRef currently sets the citation key differently depending on the route. Even though InspireHEP provides texkeys, they are not used when the entry is fetched via arXiv. Solution aims to to make this behavior consistent and always prefer texkeys when they are present. I would like to work on it!!
/assign-me
Thank you for your continued work in JabRef. At this point, you probably already know the basics and the important links. If not, our contributing guidelines is the place you should go to.
Hello!
From what I understand so far, when a normal INSPIRE web search is performed, the BibTeX entry key provided by INSPIRE is correctly used as the citation key, so there is no issue in that path.
When the search is done using an arXiv identifier, however, an entry is initially created with an auto-generated citation key (often derived from the URL). Even if inspire metadata later provides a proper BibTeX entry key, the existing citation key is not updated accordingly.
Based on this, it seems that the problem is not in the inspire fetcher itself, as it already follows the expected behavior, but rather in how the citation key is preserved or updated in the identifier-based fetch path.
Please let me know if my understanding is incorrect anywhere — I’m eager to learn. Thanks!
This seems like a correct observation. I think the issue is: Can we find out from the arXiv IDs or data if it is coming from inspirehep
I verified the fix by comparing normal INSPIRE search vs arXiv-ID search. Both now correctly use INSPIRE texkeys (e.g., hep-th/9711200 → Maldacena1997).
@addix7 go ahead and do a PR Then
Thanks for the confirmation!! I’ll open a PR shortly.
Hello @Siedlerchr, regarding your question about whether we can determine from the arXiv ID or data if an entry is coming from INSPIREHEP: although the changes I made are showing the desired behavior in practice, on pondering over the IdBasedFetcher, ArXivFetcher, and INSPIREFetcher code paths, I realized that this cannot be deduced from the arXiv ID alone. An arXiv identifier only tells us that the entry exists on arXiv. It is only after the INSPIRE arXiv endpoint is queried and INSPIRE successfully returns BibTeX metadata that we can reliably treat the entry as INSPIRE-origin data and use the provided citation key (texkey).
If I'm understanding this correctly, when searching with an arXiv ID (2409.15408 or hep-th/9711200) via the INSPIRE web search, the returned entry used to have an invalid DOI URL as the citation key and missing info instead of the proper INSPIRE texkey and full metadata. I just tested both cases on the current main build and everything looks correct on my end (got Maldacena1997 as the key with full publication info). Can anyone else verify if this is working for them too? @Siedlerchr Am I verifying it correctly?
/assign-me
Thank you for your continued work in JabRef. At this point, you probably already know the basics and the important links. If not, our contributing guidelines is the place you should go to.
At this point in time, you raised 1 pull request(s) of which 100% (1/1) have been merged.
Hello @koppor ,
My pull request has now passed all CI checks.
Could you please take a look?