Repository navigation
Fix whitespace check and all whitespace violations - #51
Conversation
- defines the covered properties via rdf:type, not rdfs:subPropertyOf - makes an exception for double-space after a period (for now) - adds coverage for nonbreaking spaces Finds 460 violations, to be fixed in later commits
"Was used as an instance-level slot for a procedure; not needed"
…ment properties only). Fix one more actual ontology value.
Generated as described in docs/CONTRIBUTING.md step 5 (main vs. this branch, markdown format) and relabeled with scripts/relabel_robot_diff.py. The "Loaded from" lines show branch names in place of local file paths, and the Version IRI lines and the empty Ontology imports and Ontology annotations headings are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Markdown collapses runs of spaces and line breaks, which hid most of the fixes in this diff. Single-line values are now in code spans and multi-line values in fenced code blocks, with ROBOT's HTML entities unescaped inside them. Nonbreaking spaces still look like spaces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hoodcm
left a comment
There was a problem hiding this comment.
Thanks Jeff, good find on the old check. Claude found one gap while I was reviewing: rdfs:label and rdfs:comment aren't declared as annotation properties in RadLex.owl, so ?property a owl:AnnotationProperty skips them. Running this branch's query on labels alone finds 23, all German labels with nonbreaking spaces, such as RID44634. This change picks them up and nothing else:
{ ?property a owl:AnnotationProperty }
UNION
{ VALUES ?property { rdfs:label rdfs:comment } }The rest looks good to me.
Hi @hoodcm thanks, good catch. Ouch. What do you think of accepting this PR as-is and opening a new ticket for the extension to annotation-properties that are not internally declared? There's a larger question of the right way to gather those, and meantime it'll be good to merge the fixes in this branch so far. Basically seems like adding new properties would be an additive change, not a rollback of what's in this PR so far. |
The whitespace check only looked at values of declared annotation properties. ROBOT adds declarations for undeclared custom properties when it loads the ontology, but never for OWL's built-in ones, so rdfs:label, rdfs:comment and owl:versionInfo were skipped. The check now looks at every literal (except owl:annotatedTarget, which repeats a reified axiom's value). That finds 23 German rdfs:label values with nonbreaking spaces (U+00A0) between words; they are now ordinary spaces. The ROBOT diff doc is regenerated to include them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, @hoodcm — fixed in place rather than deferred. Rather than adding That finds the same 23 German labels you found. Each had nonbreaking spaces (U+00A0) between words, which are now ordinary spaces. They're in the regenerated ROBOT diff, though the removed and added values look identical there, since a nonbreaking space renders like a normal one. Catching custom properties that are used but never declared needs a different kind of check, which is now in #52 / #53 (OWL 2 DL profile check). |
Fixes #33
Summary
Fixes the stray-whitespace check (
leading_trailing_multi_whitespace.rq), which had never matched anything, and cleans up the 459 annotation values it turned up, so the check now passes with no violations.Details
The check. It selected properties with
?property rdfs:subPropertyOf owl:AnnotationProperty, which no property in RadLex satisfies, so it never tested any value. It now selects?property a owl:AnnotationProperty. It also now:\smatches);obo:IAO_0000115definition,rid:Commentandrdfs:comment), allows line breaks between non-whitespace characters: one newline, or two for a paragraph break, optionally followed by spaces that indent the next line (e.g. nested bullets). The rest of such a value is still checked, so e.g. a space before a newline is a violation.rdfs:commentis included ahead of a possible move to that property.The ontology. 459 values on 454 classes changed:
Sourcevalues split into one reference per value, where the references had been run together (separated by;,,or just spaces). This matches the plan to hold one reference perSourcevalue.[PI-RADS}), missing sentence punctuation, straightened quotes, trailing commas onSource, and some definitions split onto lines by modality.Motivation
Stray whitespace makes values that should be equal compare as different (e.g. when matching labels or synonyms), and inconsistent whitespace shows up in every downstream use of the text. The check was meant to catch it but had been silently passing.
Affected classes and properties
Changed
leading_trailing_multi_whitespace.rq: fixed and extended, as described above.Comment(270), definition (156),Source(5) andhasExactSynonym(2, both German).Sourcesplit into one reference per value:RID34992absent collecting duct system (the Eisenberg reference also gained its publication details)RID34997acorn deformityRID35095coin lesionRID35391musculoskeletal crescent signRID35666tumbling bullet signContent fixes alongside the whitespace fixes:
RID343prostate:Commentquotes straightened and wording tidiedRID348central zone of prostate: definition line breaks and punctuation tidiedRID3544prostatitis: definition punctuationRID3875nodule: definition bracket and wording fixesRID5701diffuse: definition split onto one line per sourceRID5811linear: definition punctuationRID5812wedge-shaped: definition bracket fixRID6434brain: definition punctuation and wordingRID14063subdivision of middle frontal gyrus:Commentline break replaced with;RID28957right cingulum bundle:Commentline break replaced with;RID29173round mass: definition punctuation and wordingRID29215irregular mass: trailing comma removed fromSourceRID29927quadrant of breast: trailing comma removed fromSourceRID32078hepatoportal lymph node (obsolete):Commentline break replaced with;RID34263Intramammary lymph node: definition typo ("ahve")RID34270skin thickening: definition spacing ("> 2mm")RID34282obscured: definition punctuation and wordingRID34301focus: definition spacingRID35978Chilaiditi syndrome: definition spacing inside parenthesesRID49515tumor invasion of neurovascular bundle of prostate:Commentreformatted as a listRID49820transitional phase: definition bracket fixROBOT diff
The full diff (454 classes) is in docs/changes/fix-whitespace-check2.md.
Markdown would collapse the whitespace being fixed, so values in that file are shown as code: single-line values in code spans, multi-line values in fenced blocks. The two nonbreaking spaces (RID2513 and RID10010) still look like ordinary spaces there.
tests/scripts/robot-report-tests.shreports no violations on this branch.🤖 Generated with Claude Code