Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.4
1.10.5
2 changes: 1 addition & 1 deletion entity-api-spec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.0
info:
description: 'The SenNet Entity API is a standard RESTful web service with create, update and read operations for the standard SenNet provenance graph entities.'
version: 1.10.4
version: 1.10.5
title: SenNet Entity API
contact:
name: SenNet Help Desk
Expand Down
9 changes: 4 additions & 5 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/lib/title.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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
Expand All @@ -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")
Expand All @@ -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)
Expand Down
Loading