Skip to content

fix(actions): offer override only for nanopubs with an identity to keep - #945

Merged
tkuhn merged 1 commit into
masterfrom
fix/920-override-applicable
Nov 23, 2026
Merged

tkuhn merged 1 commit into
masterfrom
fix/920-override-applicable

Conversation

@tkuhn

@tkuhn tkuhn commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

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.isApplicableTo now 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's TemplateFiller keeps for a non-derive fill. docs/fill-modes.md says so.

The view-defined "♻️ override..." actions (view-displays tables #664, presentation details) come from the views' own nanopubs and are not affected.

Testing

  • New 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, NanopubItemTest and NanopubItemUnloadableTemplateTest pass.
  • Local dev server, action menu on /explore for live nanopubs:
Nanopub Declares Override shown
Space definition introduces the space IRI yes
Template embeds sub:template, introduces its kind yes
Thread reply introduces sub:statement yes
Observer role assignment nothing no
View display only embeds sub:display no

🤖 Generated with Claude Code

"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]>
@tkuhn
tkuhn merged commit 947c5a6 into master Nov 23, 2026
8 checks passed
@tkuhn
tkuhn deleted the fix/920-override-applicable branch November 23, 2026 13:55
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.23.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show "override..." only where it makes sense

1 participant