Package org.gbif.api.util
Class IdentifierUtils
- java.lang.Object
-
- org.gbif.api.util.IdentifierUtils
-
public class IdentifierUtils extends Object
This class contains utility methods for identifiers. Currently there are 3 separate Identifier classes: 1) org.gbif.api.model.checklistbank.Identifier 2) org.gbif.api.model.common.Identifier 3) org.gbif.api.model.registry.Identifier Methods common to 2 or more classes should be listed here.
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
CLB_DATASET_KEY_PATTERN
static Pattern
ISIL_PATTERN
static Pattern
ROR_PATTERN
static Pattern
WIKIDATA_PATTERN
-
Constructor Summary
Constructors Constructor Description IdentifierUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getIdentifierLink(String identifier, IdentifierType type)
Creates a http link for an identifier if possible by passing it to some known resolvers for the specific id type.static boolean
isValidCitesIdentifier(String identifier)
CITES identifier validation according to https://cites.org/eng/common/reg/e_si.html.static boolean
isValidCLBDatasetKey(String identifier)
static boolean
isValidISILIdentifier(String identifier)
ISIL identifier validation according to https://slks.dk/english/work-areas/libraries-and-literature/library-standards/structurestatic boolean
isValidRORIdentifier(String identifier)
static boolean
isValidWikidataIdentifier(String identifier)
-
-
-
Field Detail
-
WIKIDATA_PATTERN
public static final Pattern WIKIDATA_PATTERN
-
ROR_PATTERN
public static final Pattern ROR_PATTERN
-
ISIL_PATTERN
public static final Pattern ISIL_PATTERN
-
CLB_DATASET_KEY_PATTERN
public static final Pattern CLB_DATASET_KEY_PATTERN
-
-
Constructor Detail
-
IdentifierUtils
public IdentifierUtils()
-
-
Method Detail
-
getIdentifierLink
@Nullable public static String getIdentifierLink(String identifier, IdentifierType type)
Creates a http link for an identifier if possible by passing it to some known resolvers for the specific id type. If no link can be constructed, null is returned.- Parameters:
identifier
- Identifier's identifiertype
- Identifier's type- Returns:
- the url or null if it cannot be created
-
isValidCitesIdentifier
public static boolean isValidCitesIdentifier(String identifier)
CITES identifier validation according to https://cites.org/eng/common/reg/e_si.html.
-
isValidWikidataIdentifier
public static boolean isValidWikidataIdentifier(String identifier)
-
isValidRORIdentifier
public static boolean isValidRORIdentifier(String identifier)
-
isValidISILIdentifier
public static boolean isValidISILIdentifier(String identifier)
ISIL identifier validation according to https://slks.dk/english/work-areas/libraries-and-literature/library-standards/structure
-
isValidCLBDatasetKey
public static boolean isValidCLBDatasetKey(String identifier)
-
-