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.protectedMinimalOntologyTermEnricher(MinimalCvTermEnricher<OntologyTerm> cvEnricher)Constructor for MinimalOntologyTermEnricher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenrich(OntologyTerm objectToEnrich)enrich.voidenrich(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched)enrich.protected voidenrichChild(OntologyTerm objectToEnrich)enrichChild.protected voidenrichRelatedTerms(Collection<OntologyTerm> cvTermToEnrich)enrichRelatedTerms.OntologyTermfind(OntologyTerm objectToEnrich)find.protected MinimalCvTermEnricher<OntologyTerm>getCvEnricher()Getter for the fieldcvEnricher.CvTermEnricherListener<OntologyTerm>getCvTermEnricherListener()getCvTermEnricherListener.CvTermFetcher<OntologyTerm>getCvTermFetcher()getCvTermFetcher.protected voidmergeOntologyTerms(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 voidonEnrichedVersionNotFound(OntologyTerm cvTermToEnrich)onEnrichedVersionNotFound.protected voidprocessChildren(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched)processChildren.protected voidprocessDefinition(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched)processDefinition.protected voidprocessOntologyTerm(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched)A method that can be overridden to add to or change the behaviour of enrichment without effecting fetching.voidsetCvTermEnricherListener(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- aMinimalCvTermEnricherobject.
-
-
Method Detail
-
enrich
public void enrich(OntologyTerm objectToEnrich) throws EnricherException
enrich.
- Specified by:
enrichin interfaceMIEnricher<OntologyTerm>- Overrides:
enrichin 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- aOntologyTermobject.- Throws:
EnricherException- if any.
-
processDefinition
protected void processDefinition(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched) throws EnricherException
processDefinition.
- Parameters:
cvTermToEnrich- aOntologyTermobject.cvTermFetched- aOntologyTermobject.- Throws:
EnricherException- if any.
-
processChildren
protected void processChildren(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched) throws EnricherException
processChildren.
- Parameters:
cvTermToEnrich- aOntologyTermobject.cvTermFetched- aOntologyTermobject.- Throws:
EnricherException- if any.
-
enrichRelatedTerms
protected void enrichRelatedTerms(Collection<OntologyTerm> cvTermToEnrich) throws EnricherException
enrichRelatedTerms.
- Parameters:
cvTermToEnrich- aCollectionobject.- Throws:
EnricherException- if any.
-
enrichChild
protected void enrichChild(OntologyTerm objectToEnrich) throws EnricherException
enrichChild.
- Parameters:
objectToEnrich- aOntologyTermobject.- Throws:
EnricherException- if any.
-
onEnrichedVersionNotFound
protected void onEnrichedVersionNotFound(OntologyTerm cvTermToEnrich) throws EnricherException
onEnrichedVersionNotFound.
- Specified by:
onEnrichedVersionNotFoundin classAbstractMIEnricher<OntologyTerm>- Parameters:
cvTermToEnrich- a T object.- Throws:
EnricherException- if any.
-
enrich
public void enrich(OntologyTerm cvTermToEnrich, OntologyTerm cvTermFetched) throws EnricherException
enrich.
- Specified by:
enrichin interfaceMIEnricher<OntologyTerm>- Specified by:
enrichin 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:
findin 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- aCollectionobject.- Throws:
EnricherException- if any.
-
getCvTermFetcher
public CvTermFetcher<OntologyTerm> getCvTermFetcher()
getCvTermFetcher.
- Specified by:
getCvTermFetcherin interfaceCvTermEnricher<OntologyTerm>- Returns:
- a
CvTermFetcherobject.
-
setCvTermEnricherListener
public void setCvTermEnricherListener(CvTermEnricherListener<OntologyTerm> listener)
setCvTermEnricherListener.
- Specified by:
setCvTermEnricherListenerin interfaceCvTermEnricher<OntologyTerm>- Parameters:
listener- aCvTermEnricherListenerobject.
-
getCvTermEnricherListener
public CvTermEnricherListener<OntologyTerm> getCvTermEnricherListener()
getCvTermEnricherListener.
- Specified by:
getCvTermEnricherListenerin interfaceCvTermEnricher<OntologyTerm>- Returns:
- a
CvTermEnricherListenerobject.
-
getCvEnricher
protected MinimalCvTermEnricher<OntologyTerm> getCvEnricher()
Getter for the field
cvEnricher.- Returns:
- a
MinimalCvTermEnricherobject.
-
-