django-daiquiri / daiquiri

A framework for the publication of scientific databases
https://escience.aip.de/daiquiri
Apache License 2.0
26 stars 8 forks source link

FEATURE: add the possibility to edit the relatedIdentifier (oai) with metadata interface. #76

Closed agy-why closed 3 years ago

agy-why commented 3 years ago

Datacite now contains a relatedIdentifer (see: #74) for the Tables. The latter is however set to be the DOI of the containing schema. It exists some cases where tables should not relate to their schema. ex: starhorse in gaiadr2_contrib should relate to gaiadr2.

It would be very useful to be able to edit the relatedIdentifier via some Json entry.

We have decided (@harenk, @jochenklar and @agy-why) that this field could be set via a metadata: relatedIdentifer. In the form of a JSON entry (like contributors).

It could also be useful to add the same feature for Schemas. Usecase would be to relate all data release to each other.

agy-why commented 3 years ago

After discussion we decided not to implement the front-end interface for this entry and only maintain the edition via REST API.

Therefore, after discussion with @jochenklar, there are just two places to edit:

agy-why commented 3 years ago

Note: since the model are changed a migration is necessary for deployment.

python manage.py migrate
python manage.py migrate --database=tap
python manage.py migrate --database=oai

Both OAI and tap are needed because rely on metadata

agy-why commented 3 years ago

After the mentioned modification the metadata are properly created in the database: public.daiquiri_metadata_table/schema

It is also visible via the REST API: http://0.0.0.0:9280/metadata/api/schemas/

however it does not appear in the yaml files returned fetch-metadata.py (daiquiri-tools) opened a new issue there: https://gitlab.aip.de/escience/daiquiri_tools/-/issues/70

agy-why commented 3 years ago

With such metadata:

related_identifiers = [{'related_identifier': '10.17876/gaia/edr.3',
                        'related_identifier_type': 'DOI',
                        'relation_type': 'IsPartOf'},
                        ...
]

This is how the datacite oai interface should deliver for: https://gaia.aip.del/oai/?verb=GetRecord&metadataPrefix=oai_datacite&identifier=oai:gaia.aip.de:10.17876/gaia/edr.3

<relatedIdentifiers>
    <relatedIdentifier relatedIdentifierType="DOI" relationType="IsPartOf">10.17876/gaia/edr.3</relatedIdentifier>
    ...
</relatedIdentifiers>
agy-why commented 3 years ago

This kind of JSON field can be easily integrated by adding a daiquiri.core.serializers.JSONListField in the DataciteSerializer (see: contributors and creators for examples) in https://github.com/django-daiquiri/daiquiri/blob/master/daiquiri/metadata/serializers/datacite.py

agy-why commented 3 years ago

PR: #77

agy-why commented 3 years ago

according to: https://schema.datacite.org/meta/kernel-4.3/doc/DataCite-MetadataKernel_v4.3.pdf

Possible values for relatedIdentifierType:

Possible values for relationType:

agy-why commented 3 years ago

Done with: #77