Class ChemblCodeResolverImpl
java.lang.Object
ubic.gemma.core.ontology.chembl.ChemblCodeResolverImpl
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAdmin-evictable cache of code →ChemblCompound. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIdentify a code against ChEMBL.
-
Field Details
-
CACHE_NAME
Admin-evictable cache of code →ChemblCompound. Registered inEhcacheConfig#APP_CACHES.- See Also:
-
-
Constructor Details
-
ChemblCodeResolverImpl
public ChemblCodeResolverImpl()
-
-
Method Details
-
identify
Description copied from interface:ChemblCodeResolverIdentify 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:
identifyin interfaceChemblCodeResolver- Parameters:
code- the code as the submitter wrote it; separator spelling does not matter- Returns:
- the identified compound, or
nullwhen ChEMBL has no exact synonym match, when the resolver is disabled, or when ChEMBL could not be reached
-