public class WormsClient extends Object
A client for the World Register of Marine Species REST API. Please refer to the terms of use.
Acknowledgments: The development of the WoRMS Client was funded by DFG in the scope of the LakeBase project within the Scientific Library Services and Information Systems (LIS) program.
| Constructor and Description |
|---|
WormsClient()
Constructs a
WormsClient with a default CloseableHttpClient
configured to a maximum number of 10 connections. |
WormsClient(org.apache.http.impl.client.CloseableHttpClient httpClient)
Constructs a
WormsClient using the specified
CloseableHttpClient. |
| Modifier and Type | Method and Description |
|---|---|
Collection<AttributeKey> |
aphiaAttributeKeysById(long id,
boolean includeChildren)
Get attribute definitions.
|
Collection<Attribute> |
aphiaAttributesByAphiaId(long aphiaId,
boolean includeChildren)
Get a list of attributes for a given AphiaID
|
Collection<AttributeValue> |
aphiaAttributeValuesByCategoryId(long id)
Get list values that are grouped by an CateogryID
|
Collection<AphiaRecord> |
aphiaChildrenByAphiaId(long aphiaId,
boolean marineOnly)
Get the direct children for a given AphiaID.
|
Collection<AphiaRecord> |
aphiaChildrenByAphiaId(long aphiaId,
boolean marineOnly,
long offset)
Get the direct children (max.
|
Classification |
aphiaClassificationByAphiaId(long aphiaId)
Get the complete classification for one taxon.
|
Collection<Distribution> |
aphiaDistributionsByAphiaId(long aphiaId)
Get all distributions for a given AphiaID External Identifiers
|
Collection<String> |
aphiaExternalIdByAphiaId(long aphiaId,
ExternalIdentifierSource type)
Get any external identifier(s) for a given AphiaID
|
Long |
aphiaIdByName(String scientificName)
Get the AphiaID for a given name
|
Collection<AphiaAttributeSets> |
aphiaIdsByAttributeKeyId(long id)
Get a list of AphiaIDs with attribute tree for a given attribute definition
ID Distributions.
|
Collection<AphiaAttributeSets> |
aphiaIdsByAttributeKeyId(long id,
long offset)
Get a list of AphiaIDs (max 50) with attribute tree for a given attribute
definition ID Distributions.
|
String |
aphiaNameByAphiaId(long aphiaId)
Get the name for a given AphiaID
|
AphiaRecord |
aphiaRecordByAphiaId(long aphiaId)
Get the complete AphiaRecord for a given AphiaID
|
AphiaRecord |
aphiaRecordByExternalId(String id,
ExternalIdentifierSource type)
Get the Aphia Record for a given external identifier Sources
|
Collection<AphiaRecord> |
aphiaRecordsByDate(java.time.temporal.TemporalAccessor statdate,
java.time.temporal.TemporalAccessor enddate,
boolean marineOnly)
Lists all AphiaRecords (max.
|
Collection<AphiaRecord> |
aphiaRecordsByDate(java.time.temporal.TemporalAccessor statdate,
java.time.temporal.TemporalAccessor enddate,
boolean marineOnly,
long offset)
Lists all AphiaRecords (max.
|
List<Collection<AphiaRecord>> |
aphiaRecordsByMatchNames(List<String> scientificNames,
boolean marineOnly)
For each given scientific name (may include authority), try to find one or
more AphiaRecords, using the TAXAMATCH fuzzy matching algorithm by Tony Rees.
|
Collection<AphiaRecord> |
aphiaRecordsByName(String scientificName,
boolean like,
boolean marineOnly)
Get one or more matching AphiaRecords for a given name.
|
Collection<AphiaRecord> |
aphiaRecordsByName(String scientificName,
boolean like,
boolean marineOnly,
long offset)
Get one or more matching AphiaRecords (max.
|
List<Collection<AphiaRecord>> |
aphiaRecordsByNames(List<String> scientificNames,
boolean like,
boolean marineOnly)
For each given scientific name, try to find one or more AphiaRecords (max.
|
Collection<AphiaRecord> |
aphiaRecordsByVernacular(String vernacular,
boolean like)
Get one or more Aphia Records for a given vernacular.
|
Collection<AphiaRecord> |
aphiaRecordsByVernacular(String vernacular,
boolean like,
long offset)
Get one or more Aphia Records (max.
|
Collection<Source> |
aphiaSourcesByAphiaId(long aphiaId)
Get one or more sources/references including links, for one AphiaID
|
Collection<AphiaRecord> |
aphiaSynonymsByAphiaId(long aphiaId)
Get all synonyms for a given AphiaID.
|
Collection<Vernacular> |
aphiaVernacularsByAphiaId(long aphiaId)
Get all vernaculars for a given AphiaID
|
public WormsClient()
WormsClient with a default CloseableHttpClient
configured to a maximum number of 10 connections.public WormsClient(org.apache.http.impl.client.CloseableHttpClient httpClient)
WormsClient using the specified
CloseableHttpClient.httpClient - CloseableHttpClient to usepublic Collection<AttributeKey> aphiaAttributeKeysById(long id, boolean includeChildren) throws WormsClientException
id - The attribute definition id to search forincludeChildren - Include the tree of children.WormsClientExceptionpublic Collection<Attribute> aphiaAttributesByAphiaId(long aphiaId, boolean includeChildren) throws WormsClientException
aphiaId - The AphiaID to search forincludeChildren - Include attributes inherited from the taxon its parent(s).WormsClientExceptionpublic Collection<AttributeValue> aphiaAttributeValuesByCategoryId(long id) throws WormsClientException
id - The CateogryID to search forWormsClientExceptionpublic Collection<AphiaRecord> aphiaChildrenByAphiaId(long aphiaId, boolean marineOnly) throws WormsClientException
Get the direct children for a given AphiaID.
Note: This methods might cause multiple calls of
aphiaChildrenByAphiaId(long, boolean, long) to receive all records
in chunks of 50 records.
aphiaId - The AphiaID to search formarineOnly - Limit to marine taxa.WormsClientExceptionpublic Collection<AphiaRecord> aphiaChildrenByAphiaId(long aphiaId, boolean marineOnly, long offset) throws WormsClientException
aphiaId - The AphiaID to search formarineOnly - Limit to marine taxa.offset - Starting recordnumber, when retrieving next chunk of 50 records.
First record has number 1.WormsClientExceptionpublic Classification aphiaClassificationByAphiaId(long aphiaId) throws WormsClientException
aphiaId - The AphiaID to search forWormsClientExceptionpublic Collection<Distribution> aphiaDistributionsByAphiaId(long aphiaId) throws WormsClientException
aphiaId - The AphiaID to search forWormsClientExceptionpublic Collection<String> aphiaExternalIdByAphiaId(long aphiaId, ExternalIdentifierSource type) throws WormsClientException
aphiaId - The AphiaID to search fortype - Type of external identifier to return.WormsClientExceptionpublic Long aphiaIdByName(String scientificName) throws WormsClientException
scientificName - WormsClientExceptionpublic Collection<AphiaAttributeSets> aphiaIdsByAttributeKeyId(long id) throws WormsClientException
Get a list of AphiaIDs with attribute tree for a given attribute definition ID Distributions.
Note: This methods might cause multiple calls of
aphiaIdsByAttributeKeyId(long, long) to receive all records in
chunks of 50 records.
id - The attribute definition id to search forWormsClientExceptionpublic Collection<AphiaAttributeSets> aphiaIdsByAttributeKeyId(long id, long offset) throws WormsClientException
id - The attribute definition id to search foroffset - Starting record number, when retrieving next chunk of (50)
records. First record has number 1.WormsClientExceptionpublic String aphiaNameByAphiaId(long aphiaId) throws WormsClientException
aphiaId - WormsClientExceptionpublic AphiaRecord aphiaRecordByAphiaId(long aphiaId) throws WormsClientException
aphiaId - WormsClientExceptionpublic AphiaRecord aphiaRecordByExternalId(String id, ExternalIdentifierSource type) throws WormsClientException
id - type - WormsClientExceptionpublic Collection<AphiaRecord> aphiaRecordsByDate(java.time.temporal.TemporalAccessor statdate, java.time.temporal.TemporalAccessor enddate, boolean marineOnly) throws WormsClientException
Lists all AphiaRecords (max. 50) modified or added between a specific time interval
Note: This methods might cause multiple request to receive all records in chunks of 50 records.
statdate - enddate - marineOnly - Limit to marine taxa.WormsClientExceptionpublic Collection<AphiaRecord> aphiaRecordsByDate(java.time.temporal.TemporalAccessor statdate, java.time.temporal.TemporalAccessor enddate, boolean marineOnly, long offset) throws WormsClientException
statdate - enddate - marineOnly - Limit to marine taxa.offset - Starting record number, when retrieving next chunk of (50)
records. First record has number 1.WormsClientExceptionpublic List<Collection<AphiaRecord>> aphiaRecordsByMatchNames(List<String> scientificNames, boolean marineOnly) throws WormsClientException
For each given scientific name (may include authority), try to find one or more AphiaRecords, using the TAXAMATCH fuzzy matching algorithm by Tony Rees. This allows you to (fuzzy) match multiple names in one call.
Note: This methods might cause multiple service request.
scientificNames - Names to search formarineOnly - Limit to marine taxa.WormsClientExceptionpublic Collection<AphiaRecord> aphiaRecordsByName(String scientificName, boolean like, boolean marineOnly) throws WormsClientException
Get one or more matching AphiaRecords for a given name.
Note: This methods might cause multiple calls of
aphiaRecordsByName(String, boolean, boolean, long) to receive all
records in chunks of 50 records.
scientificName - Name to search forlike - Add a "%"-sign added after the ScientificName (SQL LIKE function).marineOnly - Limit to marine taxa.WormsClientExceptionpublic Collection<AphiaRecord> aphiaRecordsByName(String scientificName, boolean like, boolean marineOnly, long offset) throws WormsClientException
scientificName - Name to search forlike - Add a "%"-sign added after the ScientificName (SQL LIKE function).marineOnly - Limit to marine taxa.offset - Starting record number, when retrieving next chunk of (50)
records. First record has number 1.WormsClientExceptionpublic List<Collection<AphiaRecord>> aphiaRecordsByNames(List<String> scientificNames, boolean like, boolean marineOnly) throws WormsClientException
scientificNames - Collection of names to search forlike - Add a "%"-sign added after the ScientificName (SQL LIKE function).marineOnly - Limit to marine taxa.WormsClientExceptionpublic Collection<AphiaRecord> aphiaRecordsByVernacular(String vernacular, boolean like) throws WormsClientException
Get one or more Aphia Records for a given vernacular.
Note: This methods might cause multiple request to receive all records in chunks of 50 records.
vernacular - The vernacular to find records forlike - Add a "%"-sign before and after the input (SQL LIKE ‘%vernacular%’
function).WormsClientExceptionpublic Collection<AphiaRecord> aphiaRecordsByVernacular(String vernacular, boolean like, long offset) throws WormsClientException
vernacular - The vernacular to find records forlike - Add a "%"-sign before and after the input (SQL LIKE ‘%vernacular%’
function).offset - Starting record number, when retrieving next chunk of (50)
records. First record has number 1.WormsClientExceptionpublic Collection<Source> aphiaSourcesByAphiaId(long aphiaId) throws WormsClientException
aphiaId - The AphiaID to search forWormsClientExceptionpublic Collection<AphiaRecord> aphiaSynonymsByAphiaId(long aphiaId) throws WormsClientException
aphiaId - The AphiaID to search forWormsClientExceptionpublic Collection<Vernacular> aphiaVernacularsByAphiaId(long aphiaId) throws WormsClientException
aphiaId - The AphiaID to search forWormsClientExceptionCopyright © 2020. All Rights Reserved.