hirmeos / altmetrics

Implementation of HIRMEOS WP6
MIT License
5 stars 0 forks source link

Hypothes.is API not fetching annotations by DOI #35

Open rowan08 opened 5 years ago

rowan08 commented 5 years ago

The hypothesis plugin is failing to retrieve annotations when querying the Hypothes.is API, using the DOI of a book. A similar problem was encountered when trying to retrieve Hypothes.is annotations for books from the Crossref Event Data API.

Following the Hypothes.is guidelines (https://web.hypothes.is/help/how-hypothesis-interacts-with-document-metadata/), we have embedded the DOI of our books in the EPUB reader page, using the Dublin Core meta tag, but annotations from these pages do not show up when querying the Hypothes.is API by DOI, even though they can be fetched using the URL of the page, e.g. annotations for using the wildcard query https://hypothes.is/api/search?wildcard_uri=https://www.ubiquitypress.com/site/books/10.5334/baj/read/?loc=* are not found when querying based purely on DOI: https://hypothes.is/api/search?uri=doi:10.5334/baj

We have contacted the Hypothes.is support team, and they are looking into this issue.

Until it is resolved. we will only be able to fetch book annotations by URL, rather than DOI.

yoannspace commented 4 years ago

The API search call: https://hypothes.is/api/search?uri=doi:10.5334/baj seems to be work

rowan08 commented 4 years ago

From what I understand, the problem is that Hypothesis will link a DOI to a single URL, so it will ignore any other URLs that the book can be read at - which is especially a problem with the EPUB reader, which uses separate URLs for different sections of the book.

So in the example, https://hypothes.is/api/search?uri=doi:10.5334/baj: The annotation it finds is from the landing page of the book. But it fails to return any annotations from within the EPUB reader itself.

i.e. it misses all the annotations found when checking https://hypothes.is/api/search?wildcard_uri=https://www.ubiquitypress.com/site/books/10.5334/baj/read/?loc= (note, when clicking on this URL, you will need to manually add in the at the end, otherwise, the search will raise an error)

yoannspace commented 4 years ago

How about querying hypothes.is x times (at least 2 when EPUB reader is involved)?