uk.ac.ebi.microarray.zooma.retrieval
Class CompositeOntologyTermRetriever

java.lang.Object
  extended by uk.ac.ebi.microarray.zooma.retrieval.CompositeOntologyTermRetriever
All Implemented Interfaces:
OntologyTermRetriever

public class CompositeOntologyTermRetriever
extends java.lang.Object
implements OntologyTermRetriever

An ontology term retriever that is a composite of a list of ontology term retrievers. Retrieval queries are delegated to each retriever and responses pooled.

Author:
Tony Burdett

Constructor Summary
CompositeOntologyTermRetriever(java.util.List<OntologyTermRetriever> retrievers)
           
CompositeOntologyTermRetriever(OntologyTermRetriever... retrievers)
           
 
Method Summary
 java.util.Collection<OntologyMappingContext> fetchMappingContexts(Value value, uk.ac.ebi.ontocat.OntologyTerm term)
          Returns the set of unique contexts retrieved from each retriever encapsulated by this composite retriever.
 java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> fetchTerms(Value value)
          Returns a set of unique terms retrieved from each retriever encapsulated by this composite retriever.
 java.util.List<OntologyTermRetriever> getOntologyTermRetrievers()
           
protected  java.util.concurrent.ExecutorService getService()
           
 void setOntologyTermRetrievers(java.util.List<OntologyTermRetriever> retrievers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeOntologyTermRetriever

public CompositeOntologyTermRetriever(OntologyTermRetriever... retrievers)

CompositeOntologyTermRetriever

public CompositeOntologyTermRetriever(java.util.List<OntologyTermRetriever> retrievers)
Method Detail

setOntologyTermRetrievers

public void setOntologyTermRetrievers(java.util.List<OntologyTermRetriever> retrievers)

getOntologyTermRetrievers

public java.util.List<OntologyTermRetriever> getOntologyTermRetrievers()

getService

protected java.util.concurrent.ExecutorService getService()

fetchTerms

public java.util.Collection<uk.ac.ebi.ontocat.OntologyTerm> fetchTerms(Value value)
                                                                throws java.io.IOException
Returns a set of unique terms retrieved from each retriever encapsulated by this composite retriever. This returns only unique results - if terms acquired from separate sources satisfy Object.equals(Object) then the duplication is ignored. However, two terms being equal does not necessarily imply that the context in which they are used is also equal.

Specified by:
fetchTerms in interface OntologyTermRetriever
Parameters:
value - the text description to search for
Returns:
the collection of unique terms from all retrievers backing this composite
Throws:
java.io.IOException - if an error occurred retrieving terms from any of the backing datasources

fetchMappingContexts

public java.util.Collection<OntologyMappingContext> fetchMappingContexts(Value value,
                                                                         uk.ac.ebi.ontocat.OntologyTerm term)
                                                                  throws java.io.IOException
Returns the set of unique contexts retrieved from each retriever encapsulated by this composite retriever. This returns only unique results - if contexts acquired from separate sources satisfy Object.equals(Object) then the duplication is ignored. Be aware that the same term may be applied in different contexts in the same datasource, let alone different ones, so there are no guarantees that this returns a single result.

Specified by:
fetchMappingContexts in interface OntologyTermRetriever
Parameters:
value - the text description to search for
term - the term that is mapped to this description - usually, retrieved by OntologyTermRetriever.fetchTerms(uk.ac.ebi.microarray.zooma.lang.Value) first
Returns:
term the term to acquire the contexts
Throws:
java.io.IOException - if an error occurred retrieving terms from any of the backing datasources


Copyright © 2010. All Rights Reserved.