Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print key and api/key interaction with internal key otus/links #4145

Closed
kleintom opened this issue Dec 9, 2024 · 2 comments
Closed

Print key and api/key interaction with internal key otus/links #4145

kleintom opened this issue Dec 9, 2024 · 2 comments

Comments

@kleintom
Copy link
Contributor

kleintom commented Dec 9, 2024

I'm not sure if this is a feature request or intended behavior:

  1. Create a key that has an otu or link set on a non-leaf (non-root) node.
  2. Print the key/serve it via the api

Actual result: the printed key prints the otu else link else the next couplet number:

if l.otu
d.merge!(
target_label: ( l.otu ? label_for_otu(l.otu) : nil ),
target_id: l.otu&.id,
target_type: '/api/v1/otus', # some concept of pointing to the
)
elsif l.link_out_text
d.merge!(
target_label: l.link_out_text,
target_type: :link_out,
target_link: l.link_out
)
else
d.merge!(
target_label: metadata.dig(l.id, :couplet_number),
target_type: :internal,
)
end

Expected result: all three of those things could be present on an internal lead and displayed somehow.

The use case I have in mind would be something like a key to the species of a family where when you get to a point in the key where a genus is determined you would set the genus otu and/or a link to some external resource for that genus on the lead that determines that genus.

@mjy
Copy link
Member

mjy commented Dec 9, 2024

Thanks @kleintom. The use of labels a waypoint/signpost indicators rather than leaf/terminal labels is certainly concievable, however I do think the three options are logically distinct enough that it's OK to treat them this way. Link-wise when I get to the end I want to got to where I am directed, not decide what to do next, so providing an OTU and link-out conflicts a little with this, it sacrifices certainty for "what next". Let's see what happens when the keys may it into the wild?

@kleintom
Copy link
Contributor Author

Let's see what happens when the keys may it into the wild?

Sounds good.

I think there's an issue then if somebody does add an otu or link to a non-root lead (there's currently nothing in the editor to prevent this, maybe there should be?): when the key prints it will print the otu/link at that lead instead of the couplet number to go to next. Example here: https://sandbox.taxonworks.org/tasks/leads/print?lead_id=9

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

No branches or pull requests

2 participants