Skip to content

Fix ID length validation: reject IDs with wrong digit count#342

Merged
dalito merged 1 commit intomainfrom
issue341-detect-too-long-IDs
Feb 14, 2026
Merged

Fix ID length validation: reject IDs with wrong digit count#342
dalito merged 1 commit intomainfrom
issue341-detect-too-long-IDs

Conversation

@dalito
Copy link
Member

@dalito dalito commented Feb 14, 2026

Add negative lookbehind to ID regex patterns so that e.g. an 8-digit ID is not silently accepted by a 7-digit pattern. Abort conversion when non-conforming IDs are found.

With this PR conversion fails with a meaningful message:

INFO    |Executing cmd: voc4cat convert --config _main_branch/idranges.toml --logfile outbox/voc4cat.log --outdir outbox inbox-excel-vocabs/
INFO    |Reading XLSX file: inbox-excel-vocabs\voc4cat.xlsx
ERROR   |Terminating with error: Found 19 non-conforming IRI(s) that do not match the configured ID pattern ((?<![0-9])(?P<identifier>[0-9]{7})$):
  https://w3id.org/nfdi4cat/voc4cat_00008201
  https://w3id.org/nfdi4cat/voc4cat_00008202

Closes #341

Add negative lookbehind to ID regex patterns so that e.g. an
8-digit ID is not silently accepted by a 7-digit pattern.
Abort conversion when non-conforming IDs are found.
@dalito dalito added this to the 1.0.3 milestone Feb 14, 2026
@dalito dalito self-assigned this Feb 14, 2026
@dalito dalito moved this from New to In progress in Voc4Cat cross-repo view Feb 14, 2026
@dalito dalito merged commit 54bfffc into main Feb 14, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Completed in Voc4Cat cross-repo view Feb 14, 2026
@dalito dalito deleted the issue341-detect-too-long-IDs branch February 14, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

Detect and error for non-conforming IDs

1 participant