HTML::...species(3pm)

πŸ’– HTML::Microformats::Format::species β€” the species microformat πŸ’–

okay bestie, sit down, hydrate, because we're talking about HTML::Microformats::Format::species β€” a Perl module from the HTML::Microformats family (it lives in the 3pm man pages, if you were wondering where to find it). It does exactly one job and it does it slayfully: it pulls the species microformat out of your HTML. biology girlies, this one's for you πŸ¦‹πŸŒΈ


✨ SYNOPSIS ✨

here's the vibe, copy-paste ready:

use HTML::Microformats::DocumentContext;
use HTML::Microformats::Format::hCard;

my $context = HTML::Microformats::DocumentContext->new($dom, $uri);
my @objects = HTML::Microformats::Format::species->extract_all(
                  $dom->documentElement, $context);
foreach my $species (@objects)
{
  print $species->get_binomial . "\n";
}

like. you build a context, you extract_all off the $dom->documentElement, and then for each lil species object you go grab get_binomial and print it. chef's kiss, no notes πŸ’…


🌈 DESCRIPTION 🌈

HTML::Microformats::Format::species is a child class of HTML::Microformats::Format β€” it inherits everything from its parent, periodt. So if you're wondering about the property getter/setter methods, the constructors, all of that ✨ infrastructure ✨ β€” go read the base class definition, because it's all described there. this module is not gonna re-explain its mom's whole thing.


🧚 MICROFORMAT 🧚

so, real talk: the species documentation over at <http://microformats.org/wiki/species> is very sketchy (that's a direct quote, bestie, we're not exaggerating). so this module is aiming to be roughly compatible with two things:

  • the way the species implementation works in the Operator extension for Firefox
  • data published by the BBC and Wikipedia

and here are some brief notes on how it's been implemented:

  • The root class name is 'biota'. 🌱
  • The important properties are 'vernacular' β€” which has the aliases 'common-name', 'cname' and 'fn' β€” plus 'binomial', 'trinomial' and 'authority'.
  • Also recognised: 'class', 'division', 'family', 'genus', 'kingdom', 'order', 'phylum', 'species' and various other ranks. (the whole taxonomy tree said hi πŸ‘‘)
  • Because some of those property names are pretty generic (looking at you, class), you can alternatively use them in a prefixed form: 'taxo-class', 'taxo-division', etc. handy when the plain name would clash with something else.
  • If an element with class 'biota' has no recognised properties within it, then the entire contents of the element get taken as a binomial name. which is how you get extremely simple markup like this:
<i class="biota">Homo sapiens</i>
  • The meaning of some terminology differs between botanists and zoologists 😭 so you can add the class 'botany' or 'zoology' to the root element to clarify which usage you mean. e.g.
<i class="biota zoology">Homo sapiens</i>

and here's a full example, look at her go:

<span class="biota zoology">
  <i class="binomial">
    <span class="genus">Homo</span>
    <span class="species">sapiens</span>
    <span class="subspecies">sapiens</span>
  </i>
  (<span class="authority">Linnaeus, 1758</span>)
  a.k.a. <span class="vernacular">Humans</span>
</span>

genus, species, subspecies, authority, vernacular β€” all nested up in there. it's giving taxonomy Pinterest board. 🌸


πŸ”₯ RDF OUTPUT πŸ”₯

RDF output uses the Biological Taxonomy Vocabulary 0.2, which lives at <http://purl.org/NET/biol/ns#>. that's the namespace, bestie, write it down. πŸ“


πŸ’€ BUGS πŸ’€

found a bug? please report any bugs to <http://rt.cpan.org/>. do it for the culture 🫢


πŸ‘€ SEE ALSO πŸ‘€

  • HTML::Microformats::Format
  • HTML::Microformats

go read the family, iykyk.


πŸŽ€ AUTHOR πŸŽ€

Toby Inkster <tobyink@cpan.org>. iconic behavior, honestly.


Copyright 2008-2012 Toby Inkster

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


🚨 DISCLAIMER OF WARRANTIES 🚨

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

like, no promises, no cap. if it breaks, it breaks. 😭


and that's the whole page, bestie β€” this one came from perl v5.32.1 and the page itself is dated 2021-09-12. mwah πŸ’…βœ¨

πŸ“¦ where this page comes from