Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
# OS
.DS_Store

Expand Down
30 changes: 15 additions & 15 deletions RadLex.owl
Original file line number Diff line number Diff line change
Expand Up @@ -10389,7 +10389,7 @@ duplicate term</RID:Comment>
<RID:Preferred_Name_for_Obsolete>balloon dilation of structure</RID:Preferred_Name_for_Obsolete>
<RID:RadLexID xml:lang="en">RID10400</RID:RadLexID>
<RID:Radlex_version_of_class_change>4.1 obs</RID:Radlex_version_of_class_change>
<RID:Replaced_by>RID11030</RID:Replaced_by>
<RID:Replaced_by rdf:resource="http://www.radlex.org/RID/RID11030"/>
<rdfs:label xml:lang="de">Ballondilatation einer Struktur</rdfs:label>
</owl:Class>

Expand Down Expand Up @@ -23277,7 +23277,7 @@ AND
<rdfs:subClassOf rdf:resource="http://www.radlex.org/RID/RID11486"/>
<RID:Definition>An artifact resulting in ghost images of a vessel extending across the image in the phase encoding direction.</RID:Definition>
<RID:RadLexID xml:lang="en">RID11488</RID:RadLexID>
<rdfs:label xml:lang="de">Betonung des pulsatilen Flussartefaktes</rdfs:label>
<rdfs:label xml:lang="de">Betonung des pulsatilen Flussartefaktes</rdfs:label>
<rdfs:label xml:lang="en">accentuation of pulsatile flow artifact</rdfs:label>
</owl:Class>

Expand Down Expand Up @@ -23889,7 +23889,7 @@ AND
<owl:Class rdf:about="http://www.radlex.org/RID/RID11529">
<rdfs:subClassOf rdf:resource="http://www.radlex.org/RID/RID11528"/>
<RID:RadLexID xml:lang="en">RID11529</RID:RadLexID>
<rdfs:label xml:lang="de">Komplikation eines Abszesses</rdfs:label>
<rdfs:label xml:lang="de">Komplikation eines Abszesses</rdfs:label>
<rdfs:label xml:lang="en">abscess complication</rdfs:label>
</owl:Class>

Expand Down Expand Up @@ -68441,7 +68441,7 @@ The LI-RADS definition of “size” correspons to the definition of the longest
<RID:Preferred_Name_for_Obsolete>Brodmann area 5 of left post central gyrus</RID:Preferred_Name_for_Obsolete>
<RID:RadLexID xml:lang="en">RID13601</RID:RadLexID>
<RID:Radlex_version_of_class_change>4.3 obs</RID:Radlex_version_of_class_change>
<RID:Replaced_by>RID25948</RID:Replaced_by>
<RID:Replaced_by rdf:resource="http://www.radlex.org/RID/RID25948"/>
<rdfs:label xml:lang="de">Brodmann-Areal 5 des linken Gyrus postcentralis</rdfs:label>
</owl:Class>

Expand Down Expand Up @@ -498439,7 +498439,7 @@ FMA has same as pelvis RID2507</RID:Comment>
<!-- http://www.radlex.org/RID/RID27787 -->

<owl:Class rdf:about="http://www.radlex.org/RID/RID27787">
<rdfs:subClassOf rdf:resource="http://www.radlex.org/RID/RID13828"/>
<rdfs:subClassOf rdf:resource="http://www.radlex.org/RID/RID15849"/>
<RID:Preferred_Name_for_Obsolete>tenia choroidea of lateral ventricle</RID:Preferred_Name_for_Obsolete>
<RID:RadLexID xml:lang="en">RID27787</RID:RadLexID>
<RID:Radlex_version_of_class_change>3.14 obs</RID:Radlex_version_of_class_change>
Expand Down Expand Up @@ -540446,7 +540446,7 @@ US: A mass that is spherical, ball-shaped, circular or globular. A round mass h
<RID:Synonym xml:lang="en">anterior thoracic region</RID:Synonym>
<RID:Synonym xml:lang="en">front of chest</RID:Synonym>
<RID:Synonym xml:lang="la">pectus</RID:Synonym>
<rdfs:label xml:lang="de">Vorderseite des Brustkorbs</rdfs:label>
<rdfs:label xml:lang="de">Vorderseite des Brustkorbs</rdfs:label>
<rdfs:label xml:lang="en">anterior chest</rdfs:label>
</owl:Class>

Expand Down Expand Up @@ -544783,7 +544783,7 @@ US: A mass that is spherical, ball-shaped, circular or globular. A round mass h
<RID:Synonym xml:lang="en">lumbar region</RID:Synonym>
<RID:Synonym xml:lang="de">regio lumbalis</RID:Synonym>
<RID:Synonym xml:lang="la">regio lumbalis</RID:Synonym>
<rdfs:label xml:lang="de">Rückwand des Abdomens</rdfs:label>
<rdfs:label xml:lang="de">Rückwand des Abdomens</rdfs:label>
<rdfs:label xml:lang="en">back of abdomen</rdfs:label>
</owl:Class>

Expand Down Expand Up @@ -741605,7 +741605,7 @@ not yet enhanced</RID:Definition>
<RID:Preferred_Name_for_Obsolete>early hepatic arterial phase</RID:Preferred_Name_for_Obsolete>
<RID:RadLexID xml:lang="en">RID39534</RID:RadLexID>
<RID:Radlex_version_of_class_change>4.1 obs</RID:Radlex_version_of_class_change>
<RID:Replaced_by>RID11082</RID:Replaced_by>
<RID:Replaced_by rdf:resource="http://www.radlex.org/RID/RID11082"/>
<RID:Source>LI-RADS</RID:Source>
<RID:Synonym xml:lang="en">early arterial phase (liver)</RID:Synonym>
<rdfs:label xml:lang="de">früharterielle Phase der Leber</rdfs:label>
Expand All @@ -741625,7 +741625,7 @@ enhanced</RID:Definition>
<RID:Preferred_Name_for_Obsolete>late hepatic arterial phase</RID:Preferred_Name_for_Obsolete>
<RID:RadLexID xml:lang="en">RID39535</RID:RadLexID>
<RID:Radlex_version_of_class_change>4.1 obs</RID:Radlex_version_of_class_change>
<RID:Replaced_by>RID39127</RID:Replaced_by>
<RID:Replaced_by rdf:resource="http://www.radlex.org/RID/RID39127"/>
<RID:Source>LI-RADS</RID:Source>
<rdfs:label xml:lang="de">spätarterielle Phase der Leber</rdfs:label>
</owl:Class>
Expand Down Expand Up @@ -871055,7 +871055,7 @@ Enhancement from hypo on precontrast to iso on arterial phase does not qualify a
<rdfs:subClassOf rdf:resource="http://www.radlex.org/RID/RID13060"/>
<RID:RadLexID xml:lang="en">RID45693</RID:RadLexID>
<RID:Source>Playbook</RID:Source>
<rdfs:label xml:lang="de">Bildgebung in Bloodpool- phase</rdfs:label>
<rdfs:label xml:lang="de">Bildgebung in Bloodpool-Phase</rdfs:label>
<rdfs:label xml:lang="en">blood pool imaging</rdfs:label>
</owl:Class>

Expand Down Expand Up @@ -979816,7 +979816,7 @@ the apex</RID:Definition>
<!-- http://www.radlex.org/RID/RID49508 -->

<owl:Class rdf:about="http://www.radlex.org/RID/RID49508">
<rdfs:subClassOf rdf:resource="http://www.radlex.org/RID/RID49513"/>
<rdfs:subClassOf rdf:resource="http://www.radlex.org/RID/RID15849"/>
<RID:Comment>&quot;capsule of prostate&quot; and &quot;pseudocapsule of prostate&quot; were determined to be the same entity. This term was deprecated in favor of the existing term with the preferred &quot;pseudocapsule&quot;.</RID:Comment>
<RID:Created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2014-07-07T00:00:00</RID:Created>
<RID:Definition>PI-RADS: Tumor involvement of the “capsule” or extension across the “capsule”
Expand Down Expand Up @@ -993046,7 +993046,7 @@ strong association with benignity</RID:Comment>
<RID:RadLexID xml:lang="en">RID50296</RID:RadLexID>
<RID:Radlex_version_of_class_change>3.15 new</RID:Radlex_version_of_class_change>
<RID:Source>PI-RADS v2.1</RID:Source>
<rdfs:label xml:lang="en">PI-RADS 1 - Very low (Lesion)</rdfs:label>
<rdfs:label xml:lang="en">PI-RADS 1 - Very low (Lesion)</rdfs:label>
</owl:Class>


Expand All @@ -993060,7 +993060,7 @@ strong association with benignity</RID:Comment>
<RID:RadLexID xml:lang="en">RID50297</RID:RadLexID>
<RID:Radlex_version_of_class_change>3.15 new</RID:Radlex_version_of_class_change>
<RID:Source>PI-RADS v2.1</RID:Source>
<rdfs:label xml:lang="en">PI-RADS 2 - Low (Lesion)</rdfs:label>
<rdfs:label xml:lang="en">PI-RADS 2 - Low (Lesion)</rdfs:label>
</owl:Class>


Expand Down Expand Up @@ -998169,7 +998169,7 @@ Does not apply to blood pool agents.</RID:Comment>
<rdfs:subClassOf rdf:resource="http://www.radlex.org/RID/RID43582"/>
<oboInOwl:created_by>Beverly Collins</oboInOwl:created_by>
<oboInOwl:creation_date>2022-01-21T21:16:57.865324Z</oboInOwl:creation_date>
<RID:RadLexID xml:lang="en">RID60643</RID:RadLexID>
<RID:RadLexID xml:lang="en">RID50643</RID:RadLexID>
<RID:Radlex_version_of_class_change>4.2 new</RID:Radlex_version_of_class_change>
<RID:Source>LOINC</RID:Source>
<RID:Synonym xml:lang="en">view Canale</RID:Synonym>
Expand Down Expand Up @@ -998801,7 +998801,7 @@ Does not apply to blood pool agents.</RID:Comment>
<rdfs:subClassOf rdf:resource="http://www.radlex.org/RID/RID50674"/>
<oboInOwl:created_by>Beverly Collins</oboInOwl:created_by>
<oboInOwl:creation_date>2022-08-19T16:24:49.983716Z</oboInOwl:creation_date>
<RID:RadLexID xml:lang="en">RID50580</RID:RadLexID>
<RID:RadLexID xml:lang="en">RID50680</RID:RadLexID>
<RID:Radlex_version_of_class_change>4.2 new</RID:Radlex_version_of_class_change>
<RID:Source>‘CT Kidney and Abdominal Renal Mass’ report template</RID:Source>
<rdfs:label xml:lang="en">invades collecting system</rdfs:label>
Expand Down
9 changes: 8 additions & 1 deletion tests/robot-report-profile.txt
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
ERROR file:./tests/sparql/robot/leading_trailing_multi_whitespace.rq
ERROR file:./tests/sparql/robot/leading_trailing_multi_whitespace.rq
ERROR file:./tests/sparql/robot/empty_annotation_value.rq
ERROR file:./tests/sparql/robot/mismatched_radlexid.rq
ERROR file:./tests/sparql/robot/literal_replaced_by_value.rq
ERROR file:./tests/sparql/robot/dangling_replaced_by_target.rq
ERROR file:./tests/sparql/robot/live_class_with_replaced_by.rq
ERROR file:./tests/sparql/robot/live_class_with_preferred_name_for_obsolete.rq
ERROR file:./tests/sparql/robot/live_class_under_obsolete_parent.rq
22 changes: 22 additions & 0 deletions tests/sparql/robot/dangling_replaced_by_target.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rid: <http://www.radlex.org/RID/>

#
# Part of the RadLex ontology SPARQL test suite. Bindings to this query represent violations of the test.
#
# Test that every rid:Replaced_by pointer aims at a class declared in RadLex. A pointer to an undeclared IRI,
# such as a mistyped RID, cannot be followed. A pointer to a class that is itself obsolete is allowed: the
# chain records the retirement history, and a consumer can follow it to the end.
#
# VIOLATIONS will be bindings that have, on ?entity, ?property, and ?value respectively:
# - The obsolete class carrying the pointer.
# - rid:Replaced_by.
# - The undeclared target IRI.
#
SELECT ?entity ?property ?value
WHERE {
BIND(rid:Replaced_by AS ?property)
?entity ?property ?value .
FILTER(isIRI(?value))
FILTER NOT EXISTS { ?value a owl:Class }
}
22 changes: 22 additions & 0 deletions tests/sparql/robot/empty_annotation_value.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>

#
# Part of the RadLex ontology SPARQL test suite. Bindings to this query represent violations of the test.
#
# Test that no annotation assertion has an empty or whitespace-only value. An empty assertion falsely signals
# that the field is populated. Every declared owl:AnnotationProperty is covered, plus rdfs:label, which is a
# built-in and therefore not declared.
#
# VIOLATIONS will be bindings that have, on ?entity, ?property, and ?value respectively:
# - The entity carrying the empty assertion.
# - The annotation property.
# - The empty or whitespace value.
#
SELECT ?entity ?property ?value
WHERE {
{ ?property a owl:AnnotationProperty } UNION { BIND(rdfs:label AS ?property) }
?entity ?property ?value .
FILTER(isLiteral(?value))
FILTER(REGEX(STR(?value), "^\\s*$"))
}
6 changes: 5 additions & 1 deletion tests/sparql/robot/leading_trailing_multi_whitespace.rq
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ PREFIX rid: <http://www.radlex.org/RID/>
# Test for stray whitespace on values (strings) of the annotation properties used for names. Specifically, this test
# prohibits: leading or trailing whitespace, or consecutive whitespace characters within a string.
#
# The constrained properties are checked directly and through any declared sub-property. Matching only through
# rdfs:subPropertyOf would skip rdfs:label and rid:UMLS_Term, which have no sub-properties (rid:Synonym is caught
# that way only because it is declared as a sub-property of itself).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. rdfs:subPropertyOf is reflexive, so with RDFS entailments, the '*' would not be necessary - but ROBOT does not compute those entailments when it runs these testing queries.

#
# VIOLATIONS will be bindings that have, on ?entity, ?property, and ?value respectively:
# - The entity on which the violation occurs (e.g., the class).
# - The property on which the violation occurs (i.e., the annotation property, e.g. rdfs:label).
Expand All @@ -17,7 +21,7 @@ PREFIX rid: <http://www.radlex.org/RID/>
SELECT ?entity ?property ?value
WHERE {
VALUES ?constrained_property {rdfs:label rid:Synonym rid:UMLS_Term} .
?property rdfs:subPropertyOf ?constrained_property .
?property rdfs:subPropertyOf* ?constrained_property .
?entity ?property ?value .
FILTER(REGEX(STR(?value), "^\\s|\\s+$|\\s\\s"))
}
19 changes: 19 additions & 0 deletions tests/sparql/robot/literal_replaced_by_value.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
PREFIX rid: <http://www.radlex.org/RID/>

#
# Part of the RadLex ontology SPARQL test suite. Bindings to this query represent violations of the test.
#
# Test that every rid:Replaced_by value is an IRI reference to another class, not a string literal such as
# "RID11030". A literal cannot be followed by tooling that walks obsolete terms to their replacements.
#
# VIOLATIONS will be bindings that have, on ?entity, ?property, and ?value respectively:
# - The obsolete class carrying the pointer.
# - rid:Replaced_by.
# - The literal value that should have been an IRI.
#
SELECT ?entity ?property ?value
WHERE {
BIND(rid:Replaced_by AS ?property)
?entity ?property ?value .
FILTER(isLiteral(?value))
}
24 changes: 24 additions & 0 deletions tests/sparql/robot/live_class_under_obsolete_parent.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rid: <http://www.radlex.org/RID/>

#
# Part of the RadLex ontology SPARQL test suite. Bindings to this query represent violations of the test.
#
# Test that no class is filed under an obsolete class without itself being marked obsolete. An obsolete class
# is one filed, directly or through another obsolete class, under RID15849 ("Obsolete RadLex Term"). Filing
# makes every descendant obsolete, so a live class left under a class being retired is retired silently.
# rid:Preferred_Name_for_Obsolete is the per-class mark that the retirement was intended. RID15849 itself is
# not an obsolete parent, since obsolete classes are meant to hang under it.
#
# VIOLATIONS will be bindings that have, on ?entity, ?property, and ?value respectively:
# - The class that was never marked obsolete.
# - rdfs:subClassOf.
# - The obsolete parent.
#
SELECT ?entity ?property ?value
WHERE {
BIND(rdfs:subClassOf AS ?property)
?entity ?property ?value .
?value rdfs:subClassOf+ rid:RID15849 .
FILTER NOT EXISTS { ?entity rid:Preferred_Name_for_Obsolete ?_name }
}
22 changes: 22 additions & 0 deletions tests/sparql/robot/live_class_with_preferred_name_for_obsolete.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rid: <http://www.radlex.org/RID/>

#
# Part of the RadLex ontology SPARQL test suite. Bindings to this query represent violations of the test.
#
# Test that only obsolete classes carry rid:Preferred_Name_for_Obsolete. An obsolete class is one filed,
# directly or through another obsolete class, under RID15849 ("Obsolete RadLex Term"). A live class carrying
# the property was made obsolete in name but never filed under RID15849, so tools that exclude RID15849's subclasses
# still offer it as a live term.
#
# VIOLATIONS will be bindings that have, on ?entity, ?property, and ?value respectively:
# - The live class carrying the property.
# - rid:Preferred_Name_for_Obsolete.
# - The obsolete name.
#
SELECT ?entity ?property ?value
WHERE {
BIND(rid:Preferred_Name_for_Obsolete AS ?property)
?entity ?property ?value .
FILTER NOT EXISTS { ?entity rdfs:subClassOf+ rid:RID15849 }
}
21 changes: 21 additions & 0 deletions tests/sparql/robot/live_class_with_replaced_by.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rid: <http://www.radlex.org/RID/>

#
# Part of the RadLex ontology SPARQL test suite. Bindings to this query represent violations of the test.
#
# Test that only obsolete classes carry rid:Replaced_by. An obsolete class is one filed, directly or through
# another obsolete class, under RID15849 ("Obsolete RadLex Term"). A live class with a replacement pointer is
# contradictory: either the class was never filed as obsolete or the pointer is stray.
#
# VIOLATIONS will be bindings that have, on ?entity, ?property, and ?value respectively:
# - The live class carrying the pointer.
# - rid:Replaced_by.
# - The pointer's target.
#
SELECT ?entity ?property ?value
WHERE {
BIND(rid:Replaced_by AS ?property)
?entity ?property ?value .
FILTER NOT EXISTS { ?entity rdfs:subClassOf+ rid:RID15849 }
}
28 changes: 28 additions & 0 deletions tests/sparql/robot/mismatched_radlexid.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rid: <http://www.radlex.org/RID/>

#
# Part of the RadLex ontology SPARQL test suite. Bindings to this query represent violations of the test.
#
# Test that a class's rid:RadLexID restates the local name of its own IRI. The ID is redundant with the IRI by
# design, so any disagreement is a copy or typing error that desynchronises ID-keyed consumers from IRI-keyed
# ones. A class in the RID namespace with no rid:RadLexID at all is also a violation.
#
# Scope: classes whose IRI local name has the form RID<digits>.
#
# VIOLATIONS will be bindings that have, on ?entity, ?property, and ?value respectively:
# - The class whose ID disagrees with (or is missing from) its IRI.
# - rid:RadLexID.
# - The ID value found, or the empty string when the class carries none.
#
SELECT ?entity ?property ?value
WHERE {
?entity a owl:Class .
FILTER(REGEX(STR(?entity), "^http://www\\.radlex\\.org/RID/RID[0-9]+$"))
BIND(rid:RadLexID AS ?property)
BIND(REPLACE(STR(?entity), "^http://www\\.radlex\\.org/RID/", "") AS ?expected)
OPTIONAL { ?entity rid:RadLexID ?id }
BIND(COALESCE(STR(?id), "") AS ?value)
FILTER(?value != ?expected)
}
Loading