Repository navigation
fix(actions): offer override only for nanopubs with an identity to keep - #945
Merged
Merged
Conversation
"Edit as overriding nanopublication" was offered for every nanopub. An override differs from deriving only in what it keeps: the IRIs the source introduces or describes, and its root definition (which comes with an introduced resource). Embedded IRIs are minted afresh by both. For a nanopub with nothing of the kind, such as a role assignment or a view display, an override made the same nanopub as deriving, so the menu entry only added a confusing duplicate. It is now offered only where the nanopub introduces or describes an IRI it does not embed: the same set the form keeps when filling an override. Closes #920 Refs #944 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
🎉 This PR is included in version 5.23.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #920. Part of #944.
Why
"Edit as overriding nanopublication" was offered in the action menu of every nanopub. An override differs from deriving only in what it keeps: the IRIs the source introduces or describes, and its root definition (nanopubs with a root definition also introduce the resource they define). Embedded IRIs are minted afresh in both modes. For a nanopub without such an IRI, an override produced the same nanopub as deriving, plus an empty change-note field.
What changes
OverrideAction.isApplicableTonow returns true only if the nanopub introduces (npx:introduces) or describes (npx:describes) an IRI it does not embed (npx:embeds). That's the same set nanopub-java'sTemplateFillerkeeps for a non-derive fill.docs/fill-modes.mdsays so.The view-defined "♻️ override..." actions (view-displays tables #664, presentation details) come from the views' own nanopubs and are not affected.
Testing
OverrideActionTest(8 tests): shown for a nanopub that introduces or describes something, or embeds one thing and introduces another (a template); not shown for one that introduces nothing or only embeds.NanopubActionTest,DeriveActionTest,NanopubItemTestandNanopubItemUnloadableTemplateTestpass./explorefor live nanopubs:sub:template, introduces its kindsub:statementsub:display🤖 Generated with Claude Code