Skip to content

Add a check for more than one label per language - #66

Merged
jclerman merged 1 commit into
mainfrom
multiple-labels-per-language
Nov 27, 2026
Merged

jclerman merged 1 commit into
mainfrom
multiple-labels-per-language

Conversation

@jclerman

@jclerman jclerman commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #31

Stacked on #69: merge that first. Until then this PR's base is #69's branch, so the diff shows only the new check.

Summary

Adds a robot report check that no entity has more than one rdfs:label in the same language.

Details

  • The query: tests/sparql/robot/multiple_labels_per_language.rq reports every label of an entity that has another label in the same language. Untagged labels count as one more language. Each label in a clash is reported, so a class with two English labels gives two rows.
  • Severity: it's registered in tests/robot-report-profile.txt at ERROR.
  • Why not ROBOT's built-in check: ROBOT's multiple_labels doesn't allow for languages, so it would flag every class with an English and a German label. As Michael Hood noted on Add linting rule for max of 1 label per entity per language #31, that could change if the German labels later become @de synonyms.
  • Its one violation: on main the check reports only RID50845 NI-RADS Primary Site Score 2a (MRI), which also has the label NI-RADS Primary Site Score 2b (MRI) (RID50845 (NI-RADS Primary Site Score 2a, MRI) also has the 2b label #64). Fix the NI-RADS Primary Site Score 2a and 2b (MRI) classes #69 removes that label, so with Fix the NI-RADS Primary Site Score 2a and 2b (MRI) classes #69 applied robot-report-tests.sh reports no violations. Without it, this PR's CI would fail.
  • What it doesn't check: it doesn't require an English label on every class. Today only obsolete classes are checked for one (obsolete_class_without_english_label.rq), and every live class currently has one.

Motivation

A second label in the same language is a copy error or a misplaced synonym, and tools pick one label arbitrarily. The duplicate on RID50845 came in with #44, and none of the existing checks caught it.

Affected classes and properties

None: this PR changes only the tests.

🤖 Generated with Claude Code

Base automatically changed from fix-nirads-primary-site-2a-2b to main November 27, 2026 17:39
Each entity may have one rdfs:label per language, so ROBOT's standard
multiple_labels check doesn't fit RadLex's German labels. This custom
check reports any entity with two labels in the same language. Its one
violation on main, an extra label on RID50845 (#64), is fixed in #69,
which this commit builds on.

Closes #31

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jclerman
jclerman force-pushed the multiple-labels-per-language branch from b32dc05 to 1c01792 Compare November 27, 2026 17:46
@jclerman
jclerman merged commit 16f769f into main Nov 27, 2026
2 checks passed
@jclerman
jclerman deleted the multiple-labels-per-language branch November 27, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add linting rule for max of 1 label per entity per language

2 participants