Class MiriamLink

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

public class MiriamLink extends Object
Singleton local MIRIAM data resolver with all methods static.
Author:
rodche
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    package name for jaxb to use
    static boolean
     
    static boolean
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Default constructor: initialization of some parameters
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    checkRegExp(String identifier, String datatype)
    Checks if the identifier given follows the regular expression of its data type (also provided).
    static boolean
    Check whether Miriam contains a data type record with this name (any synonym) or identifier (case insensitive)
    static boolean
    containsUri(String searchUri)
    Check whether Miriam contains a data type record with this URI (case sensitive)
    static String
    Deprecated.
    this method applies URLDecoder.decode(String) to the last part of the URN, which may not always work as expected (test yours!)
    static String[]
    getDataResources(String datatypeKey)
    Retrieves home page URLs of a datatype.
    static net.biomodels.miriam.Miriam.Datatype
    getDatatype(String datatypeKey)
    Gets Miriam Datatype by its ID, Name, Synonym, or URI (URN/URL)
    static String
    getDataTypeDef(String datatypeKey)
    Retrieves the definition of a data type.
    static String
    Retrieves the pattern (regular expression) used by the identifiers within a data type.
    static String[]
    Retrieves the internal identifier (stable and perennial) of all the data types (for example: "MIR:00000005").
    static String[]
    Retrieves the list of preferred names of all the data types available.
    static String
    getDataTypeURI(String datatypeKey)
    Retrieves the unique (official) URI of a data type (example: "urn:miriam:uniprot").
    static String[]
    getDataTypeURIs(String datatypeKey)
    Retrieves all the URIs of a data type, including all the deprecated ones (examples: "urn:miriam:uniprot", "http://www.uniprot.org/", "urn:lsid:uniprot.org:uniprot", ...).
    static String
    Gets the Identifiers.org URI/URL of the entity (example: "http://identifiers.org/obo.go/GO:0045202").
    static String[]
    getLocations(String datatypeKey, String entityId)
    Retrieves the physical locationS (URLs) of web pageS providing knowledge about an entity.
    static String
    getName(String datatypeKey)
    Retrieves the preferred name of a data type.
    static String[]
    getNames(String datatypeKey)
    Retrieves all the synonyms (incl.
    static String
    Deprecated.
    use getDataTypeURI instead
    static String
    getOfficialDataTypeURI(net.biomodels.miriam.Miriam.Datatype datatype)
    Retrieves the unique (official) URI of a data type (example: "http://identifiers.org/uniprot").
    static net.biomodels.miriam.Resource
    getResource(String resourceId)
    Retrieves the resource by id (for example: "MIR:00100008" (bind) ).
    static String
    Retrieves the institution which manages a resource (example: "European Bioinformatics Institute").
    static String
    Retrieves the location (or country) of a resource (example: "United Kingdom").
    static String[]
    Retrieves the internal identifier (stable and perennial) of all the resources (for example: "MIR:00100008" (bind) ).
    static String
    Retrieves the current version of MIRIAM Web Services.
    static String
    getURI(String name, String id)
    Retrieves the unique MIRIAM URI of a specific entity (example: "urn:miriam:obo.go:GO%3A0045202").
    static boolean
    To know if a URI of a data type is deprecated.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BINDING

      public static final String BINDING
      package name for jaxb to use
      See Also:
    • useObsoleteDatatypes

      public static boolean useObsoleteDatatypes
    • useObsoleteResources

      public static boolean useObsoleteResources
  • Constructor Details

    • MiriamLink

      protected MiriamLink()
      Default constructor: initialization of some parameters
  • Method Details

    • getServicesVersion

      public static String getServicesVersion()
      Retrieves the current version of MIRIAM Web Services.
      Returns:
      Current version of the Web Services
    • getDataTypeURI

      public static String getDataTypeURI(String datatypeKey)
      Retrieves the unique (official) URI of a data type (example: "urn:miriam:uniprot").
      Parameters:
      datatypeKey - - ID, name, synonym, or (incl. deprecated) URI (URN or URL) of a data type (examples: "UniProt")
      Returns:
      unique URI of the data type
      Throws:
      IllegalArgumentException - when datatype not found
    • getDataTypeURIs

      public static String[] getDataTypeURIs(String datatypeKey)
      Retrieves all the URIs of a data type, including all the deprecated ones (examples: "urn:miriam:uniprot", "http://www.uniprot.org/", "urn:lsid:uniprot.org:uniprot", ...).
      Parameters:
      datatypeKey - name (or synonym), ID, or URI (URN or URL) of the data type (examples: "ChEBI", "UniProt")
      Returns:
      all the URIs of a data type (including the deprecated ones)
      Throws:
      IllegalArgumentException - when datatype not found
    • getResourceLocation

      public static String getResourceLocation(String resourceId)
      Retrieves the location (or country) of a resource (example: "United Kingdom").
      Parameters:
      resourceId - identifier of a resource (example: "MIR:00100009")
      Returns:
      the location (the country) where the resource is managed
    • getResourceInstitution

      public static String getResourceInstitution(String resourceId)
      Retrieves the institution which manages a resource (example: "European Bioinformatics Institute").
      Parameters:
      resourceId - identifier of a resource (example: "MIR:00100009")
      Returns:
      the institution managing the resource
    • getURI

      public static String getURI(String name, String id)
      Retrieves the unique MIRIAM URI of a specific entity (example: "urn:miriam:obo.go:GO%3A0045202").
      Parameters:
      name - - name, URI/URL, or ID of a data type (examples: "ChEBI", "MIR:00000005")
      id - identifier of an entity within the data type (examples: "GO:0045202", "P62158")
      Returns:
      unique standard MIRIAM URI of a given entity
      Throws:
      IllegalArgumentException - when datatype not found
    • getDataTypeDef

      public static String getDataTypeDef(String datatypeKey)
      Retrieves the definition of a data type.
      Parameters:
      datatypeKey - - ID, name or URI (URN or URL) of a data type
      Returns:
      definition of the data type
      Throws:
      IllegalArgumentException - when datatype not found
    • getLocations

      public static String[] getLocations(String datatypeKey, String entityId)
      Retrieves the physical locationS (URLs) of web pageS providing knowledge about an entity.
      Parameters:
      datatypeKey - name (can be a synonym), ID, or URI of a data type (examples: "Gene Ontology", "UniProt")
      entityId - identifier of an entity within the given data type (examples: "GO:0045202", "P62158")
      Returns:
      physical locationS (URL templates) of web pageS providing knowledge about the given entity
      Throws:
      IllegalArgumentException - when datatype not found
    • getDataResources

      public static String[] getDataResources(String datatypeKey)
      Retrieves home page URLs of a datatype.
      Parameters:
      datatypeKey - - name (can be a synonym), ID, or URI (URL or URN) of a data type
      Returns:
      array of strings containing all the address of the main page of the resources of the data type
      Throws:
      IllegalArgumentException - when datatype not found
    • isDeprecated

      public static boolean isDeprecated(String uri)
      To know if a URI of a data type is deprecated.
      Parameters:
      uri - (URN or URL) of a data type
      Returns:
      answer ("true" or "false") to the question: is this URI deprecated?
    • getDataTypePattern

      public static String getDataTypePattern(String datatypeKey)
      Retrieves the pattern (regular expression) used by the identifiers within a data type.
      Parameters:
      datatypeKey - data type ID, name (or synonym), or URI (URL or URN)
      Returns:
      pattern of the data type
      Throws:
      IllegalArgumentException - when datatype not found
    • getName

      public static String getName(String datatypeKey)
      Retrieves the preferred name of a data type.
      Parameters:
      datatypeKey - URI (URL or URN), ID, or nickname of a data type
      Returns:
      the common name of the data type
      Throws:
      IllegalArgumentException - when not found
    • getNames

      public static String[] getNames(String datatypeKey)
      Retrieves all the synonyms (incl. the preferred name) of a data type.
      Parameters:
      datatypeKey - ID, any name, or URI (URL or URN) of a data type
      Returns:
      all the data type's synonyms (incl. preferred name)
    • getDataTypesName

      public static String[] getDataTypesName()
      Retrieves the list of preferred names of all the data types available.
      Returns:
      list of names of all the data types
    • getDataTypesId

      public static String[] getDataTypesId()
      Retrieves the internal identifier (stable and perennial) of all the data types (for example: "MIR:00000005").
      Returns:
      list of the identifier of all the data types
    • getOfficialDataTypeURI

      public static String getOfficialDataTypeURI(String uri)
      Deprecated.
      use getDataTypeURI instead
      Retrieves the official URI (it will always be URN) of a data type corresponding to the deprecated one.
      Parameters:
      uri - deprecated URI (URN or URL) of a data type
      Returns:
      the official URI of a data type corresponding to the deprecated one
    • 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" if the identifier follows the regular expression, "false" otherwise
      Throws:
      IllegalArgumentException - when datatype not found
    • getOfficialDataTypeURI

      public static String getOfficialDataTypeURI(net.biomodels.miriam.Miriam.Datatype datatype)
      Retrieves the unique (official) URI of a data type (example: "http://identifiers.org/uniprot").
      Parameters:
      datatype - net.biomodels.miriam.Miriam.Datatype
      Returns:
      URI
    • getDatatype

      public static net.biomodels.miriam.Miriam.Datatype getDatatype(String datatypeKey)
      Gets Miriam Datatype by its ID, Name, Synonym, or URI (URN/URL)
      Parameters:
      datatypeKey - - a datatype ID, name, synonym, or URI
      Returns:
      MIRIAM Datatype bean
      Throws:
      IllegalArgumentException - when not found
    • getResourcesId

      public static String[] getResourcesId()
      Retrieves the internal identifier (stable and perennial) of all the resources (for example: "MIR:00100008" (bind) ).
      Returns:
      list of the identifiers of all data types
    • getResource

      public static net.biomodels.miriam.Resource getResource(String resourceId)
      Retrieves the resource by id (for example: "MIR:00100008" (bind) ).
      Parameters:
      resourceId - - resource identifier (similar to, but not a data type identifier!)
      Returns:
      MIRIAM Resource bean
    • containsIdOrName

      public static boolean containsIdOrName(String searchKey)
      Check whether Miriam contains a data type record with this name (any synonym) or identifier (case insensitive)
      Parameters:
      searchKey - - ID, name, or synonym (case insensitive)
      Returns:
      true/false
    • containsUri

      public static boolean containsUri(String searchUri)
      Check whether Miriam contains a data type record with this URI (case sensitive)
      Parameters:
      searchUri - - URI (case sensitive)
      Returns:
      true/false
    • convertUrn

      public static String convertUrn(String urn)
      Deprecated.
      this method applies URLDecoder.decode(String) to the last part of the URN, which may not always work as expected (test yours!)
      Converts a MIRIAM URN into its equivalent Identifiers.org URL.
      Parameters:
      urn - - an existing Miriam URN, e.g., "urn:miriam:obo.go:GO%3A0045202"
      Returns:
      the Identifiers.org URL corresponding to the data URN, e.g., "http://identifiers.org/obo.go/GO:0045202"
      See Also:
    • getIdentifiersOrgURI

      public static String getIdentifiersOrgURI(String name, String id)
      Gets the Identifiers.org URI/URL of the entity (example: "http://identifiers.org/obo.go/GO:0045202").
      Parameters:
      name - - name, URI/URL, or ID of a data type (examples: "ChEBI", "MIR:00000005")
      id - identifier of an entity within the data type (examples: "GO:0045202", "P62158")
      Returns:
      Identifiers.org URL for the id
      Throws:
      IllegalArgumentException - when datatype not found