Skip to content

fix(choice fields): no locally minted option for external URI placeholders - #677

Merged
tkuhn merged 1 commit into
masterfrom
fix/676-no-local-minting-for-external-placeholders
Sep 3, 2026
Merged

fix(choice fields): no locally minted option for external URI placeholders#677
tkuhn merged 1 commit into
masterfrom
fix/676-no-local-minting-for-external-placeholders

Conversation

@tkuhn

@tkuhn tkuhn commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Closes #676.

The problem

Guided choice and agent fields offer a typed plain name as an identifier to be minted, shown as local:john (mint locally) (from #652). When the placeholder is also an nt:ExternalUriPlaceholder, the value has to refer to something that already exists outside the nanopublication — the validator rejects such a name with "Not an external IRI", so the option was only ever there to fail on submit.

The change

Everything is gated on Template.isExternalUriPlaceholder, which also covers nt:TrustyUriPlaceholder (equally unmintable).

  • TemplateContext.isToBeMinted returns false for an external URI placeholder, so a bare word held for such a field is no longer labelled "(mint locally)".
  • GuidedChoiceItem skips the plain-name suggestion for them.
  • AgentChoiceItem does the same, keeping URI and ORCID suggestions intact.

Placeholders without the tag are unaffected.

Tests

Both component test classes gained an external variant of their template builder plus three cases each: no plain name offered, URIs/ORCIDs still offered, no "mint locally" label. mvn test -Dtest=AgentChoiceItemTest,GuidedChoiceItemTest → 21 tests, 0 failures.

Not in this PR

The issue's second half — "templates, like view display declarations should then be changed to include ExternalPlaceholder tag" — means superseding published template nanopubs, which is a separate, non-code step.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UToMqDvcVRgpwHojAx69t1

…lders

A guided choice or agent field offers a typed plain name as an identifier
to be minted (issue #652). When the placeholder is also an
nt:ExternalUriPlaceholder, the value has to refer to something that
exists outside the nanopublication, so the validator rejects such a name
with "Not an external IRI" -- the option was only there to fail on
submit.

Skip the suggestion for external URI placeholders, and stop marking a
bare word held for such a field as "(mint locally)". URIs and ORCIDs
stay on offer; nothing changes for placeholders without the tag.

Closes #676

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UToMqDvcVRgpwHojAx69t1
@tkuhn
tkuhn merged commit 13817cd into master Sep 3, 2026
8 checks passed
@tkuhn
tkuhn deleted the fix/676-no-local-minting-for-external-placeholders branch September 3, 2026 06:00
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.13.0 🎉

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.

Locally minted option should not show when GuidedChoicePlaceholder is also ExternalPlaceholder

1 participant