Skip to content

Allow keyword redefinition#465

Merged
jesper-friis merged 26 commits intomasterfrom
allow-keyword-redefinition
Nov 18, 2025
Merged

Allow keyword redefinition#465
jesper-friis merged 26 commits intomasterfrom
allow-keyword-redefinition

Conversation

@francescalb
Copy link
Contributor

@francescalb francescalb commented Nov 12, 2025

Description

Desired behaviour:

It should be allowed to redfine keywords locally. This means that keywords in the default are overwritten. For instance: vcard:hasName can be overwritten to fam:hasName.

This behaviour is needed, but should be treated with care.

We use the argument redefine with thre possible values:
'true' (warning issued), 'skip' (warning issued), 'raise' (default)

Default raise: Raises an error to make sure that the choice of allowing redefinition of or skipping new of keywords is always an active choice .

In practice this argument will often be set to true or skip, but by having the default False it should reduce the risk of doing it without intending to.

'true': existing keywords will be redefined, i.e. overwritten in the local context.

'skip': if a keyword that already is set is tried to be defined it will be skipped. This will typically happen if you have a prefLabel in your ontology that is the same as an existing keyword. With skip, this keyword will stay as the original. It should issue a warning and say that you should not use the keyword/preflabel alone for documentating this property/class but the curie.

Type of change

  • Bug fix and code cleanup
  • New feature
  • Documentation update
  • Testing

Checklist for the reviewer

This checklist should be used as a help for the reviewer.

  • Is the change limited to one issue?
  • Does this PR close the issue?
  • Is the code easy to read and understand?
  • Do all new feature have an accompanying new test?
  • Has the documentation been updated as necessary?
  • Is the code properly tested?

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

❌ Patch coverage is 98.30508% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.93%. Comparing base (754b688) to head (2acefb1).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
tripper/datadoc/keywords.py 98.18% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #465      +/-   ##
==========================================
+ Coverage   84.84%   84.93%   +0.08%     
==========================================
  Files          30       30              
  Lines        4567     4607      +40     
==========================================
+ Hits         3875     3913      +38     
- Misses        692      694       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jesper-friis jesper-friis marked this pull request as ready for review November 16, 2025 11:46
@jesper-friis jesper-friis marked this pull request as draft November 16, 2025 11:47
@francescalb francescalb marked this pull request as ready for review November 18, 2025 13:47
@jesper-friis jesper-friis merged commit 2566d76 into master Nov 18, 2025
66 of 97 checks passed
@jesper-friis jesper-friis deleted the allow-keyword-redefinition branch November 18, 2025 20:50
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.

2 participants