diff --git a/cds_migrator_kit/rdm/records/transform/models/moedal.py b/cds_migrator_kit/rdm/records/transform/models/moedal.py new file mode 100644 index 00000000..fbd58e20 --- /dev/null +++ b/cds_migrator_kit/rdm/records/transform/models/moedal.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2026 CERN. +# +# CDS-RDM is free software; you can redistribute it and/or modify it under +# the terms of the MIT License; see LICENSE file for more details. + +"""CDS-RDM MoEDAL model.""" + +from cds_migrator_kit.rdm.collection_conf import conf_query +from cds_migrator_kit.rdm.records.transform.models._config import IGNORE_SYSTEM_KEYS +from cds_migrator_kit.rdm.records.transform.models.base_publication_record import ( + rdm_base_publication_model, +) +from cds_migrator_kit.rdm.records.transform.models.research import ResearchModel +from cds_migrator_kit.transform.overdo import CdsOverdo + + +class MoEDALModel(CdsOverdo): + """Translation model for MoEDAL.""" + + __query__ = conf_query("moedal") + + __ignore_keys__ = IGNORE_SYSTEM_KEYS | ResearchModel.__ignore_keys__ + + _default_fields = { + "custom_fields": {}, + } + + +moedal_model = MoEDALModel( + bases=(rdm_base_publication_model,), + entry_point_group="cds_migrator_kit.migrator.rules.moedal", +) diff --git a/cds_migrator_kit/rdm/records/transform/xml_processing/rules/research.py b/cds_migrator_kit/rdm/records/transform/xml_processing/rules/research.py index 5279d9a1..f76cc11e 100644 --- a/cds_migrator_kit/rdm/records/transform/xml_processing/rules/research.py +++ b/cds_migrator_kit/rdm/records/transform/xml_processing/rules/research.py @@ -779,6 +779,8 @@ def resource_type(self, key, value): "technical note": {"id": "publication-technicalnote"}, "minutes": {"id": "publication-meetingminutes"}, "presentation": {"id": "presentation"}, + "moedal_internal_notes": {"id": "publication-technicalnote"}, + "moedal_notes": {"id": "publication-technicalnote"}, } try: diff --git a/migration_cli/collections/moedal.yaml b/migration_cli/collections/moedal.yaml new file mode 100644 index 00000000..5f2f029a --- /dev/null +++ b/migration_cli/collections/moedal.yaml @@ -0,0 +1,11 @@ +name: moedal +queries: + - q: '980__a:PREPRINT AND 693__e:MoEDAL OR 980__a:ARTICLE AND 693__e:MoEDAL OR 980:MoEDAL_NOTES OR 980:MoEDAL_INTERNAL_NOTES' + dump_file_prefix: moedal +flags: + include_plots: true + create_inclusion_request: true + preferred_model: moedal +# These community slugs must exist in the target environment. +communities: + - moedal \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 793dcadc..bec76fc2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -111,6 +111,7 @@ cds_migrator_kit.migrator.models = isolde = cds_migrator_kit.rdm.records.transform.models.isolde:isolde_model north_area = cds_migrator_kit.rdm.records.transform.models.north_area:north_area_model hie_isolde = cds_migrator_kit.rdm.records.transform.models.hie_isolde:hie_isolde_model + moedal = cds_migrator_kit.rdm.records.transform.models.moedal:moedal_model cds_migrator_kit.migrator.rules.base = base = cds_migrator_kit.transform.xml_processing.rules.base @@ -257,6 +258,10 @@ cds_migrator_kit.migrator.rules.hie_isolde = base = cds_migrator_kit.transform.xml_processing.rules.base base_records = cds_migrator_kit.rdm.records.transform.xml_processing.rules.base publication = cds_migrator_kit.rdm.records.transform.xml_processing.rules.research +cds_migrator_kit.migrator.rules.moedal = + base = cds_migrator_kit.transform.xml_processing.rules.base + base_records = cds_migrator_kit.rdm.records.transform.xml_processing.rules.base + publication = cds_migrator_kit.rdm.records.transform.xml_processing.rules.research cds_migrator_kit.migrator.rules.people = people = cds_migrator_kit.rdm.users.transform.xml_processing.rules.people invenio_pidstore.minters =