Class MinimalOntologyTermEnricher
- java.lang.Object
-
- psidev.psi.mi.jami.enricher.impl.AbstractMIEnricher<OntologyTerm>
-
- psidev.psi.mi.jami.enricher.impl.minimal.MinimalOntologyTermEnricher
-
- All Implemented Interfaces:
CvTermEnricher<OntologyTerm>
,MIEnricher<OntologyTerm>
- Direct Known Subclasses:
FullOntologyTermEnricher
,MinimalOntologyTermUpdater
public class MinimalOntologyTermEnricher extends AbstractMIEnricher<OntologyTerm> implements CvTermEnricher<OntologyTerm>
Provides minimal enrichment of ontologYTerm. - enrich minimal properties of Cv Term. See description in MinimalCvTermEnricher - enrich children of a term. It will use DefaultCvTermComparator to compare children and add missing children without removing any existing children. It will enrich the children of the ontologyTerm It will ignore all other properties of an ontologyTerm- Since:
- 08/05/13
- Author:
- Gabriel Aldam (galdam@ebi.ac.uk)
-
-
Constructor Summary
Constructors Modifier Constructor Description MinimalOntologyTermEnricher(OntologyTermFetcher cvTermFetcher)
A constructor matching super.protected
MinimalOntologyTermEnricher(MinimalCvTermEnricher<OntologyTerm> cvEnricher)
Constructor for MinimalOntologyTermEnricher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enrich(OntologyTerm objectToEnrich)
enrich.void
enrich(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched)
enrich.protected void
enrichChild(OntologyTerm objectToEnrich)
enrichChild.protected void
enrichRelatedTerms(Collection<OntologyTerm> cvTermToEnrich)
enrichRelatedTerms.OntologyTerm
find(OntologyTerm objectToEnrich)
find.protected MinimalCvTermEnricher<OntologyTerm>
getCvEnricher()
Getter for the fieldcvEnricher
.CvTermEnricherListener<OntologyTerm>
getCvTermEnricherListener()
getCvTermEnricherListener.CvTermFetcher<OntologyTerm>
getCvTermFetcher()
getCvTermFetcher.protected void
mergeOntologyTerms(OntologyTerm termToEnrich, Collection<OntologyTerm> toEnrichTerms, Collection<OntologyTerm> fetchedTerms, boolean remove)
Takes two lists of ontology terms and produces a list of those to add and those to remove.protected void
onEnrichedVersionNotFound(OntologyTerm cvTermToEnrich)
onEnrichedVersionNotFound.protected void
processChildren(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched)
processChildren.protected void
processDefinition(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched)
processDefinition.protected void
processOntologyTerm(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched)
A method that can be overridden to add to or change the behaviour of enrichment without effecting fetching.void
setCvTermEnricherListener(CvTermEnricherListener<OntologyTerm> listener)
setCvTermEnricherListener.-
Methods inherited from class psidev.psi.mi.jami.enricher.impl.AbstractMIEnricher
enrich
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface psidev.psi.mi.jami.enricher.MIEnricher
enrich
-
-
-
-
Constructor Detail
-
MinimalOntologyTermEnricher
public MinimalOntologyTermEnricher(OntologyTermFetcher cvTermFetcher)
A constructor matching super.- Parameters:
cvTermFetcher
- The fetcher to initiate the enricher with. If null, an illegal state exception will be thrown at the next enrichment.
-
MinimalOntologyTermEnricher
protected MinimalOntologyTermEnricher(MinimalCvTermEnricher<OntologyTerm> cvEnricher)
Constructor for MinimalOntologyTermEnricher.
- Parameters:
cvEnricher
- aMinimalCvTermEnricher
object.
-
-
Method Detail
-
enrich
public void enrich(OntologyTerm objectToEnrich) throws EnricherException
enrich.
- Specified by:
enrich
in interfaceMIEnricher<OntologyTerm>
- Overrides:
enrich
in classAbstractMIEnricher<OntologyTerm>
- Parameters:
objectToEnrich
- a T object.- Throws:
EnricherException
- if any.
-
processOntologyTerm
protected void processOntologyTerm(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched) throws EnricherException
A method that can be overridden to add to or change the behaviour of enrichment without effecting fetching.- Parameters:
cvTermToEnrich
- the CvTerm to enrichcvTermFetched
- aOntologyTerm
object.- Throws:
EnricherException
- if any.
-
processDefinition
protected void processDefinition(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched) throws EnricherException
processDefinition.
- Parameters:
cvTermToEnrich
- aOntologyTerm
object.cvTermFetched
- aOntologyTerm
object.- Throws:
EnricherException
- if any.
-
processChildren
protected void processChildren(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched) throws EnricherException
processChildren.
- Parameters:
cvTermToEnrich
- aOntologyTerm
object.cvTermFetched
- aOntologyTerm
object.- Throws:
EnricherException
- if any.
-
enrichRelatedTerms
protected void enrichRelatedTerms(Collection<OntologyTerm> cvTermToEnrich) throws EnricherException
enrichRelatedTerms.
- Parameters:
cvTermToEnrich
- aCollection
object.- Throws:
EnricherException
- if any.
-
enrichChild
protected void enrichChild(OntologyTerm objectToEnrich) throws EnricherException
enrichChild.
- Parameters:
objectToEnrich
- aOntologyTerm
object.- Throws:
EnricherException
- if any.
-
onEnrichedVersionNotFound
protected void onEnrichedVersionNotFound(OntologyTerm cvTermToEnrich) throws EnricherException
onEnrichedVersionNotFound.
- Specified by:
onEnrichedVersionNotFound
in classAbstractMIEnricher<OntologyTerm>
- Parameters:
cvTermToEnrich
- a T object.- Throws:
EnricherException
- if any.
-
enrich
public void enrich(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched) throws EnricherException
enrich.
- Specified by:
enrich
in interfaceMIEnricher<OntologyTerm>
- Specified by:
enrich
in classAbstractMIEnricher<OntologyTerm>
- Parameters:
cvTermToEnrich
- a T object.cvTermFetched
- a T object.- Throws:
EnricherException
- if any.
-
find
public OntologyTerm find(OntologyTerm objectToEnrich) throws EnricherException
find.
- Specified by:
find
in classAbstractMIEnricher<OntologyTerm>
- Parameters:
objectToEnrich
- a T object.- Returns:
- a T object.
- Throws:
EnricherException
- if any.
-
mergeOntologyTerms
protected void mergeOntologyTerms(OntologyTerm termToEnrich, Collection<OntologyTerm> toEnrichTerms, Collection<OntologyTerm> fetchedTerms, boolean remove) throws EnricherException
Takes two lists of ontology terms and produces a list of those to add and those to remove. It will add in toEnrichTerms all xref from fetchedTerms that are not there. It will also remove extra identifiers from toEnrichTerms if remove boolean is true.- Parameters:
termToEnrich
- The object to enrichfetchedTerms
- The new terms to be added.remove
- : if true, we remove terms that are not in enriched listtoEnrichTerms
- aCollection
object.- Throws:
EnricherException
- if any.
-
getCvTermFetcher
public CvTermFetcher<OntologyTerm> getCvTermFetcher()
getCvTermFetcher.
- Specified by:
getCvTermFetcher
in interfaceCvTermEnricher<OntologyTerm>
- Returns:
- a
CvTermFetcher
object.
-
setCvTermEnricherListener
public void setCvTermEnricherListener(CvTermEnricherListener<OntologyTerm> listener)
setCvTermEnricherListener.
- Specified by:
setCvTermEnricherListener
in interfaceCvTermEnricher<OntologyTerm>
- Parameters:
listener
- aCvTermEnricherListener
object.
-
getCvTermEnricherListener
public CvTermEnricherListener<OntologyTerm> getCvTermEnricherListener()
getCvTermEnricherListener.
- Specified by:
getCvTermEnricherListener
in interfaceCvTermEnricher<OntologyTerm>
- Returns:
- a
CvTermEnricherListener
object.
-
getCvEnricher
protected MinimalCvTermEnricher<OntologyTerm> getCvEnricher()
Getter for the field
cvEnricher
.- Returns:
- a
MinimalCvTermEnricher
object.
-
-