Skip to content

Conversation

@kervel
Copy link
Collaborator

@kervel kervel commented Sep 18, 2025

  • work around a missing merge strategy in the merge crate
  • fix using the right prefix map when looking up slots

…oss-namespace bug (we should not use a global uri to curi converter anymore since every schema has its own prefix map) and a merge bug (which should eventually be fixed by adding a new merge strategy in the merge crate)
@kervel kervel marked this pull request as ready for review September 18, 2025 12:33
Comment on lines +12872 to +12878

/// Overwrite `left` with `right` unless `right` is `None`.
fn overwrite_except_none<T>(left: &mut Option<T>, right: Option<T>) {
if right.is_some() {
*left = right;
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe important to note - in general with linkml (and elsewhere) we want to be able to differentiate between an explicit None and an unset value. so it should be possible to override a value with an explicit None by providing a None, but if we just don't set the value then we don't overwrite.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, but this is to mimic the dict.update from python.
i need this because i need to merge multiple schemadefinitions (eg the one from the slot range, parent slot range, and slot_usage).

maybe in the gen-rust in linkml i should be able to customize the behaviour of merge here ..

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