You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
API endpoint for creating a dataset by importing a DDI xml file fails when DDI file includes fields that Dataverse has a controlled vocabulary for
#6559
Closed
jggautier opened this issue
Jan 22, 2020
· 1 comment
When trying to create a dataset by importing a DDI file using the Import a Dataset into a Dataverse with a DDI file endpoint, if the DDI file includes a DDI metadata field that's mapped to a Dataverse metadata field on import, like Kind of Data, and that Dataverse field has a controlled vocabulary, the import always fails with an error that the value needs to come from the controlled vocabulary, even when the value does come from the controlled vocabulary. This can prevent people (and is preventing at least one person) from using the API endpoint to create datasets by importing DDI xml files if those xml files include metadata fields that are mapped to Dataverse metadata fields that have controlled vocabularies.
Steps to reproduce in Dataverse 4.18.1:
In a Dataverse instance, add a controlled vocabulary to any of the Dataverse metadata fields that are mapped to DDI fields when DDI metadata is imported. For example, for the field Kind of Data, add a controlled vocabulary that includes the value Text.
Create a DDI XML file that includes the field that has the controlled vocabulary, like Kind of Data, and use a value from the vocabulary, like Text. Or use this example DDI xml file: ddi_dataset.xml.zip
You'll get this error: "status":"ERROR","message":"Error parsing datas as Json: incorrect typeClass for field kindOfData, should be controlledVocabulary"
Dataverse should recognize when the value in question is one of the values in the field's controlled vocabulary. I think Dataverse does this if you use the SWORD API to create a dataset by importing a Dublin Core xml file that has dc.subject metadata with a value from Dataverse's subject vocabulary (if the term isn't in the subject vocabulary, Dataverse adds the term to Dataverse's keyword field instead).
The text was updated successfully, but these errors were encountered:
To focus on the most important features and bugs, we are closing issues created before 2020 (version 5.0) that are not new feature requests with the label 'Type: Feature'.
If you created this issue and you feel the team should revisit this decision, please reopen the issue and leave a comment.
When trying to create a dataset by importing a DDI file using the Import a Dataset into a Dataverse with a DDI file endpoint, if the DDI file includes a DDI metadata field that's mapped to a Dataverse metadata field on import, like Kind of Data, and that Dataverse field has a controlled vocabulary, the import always fails with an error that the value needs to come from the controlled vocabulary, even when the value does come from the controlled vocabulary. This can prevent people (and is preventing at least one person) from using the API endpoint to create datasets by importing DDI xml files if those xml files include metadata fields that are mapped to Dataverse metadata fields that have controlled vocabularies.
Steps to reproduce in Dataverse 4.18.1:
"status":"ERROR","message":"Error parsing datas as Json: incorrect typeClass for field kindOfData, should be controlledVocabulary"
Dataverse should recognize when the value in question is one of the values in the field's controlled vocabulary. I think Dataverse does this if you use the SWORD API to create a dataset by importing a Dublin Core xml file that has dc.subject metadata with a value from Dataverse's subject vocabulary (if the term isn't in the subject vocabulary, Dataverse adds the term to Dataverse's keyword field instead).
The text was updated successfully, but these errors were encountered: