From 917f898fa3889b94dbf5ff05b16c78004b1fffad Mon Sep 17 00:00:00 2001 From: maxsibilla Date: Thu, 28 May 2026 14:16:20 -0400 Subject: [PATCH 1/2] Removing organoid from source check --- src/app.py | 9 ++++----- src/lib/title.py | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/app.py b/src/app.py index b609b5a6..7c65656b 100644 --- a/src/app.py +++ b/src/app.py @@ -1430,18 +1430,17 @@ def create_entity(entity_type: str, user_token: str, json_data_dict: dict, suppr if organ_code.upper() in ["FMA:57991", "FMA:57987"] and direct_ancestor_dict[ "source_type" ] not in [ - source_types.HUMAN, - source_types.HUMAN_ORGANOID, + source_types.HUMAN ]: abort_bad_req( - "The organ codes FMA:57991 and FMA:57987 are only valid for human and human organoid source type" + "The organ codes FMA:57991 and FMA:57987 are only valid for human source type" ) if organ_code.upper() in ["UBERON:0001911"] and direct_ancestor_dict[ "source_type" - ] not in [source_types.MOUSE, source_types.MOUSE_ORGANOID]: + ] not in [source_types.MOUSE]: abort_bad_req( - "The organ code UBERON:0001911 is only valid for mouse and mouse organoid source type" + "The organ code UBERON:0001911 is only valid for mouse source type" ) # Generate 'before_create_triiger' data and create the entity details in Neo4j diff --git a/src/lib/title.py b/src/lib/title.py index 0475a61b..5d30c1fa 100644 --- a/src/lib/title.py +++ b/src/lib/title.py @@ -64,8 +64,8 @@ def get_attributes_from_source_metadata(source_type: str, source_metadata: dict) source_grouping_concepts_dict = dict() source_types = Ontology.ops().source_types() - if source_type in [source_types.HUMAN, source_types.HUMAN_ORGANOID]: - # human and human organoid source + if source_type in [source_types.HUMAN]: + # human if "organ_donor_data" in source_metadata: source_metadata = source_metadata["organ_donor_data"] @@ -88,7 +88,7 @@ def get_attributes_from_source_metadata(source_type: str, source_metadata: dict) source_grouping_concepts_dict["sex"] = data["preferred_term"].lower() else: - # mouse and mouse organoid source, just pass through + # mouse source, just pass through source_grouping_concepts_dict = source_metadata return source_grouping_concepts_dict @@ -114,7 +114,7 @@ def get_source_data_phrase(source_type: str, source_data: dict) -> str: """ source_types = Ontology.ops().source_types() - if source_type in [source_types.HUMAN, source_types.HUMAN_ORGANOID]: + if source_type in [source_types.HUMAN]: # human and human organ age = source_data.get("age") age_units = source_data.get("age_units") @@ -138,7 +138,7 @@ def get_source_data_phrase(source_type: str, source_data: dict) -> str: else: return f"{age} {age_units}-old {race} {sex}" else: - # mouse and mouse organoid + # mouse parts = [] if strain := source_data.get("strain"): parts.append(strain) From 3dadc6146ea8929debc3997e8ace8b67dad8f592 Mon Sep 17 00:00:00 2001 From: maxsibilla Date: Thu, 28 May 2026 15:31:06 -0400 Subject: [PATCH 2/2] Correcting schema_neo4j_queries.get_entity_collections call to only return UUID --- src/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.py b/src/app.py index 7c65656b..862a42d5 100644 --- a/src/app.py +++ b/src/app.py @@ -6940,7 +6940,7 @@ def delete_cache(id): # If the target entity is Datasets/Publication, delete the associated Collections cache, Upload cache collection_uuids = schema_neo4j_queries.get_entity_collections( - neo4j_driver_instance, entity_uuid, "uuid" + neo4j_driver_instance, entity_uuid, property_key="uuid" ) collection_dict = schema_neo4j_queries.get_publication_associated_collection( neo4j_driver_instance, entity_uuid