inveniosoftware / invenio-rdm-records

DataCite-based data model for InvenioRDM flavour.
https://invenio-rdm-records.readthedocs.io
MIT License
15 stars 87 forks source link

funders/awards data inconsistency #1301

Closed ppanero closed 1 year ago

ppanero commented 1 year ago

Funders and Awards are contrib vocabularies, thus they have a different data model. Specifically Awards are linked to funders:

In RMD-Records, both are joined in the funding attribute. A dummy representation would be:

funding: {
  funder: {
    id: funder-1,
  },
  award: {
     ...
     id: award-1,
     funder: funder-1,
   }
}

Both those fields are checked programmatically using system fields. This means, that when creating a record, it will check that the funder exists, and the award exists.

In the web UI, we filter awards by funder so the data sent would always be consistent. However, in the REST API it is up to the user and the following would be a valid (but it shouldn't) input data:

funding: {
  funder: {
    id: funder-1,
  },
  award: {
     ...
     id: award-2,
     funder: funder-2,
   }
}

Why?

This would require some customization in the system field to support dependencies between sysfield.

Extra: should use https://github.com/inveniosoftware/invenio-vocabularies/blob/master/invenio_vocabularies/contrib/awards/schema.py#L107 rather than FundingSchema

github-actions[bot] commented 1 year ago

This issue was automatically marked as stale.

slint commented 1 year ago

This has been fixed now in the migration ETL.