Skip to content

Show fetch exception at citation relation #13549

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

koppor
Copy link
Member

@koppor koppor commented Jul 15, 2025

image

Background

The API does not return the citing information, but their web page does

image

https://www.semanticscholar.org/paper/Decentralized-Application-Placement-in-Fog-Mann/6870975f7f4db00ad1e2fa041545b67c6e8ef73c

Steps to test

  1. Add paper with DOI 10.1109/TPDS.2022.3148985
  2. Open tab "Citaton relations"

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if change is visible to the user)
  • [/] Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (if change is visible to the user)
  • [/] 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.

Copy link

trag-bot bot commented Jul 15, 2025

@trag-bot didn't find any issues in the code! ✅✨

@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jul 15, 2025
@@ -106,6 +106,8 @@ dependencies {

implementation("com.fasterxml:aalto-xml")

implementation("org.hisp.dhis:json-tree")
Copy link
Member

Choose a reason for hiding this comment

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

Why another json library?

Copy link
Member

@Siedlerchr Siedlerchr Jul 16, 2025

Choose a reason for hiding this comment

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

For optionals use kongs unirest json

Copy link
Member Author

Choose a reason for hiding this comment

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

Why another json library?

Because I know the author personally. And it is fast

Copy link
Member Author

Choose a reason for hiding this comment

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

For optionals use kongs unirest json

Show me. 😅

Copy link
Member

Choose a reason for hiding this comment

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

Because I know the author personally. And it is fast
Argument by authority is not a valid reason

see: eg.g
JSONObject result = item.getJSONObject("resultList").getJSONArray("result").getJSONObject(0);

Optional.ofNullable(result.optString("pubModel")).ifPresent(pubModel -> entry.setField(StandardField.HOWPUBLISHED, pubModel));


if (referencesResponse.getData() == null) {
JsonNode json = JsonNode.of(response);
JsonNode disclaimerJson = json.getOrNull("citingPaperInfo.openAccessPdf.disclaimer");
Copy link
Member

@Siedlerchr Siedlerchr Jul 16, 2025

Choose a reason for hiding this comment

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

Use kong's unirest json that allows you to use optionals

            JSONObject response = JsonReader.toJsonObject(inputStream);


      JSONObject journal = journalInfo.getJSONObject("journal");
                    Optional.ofNullable(journal.optString("title")).ifPresent(title -> entry.setField(StandardField.JOURNAL, title));
                    ```

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.

no new json library
use kongs unirest json for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: citation-relations 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.

2 participants