diff --git a/docs/validation_codes_dictionary.md b/docs/validation_codes_dictionary.md index 4eff015..1466ebd 100644 --- a/docs/validation_codes_dictionary.md +++ b/docs/validation_codes_dictionary.md @@ -242,14 +242,6 @@ **Description:** Non-Biolink CURIEs are tolerated, but not preferred, as term value for the attribute_type_id properties of edge attributes. -### warning.knowledge_graph.edge.attribute.type_id.unknown_prefix - -**Message:** Edge has an attribute_type_id that has a CURIE prefix namespace unknown to Biolink - -**Context:** edge_id, identifier - -**Description:** The namespaces of 'attribute_type_id' terms may be incomplete with respect to Biolink Model version being used in the knowledge graph. - ### warning.knowledge_graph.edge.attribute.type_id.deprecated **Message:** Edge has a deprecated attribute_type_id diff --git a/reasoner_validator/biolink/__init__.py b/reasoner_validator/biolink/__init__.py index 7b9e74e..935eac4 100644 --- a/reasoner_validator/biolink/__init__.py +++ b/reasoner_validator/biolink/__init__.py @@ -571,20 +571,11 @@ def validate_attributes(self, edge_id: str, edge: Dict): infores == kp_source: found_kp_knowledge_source = True - # if not a Biolink association_slot, at least, - # check if it is an id prefix known to Biolink. - # We won't call it a hard error, but issue a warning - elif not self.bmt.get_element_by_prefix(prefix): + # if not a Biolink 'association_slot', at least, check if the 'attribute_type_id' has a + # namespace (prefix) known to Biolink. We won't call it a hard error, but issue a warning + elif not self.bmt.get_element_by_prefix(attribute_type_id): self.report( - code="warning.knowledge_graph.edge.attribute.type_id.unknown_prefix", - identifier=attribute_type_id, - edge_id=edge_id - ) - # TODO: probably need to take a closer look at validating outlier terms here - # Maybe enumerations will help - else: - self.report( - code="info.knowledge_graph.edge.attribute.type_id.non_biolink_prefix", + code="warning.knowledge_graph.edge.attribute.type_id.non_biolink_prefix", identifier=attribute_type_id, edge_id=edge_id ) diff --git a/reasoner_validator/codes.yaml b/reasoner_validator/codes.yaml index f61ab0d..3c9e406 100644 --- a/reasoner_validator/codes.yaml +++ b/reasoner_validator/codes.yaml @@ -213,12 +213,6 @@ warning: - edge_id - identifier $description: "Non-Biolink CURIEs are tolerated, but not preferred, as term value for the attribute_type_id properties of edge attributes." - unknown_prefix: - $message: "Edge has an attribute_type_id that has a CURIE prefix namespace unknown to Biolink" - $context: - - edge_id - - identifier - $description: "The namespaces of 'attribute_type_id' terms may be incomplete with respect to Biolink Model version being used in the knowledge graph." deprecated: $message: "Edge has a deprecated attribute_type_id" $context: diff --git a/tests/test_biolink_compliance_validation.py b/tests/test_biolink_compliance_validation.py index a1b28f8..c640596 100644 --- a/tests/test_biolink_compliance_validation.py +++ b/tests/test_biolink_compliance_validation.py @@ -1030,12 +1030,27 @@ def test_pre_trapi_1_4_0_validate_missing_or_empty_attributes(query: Tuple): "attributes": [] }, get_ara_test_case(), - # "Edge has empty attributes!" + # "Edge has empty attributes!" Allowed "" ), + ( + # Query 3. EDAM-DATA:2526 ought to have an acceptable namespace + { + "attributes": [ + { + "attribute_type_id": "EDAM-DATA:2526", + "value": "some-value" + } + ] + }, + get_ara_test_case(), + # "Edge has an acceptable namespace prefix + "" + ) + # CHEMBL.COMPOUND:CHEMBL112--biolink:occurs_together_in_literature_with->NCBIGene:762 ] ) -def test_post_1_4_0_trapi_validate_missing_or_empty_attributes(query: Tuple): +def test_post_1_4_0_trapi_validate_attributes(query: Tuple): validator = BiolinkValidator( graph_type=TRAPIGraphType.Knowledge_Graph, biolink_version=LATEST_BIOLINK_MODEL_VERSION, @@ -2686,8 +2701,7 @@ def test_validate_biolink_curie_in_qualifiers(query: Tuple[str, Dict, str]): }, # f"{KNOWLEDGE_GRAPH_PREFIX}: WARNING - Edge attribute_type_id 'foo:bar' " + # f"has a CURIE prefix namespace unknown to Biolink!" - # TODO: Code for validating this is commented out pending a BMT repair of the test - "warning.knowledge_graph.edge.attribute.type_id.unknown_prefix" + "warning.knowledge_graph.edge.attribute.type_id.non_biolink_prefix" ), ( # Query 26: # An earlier Biolink Model won't recognize a category not found in its specified release "1.8.2",