eamena-project / eamena-arches-dev

development repository of the EAMENA Arches-powered database platform
https://eamena.org/home
GNU Affero General Public License v3.0
5 stars 3 forks source link

convert Thesauri to Concepts automatically #32

Open zoometh opened 1 year ago

zoometh commented 1 year ago

Description

In the RDM:

In both cases the UUID is 4550d0f3-24c2-4ada-9fbe-52e5974db973

In Postgres:

On the table concepts

select * from concepts
where legacyoid like 'https://database.eamena.org/concepts/4550d0f3-24c2-4ada-9fbe-52e5974db973'

Will give:

"4550d0f3-24c2-4ada-9fbe-52e5974db973"  "https://database.eamena.org/concepts/4550d0f3-24c2-4ada-9fbe-52e5974db973" "Concept"

On the table nodes, filtering on Cultural Period (en-US) (Collection) -> 2207326d-e72a-48f7-ae7b-6f223d555a7a

select name, datatype, fieldname, alias from nodes
where config ->> 'rdmCollection' LIKE '2207326d-e72a-48f7-ae7b-6f223d555a7a'

Will give:

"Cultural Period"   "concept"       "cultural_period"
"Cultural Period Type"  "concept"   "Period"    "cultural_period_type"

Solution

Insert new values in the table nodes (sql_command) using INSERT

column_name data_type sql_command
nodeid uuid gen_random_uuid () → uuid
name text name_of_the_concept
description text [null]
istopnode boolean false
ontologyclass text cidoc_crm_class
datatype text concept
graphid uuid uuid_of_the_RM
config jsonb { "rdmCollection": uuid_of_the_parent}
nodegroupid uuid ??
issearchable boolean ??
isrequired boolean ??
sortorder integer 0
fieldname text ??
exportable boolean ??
alias text ??
hascustomalias boolean false