@@ -29,6 +29,10 @@ class CohdTrapi150(CohdTrapi):
2929 supported_edge_types = ['biolink:positively_correlated_with' , 'biolink:negatively_correlated_with' ,
3030 'biolink:has_real_world_evidence_of_association_with' ]
3131
32+ # QNode set_interpretation values that COHD TRAPI does not support
33+ supported_set_interpretation = ['BATCH' ]
34+ unsupported_set_interpretation = list (set (['BATCH' , 'ALL' , 'MANY' ]) - set (supported_set_interpretation ))
35+
3236 # Biolink predicates that request positive associations only
3337 edge_types_positive = ['biolink:positively_correlated_with' ]
3438 default_positive_predicate = edge_types_positive [0 ]
@@ -568,8 +572,18 @@ def _interpret_query(self):
568572 self ._invalid_query_response = response , 200
569573 return self ._valid_query , self ._invalid_query_response
570574
575+ # If client specifies unsupported set_interpretation (ALL or MANY), respond with error code
576+ if concept_1_qnode .get ('set_interpretation' ) in CohdTrapi150 .unsupported_set_interpretation or \
577+ concept_2_qnode .get ('set_interpretation' ) in CohdTrapi150 .unsupported_set_interpretation :
578+ self ._valid_query = False
579+ description = f'{ CohdTrapi ._SERVICE_NAME } only supports QNode set_interpretation of { CohdTrapi150 .supported_set_interpretation } '
580+ self .log (description , TrapiStatusCode .UNSUPPORTED_SET_INTERPRETATION , logging .ERROR )
581+ response = self ._trapi_mini_response (TrapiStatusCode .UNSUPPORTED_SET_INTERPRETATION , description )
582+ self ._invalid_query_response = response , 200
583+ return self ._valid_query , self ._invalid_query_response
584+
571585 # Check to see if cohd doesn't recognize any properties
572- qnode_properties = {'ids' ,'categories' , 'is_set ' , 'constraints' }
586+ qnode_properties = {'ids' ,'categories' , 'set_interpretation ' , 'constraints' }
573587 qedge_properties = {'knowledge_type' , 'predicates' , 'subject' , 'object' , 'attribute_constraints' ,
574588 'qualifier_constraints' }
575589 sep = ', '
0 commit comments