Package org.bridgedb
Interface IDMapper
-
- All Known Implementing Classes:
AbstractIDMapper,IDMapperFile,IDMapperStack,IDMapperText,IDMapperWebservice
public interface IDMapperBase interface for all id mapping methods. Has methods for basic functionality such as looking up cross-references and backpage text.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()dispose any resources (such as open database connections) associated with this IDMapper.Set<Xref>freeSearch(String text, int limit)free text search for matching symbols or identifiers.IDMapperCapabilitiesgetCapabilities()booleanisConnected()Use this method to check if the IDMapper is still valid.Map<Xref,Set<Xref>>mapID(Collection<Xref> srcXrefs, DataSource... tgtDataSources)Get all cross-references for a set of entities, restricting the result to contain only references from the given set of data sources.Set<Xref>mapID(Xref ref, DataSource... tgtDataSources)Get all cross-references for the given entity, restricting the result to contain only references from the given set of data sources.booleanxrefExists(Xref xref)Check whether an Xref is known by the given mapping source.
-
-
-
Method Detail
-
mapID
Map<Xref,Set<Xref>> mapID(Collection<Xref> srcXrefs, DataSource... tgtDataSources) throws IDMapperException
Get all cross-references for a set of entities, restricting the result to contain only references from the given set of data sources. Supports one-to-one mapping and one-to-many mapping.- Parameters:
srcXrefs- source Xref, containing ID and ID type/data sourcetgtDataSources- target ID types/data sources. Set this to null if you want to retrieve all results.- Returns:
- a map from source Xref to target Xref's. The map is not guaranteed to contain a result for each srcXrefs you pass in. This method will never return null however.
- Throws:
IDMapperException- if the mapping service is (temporarily) unavailable
-
mapID
Set<Xref> mapID(Xref ref, DataSource... tgtDataSources) throws IDMapperException
Get all cross-references for the given entity, restricting the result to contain only references from the given set of data sources.- Parameters:
ref- the entity to get cross-references for.tgtDataSources- target ID types/data sources. Set this to null if you want to retrieve all results.- Returns:
- A Set containing the cross references, or an empty Set when no cross references could be found. This method does not return null.
- Throws:
IDMapperException- if the mapping service is (temporarily) unavailable
-
xrefExists
boolean xrefExists(Xref xref) throws IDMapperException
Check whether an Xref is known by the given mapping source. This is an optionally supported operation.- Parameters:
xref- reference to check- Returns:
- if the reference exists, false if not
- Throws:
IDMapperException- if failed, UnsupportedOperationException if it's not supported by the Driver.
-
freeSearch
Set<Xref> freeSearch(String text, int limit) throws IDMapperException
free text search for matching symbols or identifiers.- Parameters:
text- text to searchlimit- up limit of number of hits- Returns:
- a set of hit references
- Throws:
IDMapperException- if failed
-
getCapabilities
IDMapperCapabilities getCapabilities()
- Returns:
- capacities of the ID mapper
-
close
void close() throws IDMapperExceptiondispose any resources (such as open database connections) associated with this IDMapper.- Throws:
IDMapperException- if the associated resources could not be freed.
-
isConnected
boolean isConnected()
Use this method to check if the IDMapper is still valid.- Returns:
- false after the close() method is called on this object, true otherwise
-
-