Skip to content

Added INSPIRE HEP Fetcher to "Update with bibliographic information from the web"#9602

Merged
Siedlerchr merged 8 commits into
JabRef:mainfrom
lak7:add-Inspire-Fetcher
Feb 25, 2023
Merged

Added INSPIRE HEP Fetcher to "Update with bibliographic information from the web"#9602
Siedlerchr merged 8 commits into
JabRef:mainfrom
lak7:add-Inspire-Fetcher

Conversation

@lak7

@lak7 lak7 commented Feb 7, 2023

Copy link
Copy Markdown
Contributor

Resolves #9351

Added INSPIREFetcher to the set of GetEntryBasedFetchers and also updated INSPIREFetcher to implement EntryBaseFetcher Interface.

Screenshot_20230207_181029

This adds the Inspire button where one can fetch the data for existing entries.

TEST CASE:
Here for example is the doi for testing Inspire Fetcher: 10.1103/PhysRevLett.126.101101
Now we can fetch bibliographic data from InspireHEP for entries, which may had been imported from elsewhere or are missing an citation key.
Screenshot_20230214_235455

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • [x ] Manually tested changed features in running JabRef (always required)
  • [x ] 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.

lak7 added 2 commits February 7, 2023 17:56
Added INSPIREFetcher to the set of GetEntryBasedFetchers.
Updated INSPIRE HEP Fetcher to implement the EntryBasedFetcher Interface.

@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.

Thanks for your contribution. Goes already in the right direction, but something seems to be off with your formatting style. Please import JabRef's code style

https://github.com/JabRef/jabref/tree/main/config#intellij-idea-code-style-configuration

And also please add a test case!

String url = "https://inspirehep.net/api/doi" + doi;

try {
URL obj = new URL(url);

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.

You can use our UrlDownload class for this

URLDownload download = getUrlDownload(doiURL);
download.addHeader("Accept", MediaTypes.APPLICATION_BIBTEX);

 This also handles errors

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Siedlerchr I have fixed some logical bugs and corrected code style.

Now InspireHEP is working as desired as one of the resources to fetch bibliographic data from when given a valid doi.

Screenshot_20230214_235455

@Siedlerchr Siedlerchr added the status: changes-required Pull requests that are not yet complete label Feb 7, 2023
lak7 added 2 commits February 14, 2023 23:32
Fixed some logical bugs in performSearch Function and also corrected the code style.
Comment thread src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java Outdated
Comment thread src/main/java/org/jabref/logic/importer/fetcher/INSPIREFetcher.java Outdated
* upstream/main:
  Show error only if user selected to store files in main directory
  Bump pascalgn/automerge-action from 0.15.5 to 0.15.6
  Update Gradle Wrapper from 7.6 to 8.0.1.
  add missing newlines at the end
  import strings and add them to the new bibdatabase Add test
  Resolve strings in MsOffice export
  Checkstyle
  Update CHANGELOG.md
  Refine error message and remove obsolete string
  Squashed 'buildres/csl/csl-styles/' changes from b111f31efe..9926b48cf3
  Fix storing multiline properties for custom fields in custom entry types
  Remove myself from MAINTAINERS (#9617)
  Fixed various fetcher tests (#9618)
@Siedlerchr Siedlerchr added status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed status: changes-required Pull requests that are not yet complete labels Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: fetcher status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add INSPIRE HEP Fetcher to "Update with bibliographic information from the web"

4 participants