Skip to content

Commit 49b3b5c

Browse files
committed
competency: allow for missing data when importing a map's knowledge.
1 parent 8a12116 commit 49b3b5c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tools/pg_import.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ def get_map_knowledge(map_uuid: str, competency_db: CompetencyDatabase) -> Knowl
103103
'id': path_id,
104104
'source': map_uuid,
105105
'label': annotations['label'],
106-
'long-label': descriptions[path_id],
106+
'long-label': descriptions.get(path_id, annotations['label']),
107107
'connectivity': path_knowledge['connectivity'],
108108
'taxons': annotations.get('taxons', []),
109-
'forward-connections': path_knowledge['forward-connections'],
110-
'node-phenotypes': path_knowledge['node-phenotypes'],
109+
'forward-connections': path_knowledge.get('forward-connections', []),
110+
'node-phenotypes': path_knowledge.get('node-phenotypes', {}),
111111
'nerves': path_knowledge.get('node-nerves', []),
112112
'phenotypes': path_phenotypes.get(path_id, []),
113113
'references': path_evidence.get(path_id, []),
@@ -126,7 +126,7 @@ def get_map_knowledge(map_uuid: str, competency_db: CompetencyDatabase) -> Knowl
126126
'id': feature_id,
127127
'source': map_uuid,
128128
'label': properties['label'],
129-
'long-label': descriptions[feature_id],
129+
'long-label': descriptions.get(feature_id, properties['label']),
130130
}
131131
if properties.get('type') == 'nerve':
132132
knowledge_terms[feature_id]['type'] = NERVE_TYPE

0 commit comments

Comments
 (0)