Class ChemblCodeResolverImpl

java.lang.Object
ubic.gemma.core.ontology.chembl.ChemblCodeResolverImpl
All Implemented Interfaces:
ChemblCodeResolver

@Component public class ChemblCodeResolverImpl extends Object implements ChemblCodeResolver
Resolves a trial code against ChEMBL's synonym table (GET {base}/chembl/api/data/molecule?molecule_synonyms__molecule_synonym__iexact=...).

Both positive and negative identifications are cached in the admin-evictable CACHE_NAME cache, so a repeatedly-submitted code — recognised or not — is sent upstream once. Transient failures are not cached and are never surfaced as errors; see ChemblCodeResolver.identify(String).

See Also:
  • Field Details

  • Constructor Details

    • ChemblCodeResolverImpl

      public ChemblCodeResolverImpl()
  • Method Details

    • identify

      @Nullable public ChemblCompound identify(String code)
      Description copied from interface: ChemblCodeResolver
      Identify a code against ChEMBL.

      Never throws for an unreachable or misbehaving ChEMBL: this is advisory enrichment sitting on a search path, and a naming authority being down is not a reason to fail a user's query. Failures are logged and reported as "not identified", and are NOT cached, so the next call retries.

      Specified by:
      identify in interface ChemblCodeResolver
      Parameters:
      code - the code as the submitter wrote it; separator spelling does not matter
      Returns:
      the identified compound, or null when ChEMBL has no exact synonym match, when the resolver is disabled, or when ChEMBL could not be reached