Skip to content
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

Citation count API returns 0 for DOI that does not exist #5

Open
kdouda opened this issue Sep 10, 2021 · 0 comments
Open

Citation count API returns 0 for DOI that does not exist #5

kdouda opened this issue Sep 10, 2021 · 0 comments

Comments

@kdouda
Copy link

kdouda commented Sep 10, 2021

The citation-count API route returns 0 if no citation with the provided DOI exists. This requires an extra call to the metadata route to verify if the DOI is present in the OCI database or not, which slows down the process. The API call should (imho) return a different status code (404?) and not return a 0, instead either return a null or any non-numerical value (ie N/A).

For example, with a DOI that verifiably does not exist:

https://opencitations.net/index/api/v1/citation-count/10.asdf

returns

[
    {
        "count": "0"
    }
]

Call to the metadata API reveals that the DOI is not known to OCI:

https://opencitations.net/index/api/v1/metadata/10.asdf

I may be able to help with the implementation if needed, but I am not sure if I understand SPARQL well enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant