Skip to content

Commit

Permalink
Remap RDM to Lingo ETL #29
Browse files Browse the repository at this point in the history
  • Loading branch information
johnatawnclementawn committed Jul 1, 2024
1 parent 1882fad commit 9fbd8da
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions arches_lingo/etl_modules/migrate_to_lingo.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
SCHEMES_GRAPH_ID = uuid.UUID("56788995-423b-11ee-8a8d-11afefc4bff7")
CONCEPTS_GRAPH_ID = uuid.UUID("bf73e576-4888-11ee-8a8d-11afefc4bff7")
CONCEPTS_TOP_CONCEPT_OF_NODEGROUP_ID = uuid.UUID("bf73e5b9-4888-11ee-8a8d-11afefc4bff7")
CONCEPTS_BROADER_NODEGROUP_ID = uuid.UUID("bf73e5f5-4888-11ee-8a8d-11afefc4bff7")
CONCEPTS_BROADER_NODEGROUP_ID = uuid.UUID("f3f7bbea-0eb9-11ef-93db-0a58a9feac02")
CONCEPTS_PART_OF_SCHEME_NODEGROUP_ID = uuid.UUID("bf73e60a-4888-11ee-8a8d-11afefc4bff7")

details = {
Expand Down Expand Up @@ -62,16 +62,25 @@ def etl_schemes(self, cursor, nodegroup_lookup, node_lookup):
concept.pk
) # use old conceptid as new resourceinstanceid

name = {}
appellative_status = {}
identifier = {}
if (
value.valuetype_id == "prefLabel"
or value.valuetype_id == "altLabel"
):
name["name_content"] = value.value
name["name_language"] = value.language_id
name["name_type"] = value.valuetype_id
scheme_to_load["tile_data"].append({"name": name})
appellative_status["appellative_status_ascribed_name_content"] = (
value.value
)

appellative_status["appellative_status_ascribed_name_language"] = (
value.language_id
)
appellative_status["appellative_status_ascribed_relation"] = (
value.valuetype_id
)
scheme_to_load["tile_data"].append(
{"appellative_status": appellative_status}
)
elif value.valuetype_id == "identifier":
identifier["identifier_content"] = value.value
identifier["identifier_type"] = value.valuetype_id
Expand All @@ -90,16 +99,24 @@ def etl_concepts(self, cursor, nodegroup_lookup, node_lookup):
concept.pk
) # use old conceptid as new resourceinstanceid

name = {}
appellative_status = {}
identifier = {}
if (
value.valuetype_id == "prefLabel"
or value.valuetype_id == "altLabel"
):
name["name_content"] = value.value
name["name_language"] = value.language_id
name["name_type"] = value.valuetype_id
concept_to_load["tile_data"].append({"name": name})
appellative_status["appellative_status_ascribed_name_content"] = (
value.value
)
appellative_status["appellative_status_ascribed_name_language"] = (
value.language_id
)
appellative_status["appellative_status_ascribed_relation"] = (
value.valuetype_id
)
concept_to_load["tile_data"].append(
{"appellative_status": appellative_status}
)
elif value.valuetype_id == "identifier":
identifier["identifier_content"] = value.value
identifier["identifier_type"] = value.valuetype_id
Expand Down

0 comments on commit 9fbd8da

Please sign in to comment.