IQSS / IQSS/dataverse

Hypothesis file preview not possible

Open
#10,136 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Bug
Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

entrepot.recherche.data.gouv.fr team

What steps does it take to reproduce the issue?

upload a json file to a dataset

  • What happens?

The dataverse configuration for a json file is as follows:

https://github.com/IQSS/dataverse/blob/3305c4a41045d0bb2f261c5eb2aa93414a34f2c6/src/main/java/propertyFiles/MimeTypeDetectionByFileExtension.properties#L13

it is impossible to obtain a Hypothesis type json file with its corresponding MimeType:
application/x-json-hypothesis

Finally, it is not possible to obtain a preview provided by dataverse-previewers because there is no json file with the correct MimeType:

curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \ '{ "displayName":"View Annotations", "description":"View the annotation entries in a file.", "toolName":"annotationPreviewer", "scope":"file", "types":["preview"], "toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/HypothesisPreview.html", "toolParameters": { "queryParameters":[ {"fileid":"{fileId}"}, {"siteUrl":"{siteUrl}"}, {"key":"{apiToken}"}, {"datasetid":"{datasetId}"}, {"datasetversion":"{datasetVersion}"}, {"locale":"{localeCode}"} ] }, "contentType":"application/x-json-hypothesis" }'

  • To whom does it occur (all users, curators, superusers)?

all users

  • What did you expect to happen?

Is this behavior of Dataverse intended or does it correspond to a configuration limitation?

Which version of Dataverse are you using?

5.12.1+

Any related open or closed issues to this bug report?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MIME mapping in src/main/java/propertyFiles/MimeTypeDetectionByFileExtension.properties at the linked line, then reproduce the JSON upload and inspect the externalTools request shown in the report. Compare the detected file type with application/x-json-hypothesis and establish whether the preview limitation is intentional or requires a configuration change.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.