Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cds_migrator_kit/rdm/records/transform/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2022-2026 CERN.
Expand All @@ -13,6 +13,7 @@
UnexpectedValue,
)
from cds_migrator_kit.rdm.records.transform.config import (
ACCELERATORS_AS_SUBJECTS,
ACCELERATOR_ALIASES,
EXPERIMENT_ALIASES,
EXPERIMENTS_AS_SUBJECTS,
Expand Down Expand Up @@ -173,6 +174,12 @@
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 13 additions & 2 deletions migration_cli/collections/at.yaml
Original file line number Diff line number Diff line change
@@ -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)
Loading