-
Notifications
You must be signed in to change notification settings - Fork 494
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
Native API: What fields are required for dataset creation #3060
Comments
@leeper I'm glad you opened this issue because @raprasad and I have been discussing this a lot this past week, especially in light of his recent experiments at https://github.com/IQSS/json-schema-test http://guides.dataverse.org/en/4.3/api/native-api.html says, "Example json can be found at data/dataset-create-new.json" but doesn't provide a link. Since I'm familiar with the code I know that probably what is meant is https://github.com/IQSS/dataverse/blob/v4.3/scripts/api/data/dataset-create-new.json but at minimum we should make this a link so API users don't need to go hunting for this file. You're right that these JSON files are quite extensive. They were born out of need to serialize datasets in #422 so we could drop a database on a demo site and repopulate it with the JSON files. For this reason, the JSON sort of looks like a backup with lots of internal information about "primitive" and "compound" that API users probably don't care about. I've been saying to @raprasad that I can imagine a (future) world where the JSON used to create datasets is much smaller and focused. As far as which fields are mandatory, we do a better job of documenting this for the SWORD API, as @posixeleni points out. Look for for "Y" in the "Required" column at http://guides.dataverse.org/en/4.3/api/sword.html#dublin-core-terms-dc-terms-qualified-mapping-dataverse-db-element-crosswalk . Technically, "Subject" is not required because we fill in "N/A" (for backward compatibility) as explained at http://guides.dataverse.org/en/4.3/api/sword.html#new-features-as-of-v1-1 Unfortunately, the native API doesn't document which fields are mandatory. I guess for now you can try making the JSON smaller and smaller and see when it breaks. You could also try creating datasets in the GUI to get a sense of what's required. I agree that we need to document this. Ideally, you'd even be able to query the system and have it tell you which fields are required. |
Thanks, @posixeleni and @pdurbin. Yup, doing the same for the native API as is present for the SWORD API would be awesome. I'll start paring down the requests and see what breaks (and post what I find here). |
@leeper hi, I just posted a long JSON file at #3859 (comment) that contains nearly all the metadata fields available out of the box: I say nearly all because @jggautier pointed out that it's missing "Language" and "topic classification" at https://groups.google.com/d/msg/dataverse-community/qsY8swD9Hh0/BVNNyVqaAgAJ I'm thinking we should clean up the file a bit and add it to the API Guide, saying, "Here's a JSON file that populates the complete set of metadata fields available out of the box." Something like that. Right now, it's hard to figure out what JSON Dataverse wants, leading to issues like #3859. |
Philip - I just came here, looking for the Native API dataset-create-new.json, which is mentioned on the Native API page, but is lacking a link. I found that you provided the link here. Who should I talk to, in order for that page to be changed, to provide the link? So that other people don't have to search for it also? Thanks! - Mark https://github.com/IQSS/dataverse/blob/v4.3/scripts/api/data/dataset-create-new.json |
@markrlondon would you be interested in making a pull request? We document the process here: http://guides.dataverse.org/en/4.7.1/developers/version-control.html#how-to-make-a-pull-request |
@markrlondon hi! I just made pull request #6107 and tried to explain which field are required to create a dataset. Here's what I wrote: Is this sufficient to close this issue from your perspective? @leeper hi! I'd be happy to get your take as well. 😄 |
I'm thinking we should close this issue in favor of this one: |
I'm looking at this example file for dataset creation via the API: https://github.com/IQSS/dataverse/blob/master/scripts/api/data/dataset-create-new3.json. It's quite extensive. Currently the R client just requires end-users to know what is required and what is not (something I don't actually know) so they can make their own similar file, but I would like to be able facilitate this a bit (issue here: IQSS/dataverse-client-r#3) to make things easier.
Is there documentation somewhere of what fields are mandatory? If not, could this be added to the API docs?
The text was updated successfully, but these errors were encountered: