diff --git a/cds_migrator_kit/rdm/records/transform/config.py b/cds_migrator_kit/rdm/records/transform/config.py index 4d47c669..67e6416b 100644 --- a/cds_migrator_kit/rdm/records/transform/config.py +++ b/cds_migrator_kit/rdm/records/transform/config.py @@ -237,7 +237,11 @@ # 693__e values that are keywords rather than real experiments (curated as # "mots clef"), mapped to subjects instead of cern:experiments -EXPERIMENTS_AS_SUBJECTS = ["d3", "r104", "r105a"] +EXPERIMENTS_AS_SUBJECTS = ["d3", "r104", "r105a", "icarus cngs2", "condopt"] + +# 693__a values that are keywords rather than real accelerators, mapped to +# subjects instead of cern:accelerators +ACCELERATORS_AS_SUBJECTS = ["grenoble esfr"] # Legacy accelerator names remapped to vocabulary ids before lookup ACCELERATOR_ALIASES = { diff --git a/cds_migrator_kit/rdm/records/transform/mappers/custom_fields.py b/cds_migrator_kit/rdm/records/transform/mappers/custom_fields.py index 5ac1e338..19a03c2e 100644 --- a/cds_migrator_kit/rdm/records/transform/mappers/custom_fields.py +++ b/cds_migrator_kit/rdm/records/transform/mappers/custom_fields.py @@ -13,6 +13,7 @@ UnexpectedValue, ) from cds_migrator_kit.rdm.records.transform.config import ( + ACCELERATORS_AS_SUBJECTS, ACCELERATOR_ALIASES, EXPERIMENT_ALIASES, EXPERIMENTS_AS_SUBJECTS, @@ -173,6 +174,12 @@ def apply(self, ctx): accelerator = ACCELERATOR_ALIASES.get( accelerator.lower().strip(), accelerator ) + if accelerator.lower().strip() in ACCELERATORS_AS_SUBJECTS: + # curated as keywords, not real accelerators + ctx.dojson_entry.setdefault("subjects", []).append( + {"subject": accelerator} + ) + continue result = search_vocabulary(accelerator, "accelerators") if result and result not in accelerators_out: accelerators_out.append(result) diff --git a/cds_migrator_kit/rdm/records/transform/xml_processing/rules/base.py b/cds_migrator_kit/rdm/records/transform/xml_processing/rules/base.py index 708aafd1..f984b1c9 100644 --- a/cds_migrator_kit/rdm/records/transform/xml_processing/rules/base.py +++ b/cds_migrator_kit/rdm/records/transform/xml_processing/rules/base.py @@ -1004,6 +1004,10 @@ def related_identifiers_787(self, key, value): "relation_type": {"id": "isdocumentedby"}, "resource_type": {"id": "video"}, }, + "archives": { + "relation_type": {"id": "references"}, + "resource_type": {"id": "other"}, + }, } if recid: diff --git a/migration_cli/collections/at.yaml b/migration_cli/collections/at.yaml index 635800e9..69992f4a 100644 --- a/migration_cli/collections/at.yaml +++ b/migration_cli/collections/at.yaml @@ -1,9 +1,20 @@ name: at -queries: [] # TODO legacy queries of the collection (used by the legacy script only) +queries: + - q: '980:ARTICLE 710__5:NPA -710__5:LHC' + dump_file_prefix: NPA_articles + - q: '980:ARTICLE 710__5:AT -710__5:LHC' + dump_file_prefix: AT_articles + - q: '980:PREPRINT 710__5:NPA -710__5:LHC' + dump_file_prefix: NPA_preprints + - q: '980:PREPRINT 710__5:AT -710__5:LHC' + dump_file_prefix: AT_preprints + - q: '(980:ARTICLE OR 980:PREPRINT) 710:LHC (037__:CERN-LHC-9* OR 037__:CERN-LHC-20* OR 088__:CERN-LHC-9* OR 088__:CERN-LHC-20*) -980:NEUFACNOT' + dump_file_prefix: LHC_articles-preprints flags: restricted: false create_inclusion_request: true + preferred_model: at # slugs of the communities the records are added to, the same in every environment; # they must exist in the environment communities: - - TODO # slug of the community (local id was 2ebd631f-66c3-4891-b2dd-275ec3656b7b) + - at # slug of the community (local id was 2ebd631f-66c3-4891-b2dd-275ec3656b7b)