Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert Thesauri to Concepts automatically #32

Open
zoometh opened this issue Jul 27, 2023 · 0 comments
Open

convert Thesauri to Concepts automatically #32

zoometh opened this issue Jul 27, 2023 · 0 comments

Comments

@zoometh
Copy link
Member

zoometh commented Jul 27, 2023

Description

In the RDM:

  • Thesauri : Bronze Age (Arabia) (en-US) (Concept) -> https://database.eamena.org/concepts/4550d0f3-24c2-4ada-9fbe-52e5974db973

    • child of EAMENA (en-US) (ConceptScheme) -> https://database.eamena.org/concepts/4a98075d-815f-327b-be0e-518b32f7623b
  • Concepts : Bronze Age (Arabia) (en-US) (Concept) -> 4550d0f3-24c2-4ada-9fbe-52e5974db973

    • child of Cultural Period (en-US) (Collection) -> 2207326d-e72a-48f7-ae7b-6f223d555a7a

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant