diff --git a/cds_migrator_kit/rdm/records/transform/config.py b/cds_migrator_kit/rdm/records/transform/config.py index 4d47c669..cde82a34 100644 --- a/cds_migrator_kit/rdm/records/transform/config.py +++ b/cds_migrator_kit/rdm/records/transform/config.py @@ -242,6 +242,7 @@ # Legacy accelerator names remapped to vocabulary ids before lookup ACCELERATOR_ALIASES = { "cern aa": "antiproton accumulator", + "lhc": "CERN LHC", } # Public research publication resource types that are auto-included in the CERN Research community. 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..c051a614 --- /dev/null +++ b/cds_migrator_kit/rdm/records/transform/models/moedal.py @@ -0,0 +1,42 @@ +# -*- 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__ + | { + "595_Da", # From SIS: these can be ignored + "595_Dd", # From SIS: these can be ignored + "595_Ds", # From SIS: these can be ignored + } + ) + + _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 3a58d4e0..f94ebc86 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 @@ -766,6 +766,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..21210a79 --- /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-collaboration \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index c75cff77..dd1a508f 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 eco = cds_migrator_kit.rdm.records.transform.models.eco:eco_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.eco = base = cds_migrator_kit.transform.xml_processing.rules.base base_records = cds_migrator_kit.rdm.records.transform.xml_processing.rules.base