Class Resolver

java.lang.Object
org.biopax.paxtools.normalizer.Resolver

public class Resolver extends Object
Singleton bio identifier resolver utility.
  • Field Details

  • Constructor Details

    • Resolver

      protected Resolver()
  • Method Details

    • checkRegExp

      public static boolean checkRegExp(String identifier, String datatype)
      Checks if the identifier given follows the regular expression of its data type (also provided).
      Parameters:
      identifier - internal identifier used by the data type
      datatype - 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

      public static Namespace getNamespace(String key)
      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

      public static Namespace getNamespace(String key, boolean allowVariants)
      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

      public static String getURI(String name, String id)
      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

      public static String getCURIE(String name, String id)
      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 name
      id - bio identifier
      Returns:
      CURIE
    • getNamespaces

      public static Map<String,Namespace> getNamespaces()
      Gets the unmodifiable map of the bio identifier types registry records.
      Returns:
      prefix to Namespace object map
    • getSpellmap

      public static Map<String,String> 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

      public static void setSpellmap(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. All the key/values should be stored in upper case.
    • getSynonymap

      public static Map<String,String> 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

      public static void setSynonymap(Map<String,String> map)
      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

      public static boolean isKnownNameOrVariant(String name)
      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