Template talk:Taxonbar

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

{{Taxonbar}} (edit talk history links # /subpages /doc /doc edit /sbox /sbox diff /test)

Updating Wikidata so synonyms appear automatically in taxonbar[edit]

What's the right way to do this? I know I've seen taxonbars automatically pull one or more additional IDs from Wikidata; I've just been manually adding |from#= to the taxonbar but I'd like to upgrade my taxon-fu... - UtherSRG (talk) 12:04, 6 February 2024 (UTC)[reply]

It does, or should, automatically add the basionym and original combination. After getting the |from= parameters,the code in Module:Taxonbar has the following blocks:
  • --Append basionym to arg list, if not already provided (lines 330-350)
  • --Append original combination to arg list, if not already provided (lines 352-372)
  • --Append monotypic genus/species to arg list of monotypic species/genus, if not already provided
  • --Setup navbox
I'm reluctant to touch the main loops, but if there is another wikidata synonym you want to add, adding an additional synonym block modelled on the basionym block should be possible. Is there a particular example you have in mind? —  Jts1882 | talk  13:51, 6 February 2024 (UTC)[reply]
I meant on the Wikidata side, not the taxonbar side. Ok. I think basionym is the tag I'm looking for over there. Thanks! - UtherSRG (talk) 13:56, 6 February 2024 (UTC)[reply]
Oops, misread that. The code blocks look for basionym (P566) and original combination (P1403). —  Jts1882 | talk  14:05, 6 February 2024 (UTC)[reply]
I should be able to cut this list down to a small handful in just a few days with this info, right? ;) - UtherSRG (talk) 14:11, 6 February 2024 (UTC)[reply]
Does it also grab taxonomic type (P427) for monotypics? - UtherSRG (talk) 14:12, 6 February 2024 (UTC)[reply]
Just tested and it does not. What's the right way to get monotypics to show? (Testing with Aaata (Q15732490).) - UtherSRG (talk) 14:14, 6 February 2024 (UTC)[reply]
Looks like there is a TODO block (lines 423-429) for that. It has detected an instance of monotypic taxon with rank = genus. It has the comment "is monotypic genus; add species (no way to easily find these (yet?))", but the taxonomic type would do it, at least for Aaata (Q15732490). —  Jts1882 | talk  14:37, 6 February 2024 (UTC)[reply]
Yeah, I added the taxo-type to Aaata. Ok. Do you have bandwidth to complete the TODO? - UtherSRG (talk) 14:40, 6 February 2024 (UTC)[reply]
Possibly, but Tom.Reding is on top of this sort of thing. —  Jts1882 | talk 
It should probably also pull from taxon synonym (P1420), but it's not even pulling from basionym (P566) (testing with Abarema zolleriana (Q52626871)). - UtherSRG (talk) 14:58, 6 February 2024 (UTC)[reply]
@UtherSRG: basionym (P566) are only pulled from a page's linked wikidata item, in this case Abarema zollerana (Q4663507) (no basionym available), and not Abarema zolleriana (Q52626871) (basionym available).   ~ Tom.Reding (talkdgaf)  15:23, 6 February 2024 (UTC)[reply]
Abarema zolleriana (Q52626871) has a basionym (P566) of Pithecellobium zollerianum (Q39105392) and a taxon synonym (P1420) of Abarema zollerana (Q4663507). We get neither in the taxonbar automatically. I think we should get both, or at the very least the taxon synonym (P1420). Or are we specifically limiting this for some reason? - UtherSRG (talk) 15:42, 6 February 2024 (UTC)[reply]
Oh wait... linked data item. Yes, ok. I changed the linked item and the basionym comes through now. Ok. Whew! :) So yeah, how about the P1420? - UtherSRG (talk) 15:56, 6 February 2024 (UTC)[reply]
@UtherSRG: for taxon synonym (P1420), see the Template:Taxonbar#Module editing — to-don't list :)   ~ Tom.Reding (talkdgaf)  16:08, 6 February 2024 (UTC)[reply]
Specifically denied. Alrighty then. What about the TODO block for lines 423-429 to grab monotypics? - UtherSRG (talk) 16:11, 6 February 2024 (UTC)[reply]
 Done! Thanks Jts1882 & UtherSRG! I've been waiting 6 years to add that functionality! I wonder why taxonomic type (P427) took so long to discover...   ~ Tom.Reding (talkdgaf)  17:48, 6 February 2024 (UTC)[reply]
Faboo! :) Just tested on Aaata. Mostly a success! :) Aaata is monotypic, and now its only species automatically shows up. However, the species has an original combination, and that does not show up automatically. Should it? Could it? Would you? Could you? - UtherSRG (talk) 17:55, 6 February 2024 (UTC)[reply]
@UtherSRG: we don't add basionym (P566) nor original combination (P1403) from non-wikidata-linked items, presumably because that would inflate the taxonbar size. It can be done, of course, if there's broad consensus to do so.   ~ Tom.Reding (talkdgaf)  18:10, 6 February 2024 (UTC)[reply]
Right, but if the article were Aaata finchi, they would be added, but because the genus is monotypic, they aren't added. I understand there must be a cut-off at some point, but I think for a monotypic it make sense. I would certainly say "no" to pulling in all synonyms automagically, but the original combination (or basionym) for a monotypic's type seems the right boundary to set. - UtherSRG (talk) 18:33, 6 February 2024 (UTC)[reply]

@UtherSRG: I don't think it's necessary, nor advantageous, to remove the now-automatically-added monotype. We use |from= as a hedge against random wikidata bots accidentally (usually) unlinking or changing wikidata's links to the wikipedia page. |from2= serves the same purpose now with the monotypic species/genera.   ~ Tom.Reding (talkdgaf)  18:21, 6 February 2024 (UTC)[reply]

Fair enough. Will auto-added IDs be caught in a cleanup category so we can manually add them? - UtherSRG (talk) 18:35, 6 February 2024 (UTC)[reply]
@UtherSRG: thank you! All pages in Category:Taxonbars with automatically added monotypic species (0) / Category:Taxonbars with automatically added monotypic genera (0) should also belong to Category:Taxonbars with multiple manual Wikidata items (17,167) once they have their monotype added to (typically) |from2=. This isn't a perfect filter though, since there can be a "random" ID in |from2= or |fromX= (it doesn't matter which |fromX= the monotype is in), so I'm thinking of creating something like Category:Taxonbars of monotypic taxa missing from2. What do you think about extending what we've done here to monotypic families? How high in rank should we go? Should the check always be from parent to child? Category:Taxonbars with automatically added monotypic genera (0) might have to be repurposed to mean families with automatically added monotypic genera, as opposed to its current (empty) usage, or continue to use it as an error tracking cat (it had many pages in it when it was first made)? Will probably let this stew here for a bit here for more input.   ~ Tom.Reding (talkdgaf)  19:16, 6 February 2024 (UTC)[reply]
As I said in a recent edit summary: "It's froms all the way down!" :) Yes, I think we should extend the concept. And now I fully understand why species articles in monotypic genera are moved to the genus name. Yes, we should only check from parent to child, and multi-monotypics (what a concept!) should be moved to the highest rank in the monotypic chain. (I think my recent edit was to a genus with one species that is the only genus in the family... so that should be at the family name but is currently at the genus name...) - UtherSRG (talk) 19:21, 6 February 2024 (UTC)[reply]
Is it a given that in chains of monotypic taxa, the article should be at the highest-ranked monotypic taxon? I remember a move request some time ago where the genus name was determined (via google n-gram search or something) to be more commonly used/well known than the family name, so the taxon was placed at the genus. Esculenta (talk) 18:15, 7 February 2024 (UTC)[reply]
Ugh. We might have to make a MOS for this. Barring that, we might have to search both up and down the tree. But you are correct, community discussions can overrule formal logic. ;) - UtherSRG (talk) 18:17, 7 February 2024 (UTC)[reply]
WP:MONOTYPICFLORA and WP:MONOTYPICFAUNA both say that monotypic families should be covered in an article using the genus title. Of the pages in the category tree Category:Monogeneric families, 1116 are redirects and 98 are articles. Plantdrew (talk) 22:04, 8 February 2024 (UTC)[reply]
The community has spoken! XD Ok, we will have to search both up and down. - UtherSRG (talk) 23:53, 8 February 2024 (UTC)[reply]

@UtherSRG: what I gather from what Jts1882 said there, Aptenoperissus here (Aptenoperissus is a genus of extinct wasp with eight described species, placed into the monotypic family Aptenoperissidae), and the description for monotypic fossil taxon (Q47487597) (extinct taxonomic group which contains only one immediately subordinate taxon), is that the family should be tagged as mono, but not the genus. My comment there was made assuming all mentioned ranks were mono, but that isn't the case.   ~ Tom.Reding (talkdgaf)  19:52, 29 February 2024 (UTC)[reply]

Yup. Got it. Now... how can I find all the places (and it's a bunch) where I did it wrong. This was the only family/genus pair, but I have a bunch of genus/species pairs where I did the same thing. - UtherSRG (talk) 03:12, 1 March 2024 (UTC)[reply]
Search your user contributions on Wikidata for "monotypic" or "monotypic taxon" (76 and 49 matches, respectively, in last 500 edits). —  Jts1882 | talk  09:20, 1 March 2024 (UTC)[reply]
I know how to look at my contributions, but when I put anything into the tag bar, I don't get anything back. I can do a simple ctrl-f search, but all that does is highlight the word in my contributions. Is there a search function that will get me only the contributions that have the word "monotypic" in them? - UtherSRG (talk) 11:54, 1 March 2024 (UTC)[reply]

@Jts1882 and Tom.Reding: Ok, I remember why I thought both parent of child should be using one of the monotypic QID's... Category:Taxonbars of monotypic genera missing species explicitly says that they should. It lists four possible changes to make to depopulate an item from the category. I propose removing the genus's taxonomic type (P427) Wikidata item is not specified as an instance of (P31) monotypic taxon (Q310890) nor monotypic fossil taxon (Q47487597), and should be labeled as such from the category, and whatever code in the taxonbar checks the child item modified so that it doesn't have to have to be a monotypic QID. I started this part of the conversation on the category's talk, but Tom rightly suggested I bring the conversation here. He also said we should just get rid of the whole category altogether. I think the concept of the category is good, but I'm not sure how to properly implement it. I suppose, check that the child is listed as "subject has role" "nomenclatural type of" the parent? - UtherSRG (talk) 23:06, 12 March 2024 (UTC)[reply]

A type species does not need to be an accepted name; it may be a synonym of another species in the genus it typifies (this is true for at least the ICNafp, but I believe is true for all codes); Psilurus and Oxyrhachis are two monotypic examples. That seems really bizarre and unintuitive when it comes to a monotypic genus, but makes more sense if you consider possibilities in polytypic genera (a taxonomist with local pride describes a new polytypic genus designating a type species that is endemic to where they live; taxonomists living elsewhere consider the "endemic" to be a subspecies at best). It would be worth including a synonymous type in the taxonbar for a monotypic genus, but I guess that wouldn't solve the problem here.
Also, it isn't wrong (as far as the codes are concerned) to present a type species in its original combination. Dissochondrus lists the type species as Setaria biflora; Ixophorus lists the type species as Urochloa uniseta. Tropicos is inconsistent with Dissochondrus (type Dissochondrus bifidus) and Ixophorus] (type Urochloa uniseta), and I'm pretty shocked to have discovered that just now. I've known Wikipedia wasn't consistent in presenting type species as either original/current combinations, but hadn't considered that taxonomic databases might not be. Plantdrew (talk) 02:17, 13 March 2024 (UTC)[reply]
Apologies, that was a digression. But I don't think Wikidata has a sufficiently consistently populated properties revolving around monotypy or typification to make editing Wikidata the preferred way to resolve tracking categories related to a template (this one, Taxonbar) on English Wikipedia. If somebody (is that you, UtherSRG?) wants to work on consistently populating Wikidata properties resolving around monotypy or typification, go for it. But if a template tracking category is creating a "problem" on English Wikipedia that editors here are tempted to devote a lot of effort towards resolving (with the actual problem being tiny in the grand scheme of things), we could just drop the tracking category. Plantdrew (talk) 02:27, 13 March 2024 (UTC)[reply]
Taxonbar relies (almost?) entirely upon Wikidata, and it populates some categories to call out potential problems in both Wikipedia articles (related to taxoboxes and taxonbars) and Wikidata. I've been using some of those categories to direct my efforts. One category's description (the one I call out) led me to doing the wrong thing on Wikidata. I'm trying to find a path forward where the category can remain useful, while not leading me or others into doing something incorrect. - UtherSRG (talk) 10:46, 13 March 2024 (UTC)[reply]
Looking at the code that sets Category:Taxonbars with automatically added monotypic genera and Category:Taxonbars of monotypic species missing genera (lines 389-425), it checks an item is an instance of monotypic taxon (Q310890) or monotypic fossil taxon (Q47487597) then gets taxon rank (P105). If that is a species it gets the parent taxon (P171) and if a genus checks if it is monotypic, in which case it adds the new item for the taxonbar and the former category. If not it adds the second category. At least this is how I read the code.
My question is why is this check only done if the species is monotypic? If the species has several infraspecies, the check for monotypic genus parent would be just as useful. Could this be where the confusion came from matching monotypic species with monotypic genus? —  Jts1882 | talk  15:11, 13 March 2024 (UTC)[reply]
That may be where the wording on the category comes from. It's wrong. For "monotypic genera missing species" I think it should be:
  • Is this ID a monotypic? - if no, move on. If yes, then
    • Is this ID a genus? - if no, move on. If yes, then
      • Does this ID's taxonomic type have this ID as the nomenclatural type of? - if no, add the category
      • Does this ID's taxonomic type have this ID as its parent? - if no, add the category
The Category:Taxonbars of monotypic species missing genera should probably be removed - this category doesn't make sense. - UtherSRG (talk) 15:33, 13 March 2024 (UTC)[reply]
That all said... I wonder if we should care if the ID is a genus. Perhaps we should only care that it is a monotypic and change the cat to Category:Taxonbars of monotypic taxa missing child taxa or something similar. - UtherSRG (talk) 15:36, 13 March 2024 (UTC)[reply]

Fossilworks[edit]

Fossilworks appears to be dead. (The same id normally works for the Paleobiology database.) I suggest that Fossilworks is removed from the list of taxon identifiers picked up by the taxonbar template. Peter coxhead (talk) 17:57, 30 March 2024 (UTC)[reply]

Monster Iestyn started a discussion in the Paleobiology project talk page (Wikipedia_talk:WikiProject_Palaeontology#Fossilworks_and_Paleobiology_Database_(PBDB),_revisited) and at Wikidata (Wikiproject Taxonomy on Wikidata).
Fossilworks has gone down before but it does seem that it's no longer updated on a regular basis (despite the claim of a daily synch with the Paleobiology database).
PBDB doesn't have many entries on wikidata, so we could consider using the wikidata identifiers for Fossilworks to link to PBDB (via the module) or Wikidata may make appropriate changes at their end. —  Jts1882 | talk  18:25, 30 March 2024 (UTC)[reply]
Nothing seems to be happening over at Wikidata, so I wonder if we can make a fix here? Peter coxhead (talk) 14:32, 31 March 2024 (UTC)[reply]
What logic do we use? We want to use the Fossilworks ID with the PBDB link. It's easy to substitute the link for the fossilworks item, as I've done with this edit in the sandbox. And this edit changes the database displayed to "Fossilworks/PBDB" (this text is just for testing and can be done in Module:Taxonbar/conf). You can check the results in {{taxonbar/testcases}}. However, we also want to prevent duplicates when both fossilworks and PBDB have identifiers. —  Jts1882 | talk  16:52, 31 March 2024 (UTC)[reply]
This plus preventing duplicates definitely seems the way forward to me. Peter coxhead (talk) 06:54, 1 April 2024 (UTC)[reply]
Done in sandbox. Fossilworks has been moved in /conf file until just after PaleobioDB and linked to PaleoDB instead of Fossilworks (currently there are duplicates in live version). In the sandbox version the two entries are compared and the fossilworks one deleted if the same. Strangely the testcases uses lion, which has two entries in PBDB, and the fossilworks and PaleobioDB wikidata items return different ones. These are both displayed. Should one be deleted as the records are identical? —  Jts1882 | talk  07:53, 1 April 2024 (UTC)[reply]
Now live. In {{taxonbar/testcases}}, Canis lupus picks up PaleobioDB identifier from fossilworks entry on Wikidata, Bornean orangtang and Puma have duplicate deleted, and lion shows both values as different. —  Jts1882 | talk  08:17, 1 April 2024 (UTC)[reply]

'Exists' module misses cases where the taxonbar is commented out[edit]

I happened to notice that a page with the taxonbar commented out didn't appear in Category:Taxobox articles missing a taxonbar. Looking at Module:Taxonbar/exists and Module:Template redirect regex, I can see why not. I don't think there's any obvious fix, but this search finds pages where taxonbars have been commented out. Of course, those pages may also have taxonbars that are not commented out.

I have uncommented many examples.[1]

William Avery (talk) 07:42, 11 April 2024 (UTC)[reply]
The regex in Module:Taxonbar/exists could be modified to check for the comment, but that might be tricky. A simpler change would be to add a second search. If a taxonbar is found it check to see if it's preceded by a comment (similar to your search). It might be better to have a category for commented out taxonbars. —  Jts1882 | talk  10:34, 11 April 2024 (UTC)[reply]
I assume examples like Violet-crowned_hummingbird were commented out because the taxonbar scientific name didn't match the article scientific name. This bird was moved from Amazilia violiceps to Leucolia violiceps by Birdlife/IUCN and to Ramosomyia violiceps by ebird/BOW. It needed changes on Wikidata to work properly. It would be useful to have such cases flagged. —  Jts1882 | talk  10:53, 11 April 2024 (UTC)[reply]
I'm trying in Module:Taxonbar/exists/sandbox, but I'm unable to match <!-- for some reason... Can anyone help? See line 17 & 20 there, and Template:Taxonbar/exists/testcases/true#True.   ~ Tom.Reding (talkdgaf)  14:06, 16 April 2024 (UTC)[reply]
Don't you need braces and spaces to check before: local v_cmt_before = '%<%!%-%-%s*%{%{'..v? —  Jts1882 | talk  14:28, 16 April 2024 (UTC)[reply]
@Jts1882: not for the current testcase, which has <!--{{Taxonbar}}--> for simplicity, and braces don't need escaping in Lua (since generalized finite quantifiers {n,m} don't exist in this implementation). Regardless, I found the problem. I was using .baseText for the pagename, so the regex was running on Template:Taxonbar/exists/testcases instead of the intended Template:Taxonbar/exists/testcases/true... Shouldn't be a problem to implement now...!   ~ Tom.Reding (talkdgaf)  14:33, 17 April 2024 (UTC)[reply]
@William Avery and Jts1882:  Done! Pages with commented taxonbars should now be processed as if it doesn't exist, and be categorized accordingly.   ~ Tom.Reding (talkdgaf)  14:54, 17 April 2024 (UTC)[reply]
I fiddled about with Mesembrinella aeneiventris to see if it would go into a maintenance category, but I had no luck. William Avery (talk) 09:04, 18 April 2024 (UTC)[reply]
@Tom.Reding: I think line 10 needs deleting. —  Jts1882 | talk  11:14, 18 April 2024 (UTC)[reply]
 Oops   ~ Tom.Reding (talkdgaf)  11:19, 18 April 2024 (UTC)[reply]
I'm starting to see some of the articles with commented out taxonbars showing up in the missing category now, which I've then been able to update appropriately. Good job! - UtherSRG (talk) 14:25, 18 April 2024 (UTC)[reply]