Package org.biopax.paxtools.normalizer
Class Resolver
java.lang.Object
org.biopax.paxtools.normalizer.Resolver
Singleton bio identifier resolver utility.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckRegExp(String identifier, String datatype) Checks if the identifier given follows the regular expression of its data type (also provided).static StringBuilds a normalized CURIE (Compact URI/ID) of the biochemical entity from the collection name/synonym and bio id.static NamespacegetNamespace(String key) Gets Namespace by its Name, Prefix, URI (URN/URL), known synonym or misspelling.static NamespacegetNamespace(String key, boolean allowVariants) Gets Namespace by its Name, Prefix, URN/URL, or (optionally) spelling variant or synonymGets the unmodifiable map of the bio identifier types registry records.Gets the unmodifiable map - mapping a sanitized id-type name/variant/synonym (non-alphanumeric chars are removed) to the corresponding namespace prefix.Gets the unmodifiable map - mapping an identifier type synonym to the corresponding namespace prefix.static StringBuilds a URI of the bioentity (e.g., "http://bioregistry.io/go:0045202") from the collection name/synonym and bio id.static booleanisKnownNameOrVariant(String name) static voidsetSpellmap(Map<String, String> map) Customize the mapping from a bio identifier type name/variant/synonym (non-alphanumeric chars should be removed) to the corresponding record/namespace prefix.static voidsetSynonymap(Map<String, String> map) Customize the mapping from a bio identifier type synonym to the corresponding namespace prefix.
-
Field Details
-
BIOREGISTRY_IO
- See Also:
-
BIOREGISTRY_JSON_URL
- See Also:
-
-
Constructor Details
-
Resolver
protected Resolver()
-
-
Method Details
-
checkRegExp
Checks if the identifier given follows the regular expression of its data type (also provided).- Parameters:
identifier- internal identifier used by the data typedatatype- name, synonym or URI of a data type- Returns:
- "true" when datatype is recognized, and identifier either matches the pattern or there's no pattern
-
getNamespace
Gets Namespace by its Name, Prefix, URI (URN/URL), known synonym or misspelling.- Parameters:
key- a datatype name, prefix or URN/URL (case insensitive)- Returns:
- Namespace bean or null
-
getNamespace
Gets Namespace by its Name, Prefix, URN/URL, or (optionally) spelling variant or synonym- Parameters:
key- a name (case insensitive)allowVariants- to allow or not searching with some known synonyms/misspellings- Returns:
- Namespace bean or null
-
getURI
Builds a URI of the bioentity (e.g., "http://bioregistry.io/go:0045202") from the collection name/synonym and bio id.- Parameters:
name- - name, URI, or ID of a data collection (examples: "ChEBI", "go")id- identifier of an entity within the data type (examples: "GO:0045202" or "0045202", "P62158")- Returns:
- URI (without the protocol prefix)
-
getCURIE
Builds a normalized CURIE (Compact URI/ID) of the biochemical entity from the collection name/synonym and bio id.- Parameters:
name- bio namespace/db/collection nameid- bio identifier- Returns:
- CURIE
-
getNamespaces
Gets the unmodifiable map of the bio identifier types registry records.- Returns:
- prefix to Namespace object map
-
getSpellmap
Gets the unmodifiable map - mapping a sanitized id-type name/variant/synonym (non-alphanumeric chars are removed) to the corresponding namespace prefix. All the key/values are upper case.- Returns:
- "sanitized" variant to prefix map
-
setSpellmap
Customize the mapping from a bio identifier type name/variant/synonym (non-alphanumeric chars should be removed) to the corresponding record/namespace prefix. All the key/values should be stored in upper case. -
getSynonymap
Gets the unmodifiable map - mapping an identifier type synonym to the corresponding namespace prefix. All the key/values are upper case.- Returns:
- synonym to prefix map
-
setSynonymap
Customize the mapping from a bio identifier type synonym to the corresponding namespace prefix. All the key/values should be stored in upper case. -
isKnownNameOrVariant
- Parameters:
name- bio identifiers type/collection name- Returns:
- true when a namespace can be found by this name or after all non-alphanumeric chars get removed
-