Wikifunctions:Type proposals/Taxon rank
Summary
Wikidata enumeration representing an instance of (P31) taxonomic rank (Q427626), e.g. order, family, genus. A partial order is defined over the enumeration - most ranks may be compared to each other, but there may be some cases where two ranks may not be compared (e.g. two different ranks used between the same/similar levels, one in botany and one in zoology, but it is not clear if one is above the other or if they are the same). This should also include notho-, ichno-, and oo- ranks; these should be treated as equivalent ranks to their respective counterparts, in the partial ordering (nothogenus with genus, etc.).
Uses
- I would love to see a taxon type eventually; a taxon rank type/enum and associated functions would be helpful for this.
- Functions:
- compare taxon ranks (rank a, rank b): indicates one of 4 possible cases, a LESS THAN b, a EQUIVALENT TO b, a GREATER THAN b, a and b not comparable (error?)
- normalize taxon rank (rank): For the notho-, ichno-, and oo- variants, return their non-prefixed counterpart.
Elements of the enumeration
From this query. List could probably use some curation (117 results!), I think hearing from WD:WikiProject Taxonomy could be very helpful.
Alternatives
- "no value" could be processed into clade (Q713623), which could be included in the enumeration.
- We have a quasi-convention in Wikifunctions that a missing value is represented by filling in void (Z24) (but void (Z24) would not be part of the Taxon rank type). This would be an option for cases where an input or other key expects to have a value of this new type, but the value isn't known. If we use that convention here, functions like Compare 2 Taxon ranks would need to check for the presence of void (Z24) as an input. Would that cover the need? DMartin (WMF) (talk) 05:33, 30 September 2025 (UTC)
- I believe that would work, yes. "taxon rank: no value" should behave broadly the same as no taxon rank property present. Thank you! --WrenFalcon (talk) 02:04, 30 September 2025 (UTC)
Comments
For general comments, please reply to the proposer.
Support as proposer. --WrenFalcon (talk) 16:39, 24 September 2025 (UTC)
- Could perhaps enforce normalizing a taxon rank before passing it to a compare function, though I think that would make code longer/more complex on the calling side with no real benefit.
- What to do in the case that there's no taxon rank (usually implying it's a clade), e.g. Ophidia (Q16986904)? How would this be represented? I think in the case of a clade, it should not be comparable to any other rank, including another clade - I'm just not sure of how this implementation would handle it.
- I consider this proposal still in progress at the moment. It needs some technical questions (e.g. how would "no value" or a missing taxon rank value play with the enum, if the source of the data was a taxon item) and some data questions (what rank items to include) answered. I am looking for feedback in order to progress this proposal. --WrenFalcon (talk) 16:39, 24 September 2025 (UTC)