The value of hierarchy_root_url couldn't be bulk-imported

Source concept hierarchy:

Root  Food
    C1 Vegitables
        C1.1 Greens
    C2 Fruits

The value of hierarchy_root_url in the my demo Source couldn’t be bulk-imported using the Bulk Import panel on the OCL Online.

In my json lines file:

"hierarchy_root_url": "/users/forest/sources/DemoFoods/concepts/Root/",

But it’s null in the download of the source metadata:

"hierarchy_root_url": null,

The child_concept_urls of the concept Root are also missing after bulk-import:

"child_concept_urls": [
		"/users/forest/sources/DemoFoods/concepts/C1/",
		"/users/forest/sources/DemoFoods/concepts/C2/"
	]

Meanwhile, the parent_concept_urls and child_concept_urls for the other concepts are OK.

This is a known bug, unfortunately. See JSON Bulk Import Gaps · Issue #856 · OpenConceptLab/ocl_issues · GitHub.

My current workaround is to use a PUT API call to apply a hierarchy_root_url to an existing source (which has already been imported via Bulk Import). Example below with the PUT statement and the body as JSON:

PUT https://api.openconceptlab.org/orgs/Regenstrief-Institute/sources/LOINC-3/

{"hierarchy_root_url": "/orgs/Regenstrief-Institute/sources/LOINC-3/concepts/ROOT/"}
1 Like

@jamlung Great! Thanks.

Hi, @jamlung . The key-value for hierarchy_root_url has been successfully added to my demo source with the workaround you suggested.

But how to add the following child_concept_urls to the concept Root ?

"child_concept_urls": [
		"/users/forest/sources/DemoFoods/concepts/C1/",
		"/users/forest/sources/DemoFoods/concepts/C2/"
	]

When the request has the body:

{
    "child_concept_urls": [
		"/users/forest/sources/DemoFoods/concepts/C1/",
		"/users/forest/sources/DemoFoods/concepts/C2/"
	]
}

The response is:

{
    "names": [
        "A concept must have at least one name"
    ]
}

If using the full import json line of the concept Root as the request body, the missing child_concept_urls also couldn’t be added although the response is 200 OK and returns the updated concept Root.


What’s next then?

Thanks.

Oops, I wrote this reply and forgot to submit it. :sweat_smile:

One potentially helpful tip here: OCL implies the child_concept_urls using the parent_concept_urls. If all of your child concepts have a parent_concept_urls, then OCL will auto-create the child_concept_urls.

Meaning, I only specify parent concept URLs in my bulk import files, not child concept URLs

1 Like

@jamlung , thanks a lot! Ah…I will check it out tomorrow.

This operation is not working, even leading to more parent-child relationships lost.
In addition, PUT or Patch operations for a Concept are also not able to add the parent-child relationships lost.

@jamlung
It was found that, when a concept id has a value “Root” or “TempRoot” (maybe other strings), it would lose its parent-child relationships, including parent_concept_urls and child_concept_urls. On a whim, the root concept id was tentatively changed from “Root” to “C”, the bulk import successfully completed and didn’t lose the parent-child relationships. Meanwhile, the temporary concept “TempRoot” still lost the expected parent-child relationships. Haha… So it seems that the bulk import process is a bit picky about the id string of the concept. Any rules about concept id value?

Perfect show :sweat_smile:

1 Like

@Sny Would there be any rule about the term “root” being part of the concept ID?

1 Like

@jamlung I dont think so

1 Like

Agree. Because I’ve searched the OCL github repo although I don’t actually understand the source codes completely yet. Thanks, @Sny .