Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate sssom validation to new LinkML validation framework #532

Merged
merged 14 commits into from
Jul 26, 2024
15 changes: 15 additions & 0 deletions tests/data/mondo-nando.sssom.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#curie_map:
# NANDO: "http://nanbyodata.jp/ontology/NANDO_"
# MONDO: "http://purl.obolibrary.org/obo/MONDO_"
# orcid: "https://orcid.org/"
#creator_id:
# - "orcid:0000-0003-0011-764X"
# - "orcid:0000-0002-0170-9172"
#license: "https://creativecommons.org/licenses/by/4.0/"
#mapping_set_title: "NANDO - Mondo mappings provided by nanbyodata.jp"
#mapping_set_description: "This mapping set is manually curated by the NANDO team at nanbyodata.jp."
#mapping_provider: "http://nanbyodata.jp"
subject_id subject_label predicate_id object_id object_label mapping_justification
NANDO:1100001 Neuromuscular disease skos:exactMatch MONDO:0019056 neuromuscular disease semapv:MappingCuration
NANDO:1100004 Immune system disease skos:exactMatch MONDO:0005046 immune system disorder semapv:MappingCuration
NANDO:2200355 Isolated ACTH deficiency skos:exactMatch MONDO:0008720|MONDO:0016042 semapv:MappingCuration
6 changes: 6 additions & 0 deletions tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def setUp(self) -> None:
"""Test up the test cases with the third basic example."""
self.correct_msdf1 = parse_sssom_table(f"{data_dir}/basic.tsv")
self.bad_msdf1 = parse_sssom_table(f"{data_dir}/bad_basic.tsv")
self.bad_nando = parse_sssom_table(f"{data_dir}/mondo-nando.sssom.tsv")
self.validation_types = DEFAULT_VALIDATION_TYPES
self.shacl_validation_types = [SchemaValidationType.Shacl]

Expand Down Expand Up @@ -75,3 +76,8 @@ def test_validate_sparql(self):
self.correct_msdf1,
self.shacl_validation_types,
)

def test_validate_nando(self):
"""Test Shacl validation (Not implemented)."""
self.assertIsNone(validate(self.bad_nando, self.validation_types))
self.assertRaises(ValidationError, validate, self.bad_nando, self.validation_types)
Loading