From b694813a29aa2797595a7e1c92cb305d60e0f1bf Mon Sep 17 00:00:00 2001 From: hoodcm Date: Thu, 1 Oct 2026 14:27:54 -0400 Subject: [PATCH] Check that no live class names an obsolete class in a logical axiom, and re-point the one that does --- RadLex.owl | 2 +- tests/robot-report-profile.txt | 3 ++- .../live_class_referencing_obsolete_class.rq | 25 +++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 tests/sparql/robot/live_class_referencing_obsolete_class.rq diff --git a/RadLex.owl b/RadLex.owl index 17fd4c2..717bfe0 100644 --- a/RadLex.owl +++ b/RadLex.owl @@ -1033878,7 +1033878,7 @@ duplicate of RID9802 - + diff --git a/tests/robot-report-profile.txt b/tests/robot-report-profile.txt index 00c1f4c..ebccb11 100644 --- a/tests/robot-report-profile.txt +++ b/tests/robot-report-profile.txt @@ -1 +1,2 @@ -ERROR file:./tests/sparql/robot/leading_trailing_multi_whitespace.rq \ No newline at end of file +ERROR file:./tests/sparql/robot/leading_trailing_multi_whitespace.rq +ERROR file:./tests/sparql/robot/live_class_referencing_obsolete_class.rq diff --git a/tests/sparql/robot/live_class_referencing_obsolete_class.rq b/tests/sparql/robot/live_class_referencing_obsolete_class.rq new file mode 100644 index 0000000..75a9a5c --- /dev/null +++ b/tests/sparql/robot/live_class_referencing_obsolete_class.rq @@ -0,0 +1,25 @@ +PREFIX rdfs: +PREFIX owl: +PREFIX rid: + +# +# Part of the RadLex ontology SPARQL test suite. Bindings to this query represent violations of the test. +# +# Test that no live class has a logical axiom naming an obsolete class. An obsolete class is one filed, +# directly or through another obsolete class, under RID15849 ("Obsolete RadLex Term"). A live class that +# points at an obsolete one keeps a relationship to a concept RadLex has retired. Re-point it to the +# obsolete class's replacement. +# +# VIOLATIONS will be bindings that have, on ?entity, ?property, and ?value respectively: +# - The live class. +# - The relation in the axiom. +# - The obsolete class it names. +# +SELECT ?entity ?property ?value +WHERE { + ?entity rdfs:subClassOf|owl:equivalentClass ?restriction . + ?restriction owl:onProperty ?property ; + owl:someValuesFrom|owl:allValuesFrom ?value . + ?value rdfs:subClassOf+ rid:RID15849 . + FILTER NOT EXISTS { ?entity rdfs:subClassOf+ rid:RID15849 } +}