Aller au contenu

omnilab/worms Référence de l’API

Étage
Fournisseur · Omnilab
Version
1.x
Suite de conformité
non branchée
Vérifié en réel
Son README ne le dit pas
Licence
MIT
composer require omnilab/worms:1.x-dev

Lue dans les fichiers PHP du paquet au commit 9bf4fb209674 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnilab\Worms

  • WormsSource class

    WoRMS, the World Register of Marine Species (VLIZ), through its REST service (www.marinespecies.org/rest): a taxon by its AphiaID, its name, or the ITIS TSN, NCBI taxon or IUCN id WoRMS knows it by - its accepted name and status, its classification, its synonyms, its vernacular names, WoRMS's habitat flags and the citation it asks for; its ITIS, NCBI and IUCN ids as cross-references; its parent, its accepted name and its synonyms as related things. A search of names, 50 a page.

    5 methods · 3 constants

  • WormsSourceFactory class

    WoRMS: marine taxa by AphiaID, name or an ITIS, NCBI or IUCN id, with their classification, synonyms, vernacular names and cross-references - no key needed.

    8 options

Omnilab\Worms

WormsSource class

final class WormsSource extends HttpSource WormsSource.php:33

WoRMS, the World Register of Marine Species (VLIZ), through its REST service (www.marinespecies.org/rest): a taxon by its AphiaID, its name, or the ITIS TSN, NCBI taxon or IUCN id WoRMS knows it by - its accepted name and status, its classification, its synonyms, its vernacular names, WoRMS's habitat flags and the citation it asks for; its ITIS, NCBI and IUCN ids as cross-references; its parent, its accepted name and its synonyms as related things. A search of names, 50 a page.

No key, no published rate; each call takes one to three seconds, and a taxon read whole takes up to seven (the record, its classification, synonyms, vernaculars, and one call per external id): the options leave out what is not needed.

const BASE_URI = 'https://www.marinespecies.org/rest/'
const MAX_PER_PAGE = 50

WoRMS's page: 50 records.

const EXTERNAL_IDS = ['tsn' => Scheme::ITIS, 'ncbi' => Scheme::NCBI_TAXON, 'iucn' => Scheme::IUCN]

The external ids read by default, each a call: WoRMS's type => the core's scheme.

WormsSource::__construct()

public function __construct(HttpClientInterface $http, readonly bool $classification = true, readonly bool $synonyms = true, readonly bool $vernaculars = true, readonly array $externalIds = ['tsn', 'ncbi', 'iucn'], readonly ?string $language = 'eng', readonly bool $marineOnly = false, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 0.0)
$externalIds

the external ids read (tsn, ncbi, iucn), one call each

$language

the vernacular names kept, by ISO 639-3 code (eng, fra...); null: all

WormsSource::getName()

public function getName(): string

WormsSource::capabilities()

public function capabilities(): array

WormsSource::entity()

public function entity(Identifier|string $id): ?Entity

A taxon by its AphiaID (137094, worms:137094, its LSID, its page), by an ITIS TSN, an NCBI taxon or an IUCN id WoRMS holds (an Identifier, itis:180438), or by its exact scientific name (the accepted usage first when the name has several): the record as WoRMS keeps it - an unaccepted name is itself, its accepted name related -, then what the options ask for.

public function search(Query $query): Page

WoRMS's names that begin with the text (like=true), accepted or not, in WoRMS's order, page by offset (50 a page at most); the total is not known. A domain other than taxonomy answers nothing.

WormsSourceFactory class

final class WormsSourceFactory extends SourceFactory WormsSourceFactory.php:26

WoRMS: marine taxa by AphiaID, name or an ITIS, NCBI or IUCN id, with their classification, synonyms, vernacular names and cross-references - no key needed.

options: mailto: 'support@glitchr.io' # in the User-Agent classification: true # the lineage (a call) synonyms: true # the synonyms (a call) vernaculars: true # the vernacular names (a call) external_ids: [tsn, ncbi, iucn] # the cross-references read, a call each language: eng # the vernacular names kept (ISO 639-3); null: all marine_only: false # names and searches among marine taxa only throttle: 0 # seconds between two calls: WoRMS publishes no rate base_uri: 'https://www.marinespecies.org/rest/'

Options

OptionDefault
classificationtrue
synonymstrue
vernacularstrue
external_ids['tsn', 'ncbi', 'iucn']
language'eng'
marine_onlyfalse
throttle0.0
base_uriWormsSource::BASE_URI