hubmapconsortium / entity-api

A set of web service calls to return information about HuBMAP entities
https://entity.api.hubmapconsortium.org
MIT License
3 stars 1 forks source link

Synchronize Component Dataset status value with associated Primary Multi-Assay dataset #644

Closed shirey closed 2 months ago

shirey commented 3 months ago

At entity PUT, if the status of a Multi-Assay dataset is changed change the status of any Component datasets that are associated with the main Multi-Assay dataset.

shirey commented 3 months ago

I've tested this on TEST and everything seems to be in order. When releasing we'll need to run the following to synchronize any existing data:

//collect uuids of datasets that will need to be reindexed (all uuids that are outputs of the following two queries):
match (s:Sample)-[:ACTIVITY_INPUT]->(:Activity)-[:ACTIVITY_OUTPUT]->(ds:Dataset)-[:ACTIVITY_INPUT]->(:Activity {creation_action:'Multi-Assay Split'})-[:ACTIVITY_OUTPUT]->(comp:Dataset) return distinct comp.uuid;
match (s:Sample)-[:ACTIVITY_INPUT]->(:Activity)-[:ACTIVITY_OUTPUT]->(ds:Dataset)-[:ACTIVITY_INPUT]->(:Activity {creation_action:'Multi-Assay Split'})-[:ACTIVITY_OUTPUT]->(comp:Dataset) return distinct ds.uuid;

//synchronize the component dataset statuses with their multi-assay parents.
match (s:Sample)-[:ACTIVITY_INPUT]->(:Activity)-[:ACTIVITY_OUTPUT]->(ds:Dataset)-[:ACTIVITY_INPUT]->(:Activity {creation_action:'Multi-Assay Split'})-[:ACTIVITY_OUTPUT]->(comp:Dataset) set comp.status = ds.status;

//then reindex