From d306b45aba24fb69603d9c9cce276fbd02761380 Mon Sep 17 00:00:00 2001 From: Eric Prud'hommeaux Date: Sun, 11 Oct 2026 00:20:50 -0500 Subject: [PATCH] Disable network tests whose endpoints or data are gone; fix is_up With SKIP_EXTERNAL_URLS off, five tests failed against external services: - test_named_graph_types: graphdb.dumontierlab.com ncats-red-kg returns 502 - test_infer_setting: graph.fhircat.org has no fhirontology repository and no Patient/pat4 in any remaining repository - test_observation_online: hl7.org dropped the haplotype2 example after R4; the R4/R4B/STU3 ShEx references undefined fhirpath shapes or won't parse - test_wikidata_reactome, test_diseases: live Wikidata no longer fits the 2018/2019 schemas; shex.js agrees with PyShEx on the saved snapshots is_up() treated any HTTP response, including 502 and 404, as up, and is_down_reason() named the last pre-cached server instead of its argument. Also restores the Wikidata disease snapshots that c6ac2dc (#113) accidentally committed after a local network test run overwrote them. Co-Authored-By: Claude Opus 5.5 --- tests/test_cli/test_sparql_options.py | 2 ++ .../data/wikidata/disease/Q102295546.ttl | 11 +------ .../data/wikidata/disease/Q1355765.ttl | 6 +--- .../data/wikidata/disease/Q1361850.ttl | 27 +++++++--------- .../data/wikidata/disease/Q18553423.ttl | 9 +----- .../data/wikidata/disease/Q18553561.ttl | 30 ++++++------------ .../data/wikidata/disease/Q18553807.ttl | 20 +++++------- .../data/wikidata/disease/Q18554592.ttl | 31 +++++++------------ .../data/wikidata/disease/Q19833018.ttl | 17 ++-------- tests/test_issues/test_diseases.py | 3 ++ tests/test_issues/test_fhir.py | 3 ++ tests/test_issues/test_reactome.py | 3 ++ tests/utils/web_server_utils.py | 9 +++--- 13 files changed, 62 insertions(+), 109 deletions(-) diff --git a/tests/test_cli/test_sparql_options.py b/tests/test_cli/test_sparql_options.py index 2cfdde1..19ff6c6 100644 --- a/tests/test_cli/test_sparql_options.py +++ b/tests/test_cli/test_sparql_options.py @@ -65,6 +65,7 @@ def test_named_graph(self): self.do_test([DRUGBANK_SPARQL_URL, shex, '-sq', sparql, '-ps', '-gn', graphid, '-pr'], 'dbsparql5', failexpected=True, text_filter=elapsed_filter) + @pytest.mark.skip(reason="graphdb.dumontierlab.com ncats-red-kg repository is gone (502 since at least 2026-10)") @skip_dumontier def test_named_graph_types(self): """Test a Drugbank query with named graph in the query.""" @@ -73,6 +74,7 @@ def test_named_graph_types(self): 'select ?item where{?item a } LIMIT 20'], 'dbsparql6', failexpected=True, text_filter=elapsed_filter) + @pytest.mark.skip(reason="graph.fhircat.org no longer has the fhirontology repository or Patient/pat4 (2026-10)") @skip_fhircat def test_infer_setting(self): """Test setting infer to False.""" diff --git a/tests/test_issues/data/wikidata/disease/Q102295546.ttl b/tests/test_issues/data/wikidata/disease/Q102295546.ttl index cf4df6c..702bcf0 100644 --- a/tests/test_issues/data/wikidata/disease/Q102295546.ttl +++ b/tests/test_issues/data/wikidata/disease/Q102295546.ttl @@ -2,7 +2,6 @@ @prefix ns1: . @prefix ns2: . @prefix p: . -@prefix prov: . @prefix ps: . @prefix rdfs: . @prefix schema1: . @@ -11,7 +10,7 @@ @prefix xsd: . wd:Q102295546 rdfs:label "GNE myopathy" ; - schema1:dateModified "2023-09-27T04:33:33Z"^^xsd:dateTime ; + schema1:dateModified "2023-09-27T04:33:33+00:00"^^xsd:dateTime ; schema1:description "human disease", "хвороба людини" ; schema1:version 1982386654 ; @@ -38,13 +37,5 @@ wd:Q102295546 rdfs:label "GNE myopathy" ; wdt:P492 "605820" ; wdt:P699 "DOID:0080718" . - prov:wasDerivedFrom ; - ps:P279 wd:Q692536 . - ps:P31 wd:Q112193867 . - ps:P492 "605820" . - - prov:wasDerivedFrom ; - ps:P279 wd:Q10267817 . - diff --git a/tests/test_issues/data/wikidata/disease/Q1355765.ttl b/tests/test_issues/data/wikidata/disease/Q1355765.ttl index 859d3bf..a47ec2e 100644 --- a/tests/test_issues/data/wikidata/disease/Q1355765.ttl +++ b/tests/test_issues/data/wikidata/disease/Q1355765.ttl @@ -2,7 +2,6 @@ @prefix ns1: . @prefix ns2: . @prefix p: . -@prefix prov: . @prefix ps: . @prefix rdfs: . @prefix schema1: . @@ -15,7 +14,7 @@ wd:Q1355765 rdfs:label "Schaf- und Ziegenbrucellose", "brucellose som skuldast Brucella melitensis", "brucellose à Brucella melitensis", "ovine and caprine brucellosis" ; - schema1:dateModified "2025-02-04T08:57:17Z"^^xsd:dateTime ; + schema1:dateModified "2025-02-04T08:57:17+00:00"^^xsd:dateTime ; schema1:description "Deckseuche von Ziegen und Schafen", "brucellosis that involves an infection caused by Brucella melitensis [NCBITaxon:29459] in cattle, goats, sheep and humans. The disease has symptom fever, has symptom malaise, has symptom anorexia, has symptom limb pain and has symptom back pain" ; schema1:version 2306702134 ; @@ -60,6 +59,3 @@ wd:Q1355765 rdfs:label "Schaf- und Ziegenbrucellose", ps:P31 wd:Q112193867 . - prov:wasDerivedFrom ; - ps:P279 wd:Q156050 . - diff --git a/tests/test_issues/data/wikidata/disease/Q1361850.ttl b/tests/test_issues/data/wikidata/disease/Q1361850.ttl index 9bf1573..b2d1671 100644 --- a/tests/test_issues/data/wikidata/disease/Q1361850.ttl +++ b/tests/test_issues/data/wikidata/disease/Q1361850.ttl @@ -2,7 +2,6 @@ @prefix ns1: . @prefix ns2: . @prefix p: . -@prefix prov: . @prefix ps: . @prefix rdfs: . @prefix schema1: . @@ -14,10 +13,10 @@ wd:Q1361850 rdfs:label "Disfunção da tuba auditiva", "Trompa de Eustaquio patulosa", "béance tubaire", - "disfunção da tuba auditiva", "klaffende Tube", "patulous eustachian tube", "tuba aperta", + "tuba auditiva patulosa", "tuba beante", "ziejąca trąbka słuchowa", "Τυμπανοπνευμονία", @@ -25,16 +24,16 @@ wd:Q1361850 rdfs:label "Disfunção da tuba auditiva", "耳咽管開放症", "耳管開放症", "이관개방증" ; - schema1:dateModified "2026-07-03T13:12:57Z"^^xsd:dateTime ; + schema1:dateModified "2024-09-22T03:26:47+00:00"^^xsd:dateTime ; schema1:description "Krankheit", - "condition in which the auditory tube remains abnormally open, causing autophony and auditory discomfort", "condição em que a tuba auditiva fica anormalmente aberta, causando autofonia e desconforto auditivo", "disfunzione della tromba di Eustachio, il condotto virtuale che collega l'orecchio medio alla faringe che rimane aperto", "dysfunkcja trąbki Eustachiusza", "enfermedad del oído", + "eustachian tube disorder", "maladie rare où la trompe d'Eustache, au lieu de rester normalement fermée, s'ouvre involontairement par intermittence", "хвороба" ; - schema1:version 2513435222 ; + schema1:version 2251395007 ; ns2:identifiers 13 ; ns2:sitelinks 12 ; ns2:statements 27 ; @@ -44,7 +43,6 @@ wd:Q1361850 rdfs:label "Disfunção da tuba auditiva", "Trompa de Eustaquio distendida", "Trompa patulosa", "erweiterte Tuba auditiva", - "eustachian tube disorder", "eustachian tube dysfunction", "offene Tube", "open buis van Eustachius", @@ -54,13 +52,13 @@ wd:Q1361850 rdfs:label "Disfunção da tuba auditiva", p:P1692 ; p:P1995 ; p:P2579 ; - p:P279 , - ; + p:P279 ; p:P2888 , ; p:P2892 ; p:P31 , - ; + , + ; p:P3984 ; p:P4229 , ; @@ -84,12 +82,12 @@ wd:Q1361850 rdfs:label "Disfunção da tuba auditiva", wdt:P1692 "381.7" ; wdt:P1995 wd:Q189553 ; wdt:P2579 wd:Q569965 ; - wdt:P279 wd:Q1644260, - wd:Q18558207 ; + wdt:P279 wd:Q18558207 ; wdt:P2888 , do:12358 ; wdt:P2892 "C0155434" ; wdt:P31 wd:Q112193867, + wd:Q1644260, wd:Q7189713 ; wdt:P3984 "PatulousTubes" ; wdt:P4229 "H69.0", @@ -109,10 +107,7 @@ wd:Q1361850 rdfs:label "Disfunção da tuba auditiva", ps:P31 wd:Q7189713 . - ps:P279 wd:Q1644260 . - - prov:wasDerivedFrom ; - ps:P279 wd:Q18558207 . - ps:P31 wd:Q112193867 . + ps:P31 wd:Q1644260 . + diff --git a/tests/test_issues/data/wikidata/disease/Q18553423.ttl b/tests/test_issues/data/wikidata/disease/Q18553423.ttl index 3d635b4..6128bd2 100644 --- a/tests/test_issues/data/wikidata/disease/Q18553423.ttl +++ b/tests/test_issues/data/wikidata/disease/Q18553423.ttl @@ -2,7 +2,6 @@ @prefix ns1: . @prefix ns2: . @prefix p: . -@prefix prov: . @prefix ps: . @prefix rdfs: . @prefix schema1: . @@ -17,7 +16,7 @@ wd:Q18553423 rdfs:label "motnja presnove vitaminov", "trouble du métabolisme des vitamines", "vitamin metabolic disorder", "vitamino-metabola malsano" ; - schema1:dateModified "2024-02-25T21:26:59Z"^^xsd:dateTime ; + schema1:dateModified "2024-02-25T21:26:59+00:00"^^xsd:dateTime ; schema1:description "Krankheit", "inherited metabolic disorder resulting from a deficiency in vitamin or vitamin cofactor transport or metabolism", "хвороба" ; @@ -51,11 +50,5 @@ wd:Q18553423 rdfs:label "motnja presnove vitaminov", wdt:P5270 "MONDO_0005528" ; wdt:P699 "DOID:0050718" . - prov:wasDerivedFrom ; - ps:P279 wd:Q194435 . - - prov:wasDerivedFrom ; - ps:P279 wd:Q1758393 . - ps:P31 wd:Q112193867 . diff --git a/tests/test_issues/data/wikidata/disease/Q18553561.ttl b/tests/test_issues/data/wikidata/disease/Q18553561.ttl index a980241..d89b159 100644 --- a/tests/test_issues/data/wikidata/disease/Q18553561.ttl +++ b/tests/test_issues/data/wikidata/disease/Q18553561.ttl @@ -1,8 +1,7 @@ @prefix do: . -@prefix ns1: . -@prefix ns2: . +@prefix ns1: . +@prefix ns2: . @prefix p: . -@prefix prov: . @prefix ps: . @prefix rdfs: . @prefix schema1: . @@ -15,15 +14,15 @@ wd:Q18553561 rdfs:label "carcinome vaginal", "vagina karcinomo", "vaginal carcinoma", "vaginalni karcinom" ; - schema1:dateModified "2026-10-08T11:11:44Z"^^xsd:dateTime ; + schema1:dateModified "2025-10-24T10:12:36+00:00"^^xsd:dateTime ; schema1:description "Krankheit", "maladie", "vaginal cancer that has material basis in epithelial cells", "хвороба" ; - schema1:version 2554999564 ; - ns1:identifiers 6 ; - ns1:sitelinks 0 ; - ns1:statements 15 ; + schema1:version 2421203039 ; + ns2:identifiers 6 ; + ns2:sitelinks 1 ; + ns2:statements 15 ; skos:altLabel "Cancer of Vagina", "Cancer of the Vagina", "Carcinoma of Vagina", @@ -51,9 +50,9 @@ wd:Q18553561 rdfs:label "carcinome vaginal", p:P5008 ; p:P5270 ; p:P699 ; - ns2:P2671 ; - ns2:P5270 ; - ns2:P699 ; + ns1:P2671 ; + ns1:P5270 ; + ns1:P699 ; wdt:P1550 "180247" ; wdt:P1748 "C3917" ; wdt:P2671 "/g/11j86wfvys" ; @@ -72,12 +71,3 @@ wd:Q18553561 rdfs:label "carcinome vaginal", ps:P31 wd:Q112193867 . - prov:wasDerivedFrom ; - ps:P279 wd:Q55785788 . - - prov:wasDerivedFrom ; - ps:P279 wd:Q1807522 . - - prov:wasDerivedFrom ; - ps:P279 wd:Q33525 . - diff --git a/tests/test_issues/data/wikidata/disease/Q18553807.ttl b/tests/test_issues/data/wikidata/disease/Q18553807.ttl index b950437..213ee40 100644 --- a/tests/test_issues/data/wikidata/disease/Q18553807.ttl +++ b/tests/test_issues/data/wikidata/disease/Q18553807.ttl @@ -1,8 +1,7 @@ @prefix do: . -@prefix ns1: . -@prefix ns2: . +@prefix ns1: . +@prefix ns2: . @prefix p: . -@prefix prov: . @prefix ps: . @prefix rdfs: . @prefix schema1: . @@ -12,16 +11,16 @@ @prefix xsd: . wd:Q18553807 rdfs:label "classic type lipoma" ; - schema1:dateModified "2024-02-08T20:30:14Z"^^xsd:dateTime ; + schema1:dateModified "2024-02-08T20:30:14+00:00"^^xsd:dateTime ; schema1:description "Human disease", "Krankheit", "хвороба людини", "մարդու հիվանդություն", "مرض يصيب الإنسان" ; schema1:version 2072165306 ; - ns2:identifiers 3 ; - ns2:sitelinks 0 ; - ns2:statements 9 ; + ns1:identifiers 3 ; + ns1:sitelinks 0 ; + ns1:statements 9 ; skos:altLabel "Classic Type Lipoma", "Conventional Lipoma" ; p:P1748 ; @@ -33,8 +32,8 @@ wd:Q18553807 rdfs:label "classic type lipoma" ; p:P5008 ; p:P5270 ; p:P699 ; - ns1:P5270 ; - ns1:P699 ; + ns2:P5270 ; + ns2:P699 ; wdt:P1748 "C27530" ; wdt:P279 wd:Q689985 ; wdt:P2888 , @@ -45,8 +44,5 @@ wd:Q18553807 rdfs:label "classic type lipoma" ; wdt:P5270 "MONDO_0000967" ; wdt:P699 "DOID:10193" . - prov:wasDerivedFrom ; - ps:P279 wd:Q689985 . - ps:P31 wd:Q112193867 . diff --git a/tests/test_issues/data/wikidata/disease/Q18554592.ttl b/tests/test_issues/data/wikidata/disease/Q18554592.ttl index a52dc89..993345d 100644 --- a/tests/test_issues/data/wikidata/disease/Q18554592.ttl +++ b/tests/test_issues/data/wikidata/disease/Q18554592.ttl @@ -1,8 +1,7 @@ @prefix do: . -@prefix ns1: . -@prefix ns2: . +@prefix ns1: . +@prefix ns2: . @prefix p: . -@prefix prov: . @prefix ps: . @prefix rdfs: . @prefix schema1: . @@ -15,14 +14,14 @@ wd:Q18554592 rdfs:label "lipoma de la médula espinal", "lipome de la colonne vertébrale", "spinal cord lipoma", "spinales Lipom" ; - schema1:dateModified "2026-07-05T12:52:44Z"^^xsd:dateTime ; + schema1:dateModified "2024-02-25T21:33:43+00:00"^^xsd:dateTime ; schema1:description "Krankheit", "central nervous system lipoma that is characterized by abnormal fat accumulation in and around the spinal cord", "хвороба" ; - schema1:version 2514126450 ; - ns1:identifiers 3 ; - ns1:sitelinks 1 ; - ns1:statements 14 ; + schema1:version 2087206552 ; + ns2:identifiers 3 ; + ns2:sitelinks 1 ; + ns2:statements 14 ; skos:altLabel "Lipoma of spinal cord", "Lipoma of spinal cord (disorder)", "Spinal Cord Lipoma", @@ -42,11 +41,13 @@ wd:Q18554592 rdfs:label "lipoma de la médula espinal", p:P5270 ; p:P699 ; p:P927 ; - ns2:P5270 ; - ns2:P699 ; + ns1:P5270 ; + ns1:P699 ; wdt:P1692 "214.8" ; wdt:P1748 "C4619" ; wdt:P279 wd:Q18557209, + wd:Q2303951, + wd:Q689985, wd:Q7577474 ; wdt:P2888 , do:13743 ; @@ -57,15 +58,5 @@ wd:Q18554592 rdfs:label "lipoma de la médula espinal", wdt:P699 "DOID:13743" ; wdt:P927 wd:Q9606 . - prov:wasDerivedFrom ; - ps:P279 wd:Q2303951 . - - ps:P279 wd:Q7577474 . - ps:P31 wd:Q112193867 . - prov:wasDerivedFrom ; - ps:P279 wd:Q18557209 . - - ps:P279 wd:Q689985 . - diff --git a/tests/test_issues/data/wikidata/disease/Q19833018.ttl b/tests/test_issues/data/wikidata/disease/Q19833018.ttl index 4bfe1c5..a5c0982 100644 --- a/tests/test_issues/data/wikidata/disease/Q19833018.ttl +++ b/tests/test_issues/data/wikidata/disease/Q19833018.ttl @@ -2,7 +2,6 @@ @prefix ns1: . @prefix ns2: . @prefix p: . -@prefix prov: . @prefix ps: . @prefix rdfs: . @prefix schema1: . @@ -13,11 +12,11 @@ wd:Q19833018 rdfs:label "anémie sidéroblastique autosomique dominante", "autosomal dominant sideroblastic anemia" ; - schema1:dateModified "2026-07-05T12:33:18Z"^^xsd:dateTime ; + schema1:dateModified "2024-02-25T22:44:01+00:00"^^xsd:dateTime ; schema1:description "Krankheit", "sideroblastic anemia characterized by an autosomal dominant inheritance pattern", "хвороба" ; - schema1:version 2514121455 ; + schema1:version 2087252686 ; ns1:identifiers 5 ; ns1:sitelinks 0 ; ns1:statements 15 ; @@ -45,6 +44,7 @@ wd:Q19833018 rdfs:label "anémie sidéroblastique autosomique dominante", wdt:P1199 wd:Q116406 ; wdt:P2293 wd:Q18027359 ; wdt:P279 wd:Q18553439, + wd:Q2610084, wd:Q3616631 ; wdt:P2888 , do:0060335 ; @@ -59,16 +59,5 @@ wd:Q19833018 rdfs:label "anémie sidéroblastique autosomique dominante", ps:P31 wd:Q929833 . - prov:wasDerivedFrom ; - ps:P279 wd:Q18553439 . - - prov:wasDerivedFrom ; - ps:P279 wd:Q2610084 . - - prov:wasDerivedFrom ; - ps:P492 "182170" . - - ps:P279 wd:Q3616631 . - ps:P31 wd:Q112193867 . diff --git a/tests/test_issues/test_diseases.py b/tests/test_issues/test_diseases.py index 0b9c1a9..db9553f 100644 --- a/tests/test_issues/test_diseases.py +++ b/tests/test_issues/test_diseases.py @@ -6,6 +6,9 @@ from tests.utils.wikidata_utils import WikiDataTestCase +# Live Wikidata no longer fits this 2018/2019 schema; shex.js gives the same verdicts as PyShEx +# on the saved snapshots, so this is data drift, not an evaluator bug. +@pytest.mark.skip(reason="live Wikidata disease items no longer conform to the 2019 schema (checked 2026-10)") @pytest.mark.skipif(SKIP_EXTERNAL_URLS, reason=SKIP_EXTERNAL_URLS_MSG) class TestWikiDiseases(WikiDataTestCase): """Test a sample conformance checker for the WikiData disease structure.""" diff --git a/tests/test_issues/test_fhir.py b/tests/test_issues/test_fhir.py index 4c9e5ed..3dd794a 100644 --- a/tests/test_issues/test_fhir.py +++ b/tests/test_issues/test_fhir.py @@ -24,6 +24,9 @@ def _run_and_compare(args, result_path): assert f.read() == outf.getvalue() +# hl7.org/fhir dropped observation-example-haplotype2.ttl after R4, and the published R4, R4B and STU3 +# ShEx either references undefined fhirpath shapes or doesn't parse; test_observation covers the local copy. +@pytest.mark.skip(reason="no published FHIR example + ShEx pair still validates (checked 2026-10)") @pytest.mark.skipif(SKIP_EXTERNAL_URLS, reason=SKIP_EXTERNAL_URLS_MSG) def test_observation_online(): """Test online FHIR example.""" diff --git a/tests/test_issues/test_reactome.py b/tests/test_issues/test_reactome.py index 5323fb4..016085c 100644 --- a/tests/test_issues/test_reactome.py +++ b/tests/test_issues/test_reactome.py @@ -9,6 +9,9 @@ MANIFEST_URL = "https://raw.githubusercontent.com/shexSpec/schemas/master/Wikidata/pathways/Reactome/manifest_all.json" +# Live Wikidata no longer fits this 2018/2019 schema; shex.js gives the same verdicts as PyShEx +# on the saved snapshots, so this is data drift, not an evaluator bug. +@pytest.mark.skip(reason="live Wikidata reactome items no longer conform to the 2018 schema (checked 2026-10)") @pytest.mark.skipif(SKIP_EXTERNAL_URLS, reason=SKIP_EXTERNAL_URLS_MSG) def test_wikidata_reactome() -> None: # This will change over time - expected values for the first 8 results diff --git a/tests/utils/web_server_utils.py b/tests/utils/web_server_utils.py index 7299699..0eccd21 100644 --- a/tests/utils/web_server_utils.py +++ b/tests/utils/web_server_utils.py @@ -22,14 +22,15 @@ def is_up(url: str) -> Optional[bool]: if SKIP_EXTERNAL_URLS: return False try: - requests.head(url, timeout=2) - except Exception as e: + resp = requests.head(url, timeout=2, allow_redirects=True) + except Exception: return False - return True + # A gateway error or a missing repository means the endpoint can't answer queries + return resp.status_code < 500 and resp.status_code != 404 def is_down_reason(url: str) -> str: svr_status = is_up(url) - return f"Server {svr} is {'UP' if svr_status else 'DOWN' if svr_status is False else 'NOT BEING TESTED'}" + return f"Server {url} is {'UP' if svr_status else 'DOWN' if svr_status is False else 'NOT BEING TESTED'}" # Prime the cache for svr in PRE_CACHE: