jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Add fetcher by id for SWHID

Open Siedlerchr opened this issue 1 year ago • 5 comments

Sofware Heritage foundations provides the option to cite software. One can query their api https://docs.softwareheritage.org/devel/architecture/citation.html#citation-v1-architecture

Start reading at https://devdocs.jabref.org/code-howtos/fetchers.html

Siedlerchr avatar May 27 '25 10:05 Siedlerchr

/assign-me

7amo10 avatar Sep 04 '26 11:09 7amo10

⚠️ Issue Already Assigned

Hi @7amo10, this issue is currently assigned to @ZiadAbdElFatah.

[!NOTE] If no progress is made within 8 days, the issue will be automatically unassigned.

Options for contributors
  • Wait for availability: The issue may become available if auto-unassigned
  • Collaborate: You can ask the assignee if they want help
  • Maintainer assistance: A maintainer can add you as co-assignee if appropriate

jabref-machine avatar Sep 04 '26 11:09 jabref-machine

Hi @Siedlerchr , @ZiadAbdElFatah

As I understand, Software Heritage Identifiers (SWHIDs) provide persistent identification for software source code artifacts. The goal of this issue (as I am expecting) is to enable users to import bibliographic entries directly into JabRef by simply providing an SWHID (or its archive URL), leveraging the Software Heritage citation API to retrieve the citation metadata in BibTeX format which is similar to how JabRef already handles DOIs, ISBNs, and arXiv IDs.

Here is my planned approach to tackle this (This is my point of view and I deduced after reading the links above):

  1. Identifier Model (SWHID): • Add a new SWHID identifier under org.jabref.model.entry.identifier supporting standard SWHID syntax (swh:1:<type>:<hash>), qualifiers, and web-prefixed URLs (https://archive.softwareheritage.org/...). • Register it in Identifier.java to enable automatic identifier detection.
  2. Fetcher Logic (SwhidFetcher): • Implement an IdBasedFetcher querying Software Heritage's citation API (/api/1/raw-intrinsic- metadata/citation/swhid/?citation_format=bibtex&target_swhid=...). • Parse the returned BibTeX content into a BibEntry and ensure BiblatexSoftwareField.SWHID is populated. • Register the fetcher in WebFetchers.java for ID-based retrieval.
  3. Testing: • Unit tests for SWHID validation/parsing in SWHIDTest. • Integration tests against the live endpoint in SwhidFetcherTest using @ExternalServicesTest.

Does this approach look good to you, or would you recommend any adjustments?

7amo10 avatar Sep 04 '26 18:09 7amo10

https://dontpastetheai.com/ In general your approach sounds great, just create a draft PR and follow the guidelines

Siedlerchr avatar Sep 04 '26 19:09 Siedlerchr

We think that this issue was fixed. Please head to https://builds.jabref.org/main to download a development build and try it out.

For any feedback, add a comment to the pull request at https://github.com/JabRef/jabref/pull/16849.

github-actions[bot] avatar Sep 09 '26 17:09 github-actions[bot]