From 6bb3ab80fd2abdf371495f9ecc817c14a3a14423 Mon Sep 17 00:00:00 2001 From: richardbruskiewich Date: Thu, 22 Jun 2023 23:17:50 -0700 Subject: [PATCH] some predicates may not have an inverse --- reasoner_validator/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reasoner_validator/__init__.py b/reasoner_validator/__init__.py index 135af50..157f601 100644 --- a/reasoner_validator/__init__.py +++ b/reasoner_validator/__init__.py @@ -755,15 +755,15 @@ def case_input_found_in_response( bmt: Optional[Toolkit] = bmtw.get_bmt() predicate_descendants: List[str] - inverse_predicate_descendants: List[str] + inverse_predicate_descendants: List[str] = list() # may sometimes remain empty... if bmt is not None: predicate_descendants = bmt.get_descendants(predicate, formatted=True) inverse_predicate = bmtw.get_inverse_predicate(predicate) - inverse_predicate_descendants = bmt.get_descendants(inverse_predicate, formatted=True) + if inverse_predicate: + inverse_predicate_descendants = bmt.get_descendants(inverse_predicate, formatted=True) else: # simpler case in which we are ignoring deep Biolink Model validation predicate_descendants = [predicate] - inverse_predicate_descendants = list() edge_id_match: Optional[str] = None subject_match: Optional[str] = None