Accessing mandatory metadata fields through API

62 views
Skip to first unread message

Pablo Valério Polônia

unread,
Sep 18, 2025, 6:26:01 PMSep 18
to dataverse...@googlegroups.com
Hi all,

Is it possible to know, via API, which metadata fields are mandatory for a given Dataverse?

Context: In the plugin we developed for integration between OJS and Dataverse, we are considering only a minimum set of mandatory metadata (such as title, description, subject, etc.).

For instance, we had a case where the Related Publication Type field had been marked as mandatory, which prevented the plugin from completing the deposit of research data. This is just an example — in practice, any other customized mandatory field could generate the same issue.

Knowing which fields are mandatory would allow us to think of strategies to deal with them. 

Kind Regards,
Pablo
Lepidus

Philip Durbin

unread,
Sep 25, 2025, 10:17:37 AMSep 25
to dataverse...@googlegroups.com
Hi Pablo,

Good question. A field can be marked as required (the term we use instead of mandatory) globally or at the collection level.

For example, if you go to https://demo.dataverse.org/api/metadatablocks/citation you can see that "title" is required globally. Docs on this API call are here: https://guides.dataverse.org/en/6.7.1/api/native-api.html#show-info-about-all-metadata-blocks

Probably someone made Related Publication required for a certain collection. To check, please use this API call: https://guides.dataverse.org/en/6.7.1/api/native-api.html#list-metadata-blocks-defined-on-a-dataverse-collection 

I hope this helps. Please let me know if you have any questions!

Thanks,

Phil

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dataverse-community/CAMCDo-JUYqEjSBOVhVq8J7BjAogYOAC02eXo30j-n94NRFrCHA%40mail.gmail.com.


--

Pablo Valério Polônia

unread,
Oct 1, 2025, 5:49:08 PMOct 1
to dataverse...@googlegroups.com
Hi Phil,

Based on our tests, it seems we need to make the following requests to determine which metadata is required in a given collection:

1) Obtain the metadata blocks specific to that collection:
https://guides.dataverse.org/en/6.7.1/api/native-api.html#show-info-about-all-metadata-blocks

2) Iterate over each metadata block and check which fields are required:
For example: https://demo.dataverse.org/api/metadatablocks/citation

3) Obtain the metadata required globally by the repository:

The resource to be queried seems to be (/api/dataverses/$ID/inputLevels).:
https://guides.dataverse.org/en/6.7.1/api/native-api.html#id38

However, it only returns results if the collection does not inherit from the parent Dataverse.

For instance, here is a case where it returns an empty result:
https://demo.dataverse.org/api/dataverses/dataverseDeTestes/inputLevels

response:
{
  “status”: “OK”,
  “data”: []
}

Here is a case where it returns the complete metadata listing:
https://demo.dataverse.org/api/dataverses/reqFields/inputLevels

Excerpt from the response:
"
{
  “status”: “OK”,
  “data”: [{
    “datasetFieldTypeName”: “datasetContactAffiliation”,
    “required”: false,
    “include”: true
  }, {
...
"

How we can perform this query?

Would this approach work, or is there a simpler way?

Thanks,
Pablo

Philip Durbin

unread,
Oct 6, 2025, 4:33:35 PM (12 days ago) Oct 6
to dataverse...@googlegroups.com
Hi Pablo,

You're definitely more knowledable about how this works than I am!

When you ask "how we can perform this query?" are you asking how to know if a collection inherits metadata blocks from a parent or not? It sounds like you have a working method but it involves a call that might return empty result.

I hope this helps!

Phil

Pablo Valério Polônia

unread,
Oct 13, 2025, 3:50:37 PM (5 days ago) Oct 13
to dataverse...@googlegroups.com
Hi, Phil.

That delivers the information we need.

The steps would be:
1) Make a request for the desired collection and check whether the isMetadataBlockRoot property has the value false or whether the inputLevels property exists.
2) If not, make a request for the parent collection indicated in the isPartOf->identifier property.

Thanks!
Pablo


Reply all
Reply to author
Forward
0 new messages