@@ -94,6 +94,7 @@ def get_map_knowledge(map_uuid: str, competency_db: CompetencyDatabase) -> Knowl
9494
9595 # Path features (i.e. those with connectivity)
9696 pathways = json_map_metadata (map_uuid , 'pathways' ).get ('paths' , {})
97+ nerve_terms = set ()
9798 for path_id , path_knowledge in pathways .items ():
9899 if 'connectivity' not in path_knowledge :
99100 continue
@@ -118,6 +119,7 @@ def get_map_knowledge(map_uuid: str, competency_db: CompetencyDatabase) -> Knowl
118119 knowledge_terms [path_id ]['biologicalSex' ] = properties ['biologicalSex' ]
119120 if 'pathDisconnected' in properties :
120121 knowledge_terms [path_id ]['pathDisconnected' ] = properties ['pathDisconnected' ]
122+ nerve_terms .update (term for node in knowledge_terms [path_id ]['nerves' ] for term in [node [0 ]] + node [1 ])
121123
122124 # Non-path features with an anatomical term
123125 for feature_id , properties in annotated_features .items ():
@@ -128,7 +130,7 @@ def get_map_knowledge(map_uuid: str, competency_db: CompetencyDatabase) -> Knowl
128130 'label' : properties ['label' ],
129131 'long-label' : descriptions .get (feature_id , properties ['label' ]),
130132 }
131- if properties .get ('type' ) == 'nerve' :
133+ if properties .get ('type' ) == 'nerve' or feature_id in nerve_terms :
132134 knowledge_terms [feature_id ]['type' ] = NERVE_TYPE
133135
134136 return KnowledgeList (KnowledgeSource (map_uuid , sckan_release , metadata ['name' ]), list (knowledge_terms .values ()))
0 commit comments