Class AbstractMIOntologyAccess
- java.lang.Object
-
- psidev.psi.mi.jami.bridges.ontologymanager.impl.AbstractMIOntologyAccess
-
- All Implemented Interfaces:
MIOntologyAccess
,psidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
- Direct Known Subclasses:
MILocalOntology
,MIOlsOntology
public abstract class AbstractMIOntologyAccess extends Object implements MIOntologyAccess
abstract class for OntologyAccess- Since:
01/11/11
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.commons.logging.Log
log
Constantlog
-
Constructor Summary
Constructors Constructor Description AbstractMIOntologyAccess()
Constructor for AbstractMIOntologyAccess.AbstractMIOntologyAccess(String dbName, String dbIdentifier, Pattern dbRegexp, String parent)
Constructor for AbstractMIOntologyAccess.AbstractMIOntologyAccess(OntologyTermFetcher termBuilder)
Constructor for AbstractMIOntologyAccess.AbstractMIOntologyAccess(OntologyTermFetcher termBuilder, String dbName, String dbIdentifier, Pattern dbRegexp, String parent)
Constructor for AbstractMIOntologyAccess.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected MIOntologyTermI
createNewOntologyTerm(String identifier, String name)
createNewOntologyTerm.Set<MIOntologyTermI>
getAllChildren(MIOntologyTermI term)
getAllChildren.Set<MIOntologyTermI>
getAllParents(MIOntologyTermI term)
getAllParents.String
getDatabaseIdentifier()
Getter for the fielddatabaseIdentifier
.String
getDatabaseName()
Getter for the fielddatabaseName
.Pattern
getDatabaseRegexp()
Getter for the fielddatabaseRegexp
.Set<MIOntologyTermI>
getDirectChildren(MIOntologyTermI term)
getDirectChildren.Set<MIOntologyTermI>
getDirectParents(MIOntologyTermI term)
getDirectParents.String
getOntologyID()
Getter for the fieldontologyID
.OntologyTermFetcher
getOntologyTermFetcher()
getOntologyTermFetcher.String
getParentFromOtherOntology()
getParentFromOtherOntology.Collection<MIOntologyTermI>
getRootTerms()
getRootTerms.MIOntologyTermI
getTermForAccession(String accession)
Set<MIOntologyTermI>
getValidTerms(String accession, boolean allowChildren, boolean useTerm)
Method that is used by the validator to determine a Set of Ontology terms that are valid terms for a particular rule.boolean
isObsolete(MIOntologyTermI term)
isObsolete.abstract boolean
isOntologyUpToDate()
isOntologyUpToDate.boolean
isUseTermSynonyms()
isUseTermSynonyms.abstract void
loadOntology(String ontologyID, String name, String version, String format, URI uri)
void
setOntologyDirectory(File directory)
protected void
setOntologyID(String ontologyID)
Setter for the fieldontologyID
.protected void
setOntologyTermFetcher(OntologyTermFetcher termFetcher)
setOntologyTermFetcher.void
setUseTermSynonyms(boolean useTermSynonyms)
-
-
-
Constructor Detail
-
AbstractMIOntologyAccess
public AbstractMIOntologyAccess() throws psidev.psi.tools.ontology_manager.impl.local.OntologyLoaderException
Constructor for AbstractMIOntologyAccess.
- Throws:
psidev.psi.tools.ontology_manager.impl.local.OntologyLoaderException
- if any.
-
AbstractMIOntologyAccess
public AbstractMIOntologyAccess(OntologyTermFetcher termBuilder) throws psidev.psi.tools.ontology_manager.impl.local.OntologyLoaderException
Constructor for AbstractMIOntologyAccess.
- Parameters:
termBuilder
- aOntologyTermFetcher
object.- Throws:
psidev.psi.tools.ontology_manager.impl.local.OntologyLoaderException
- if any.
-
AbstractMIOntologyAccess
public AbstractMIOntologyAccess(String dbName, String dbIdentifier, Pattern dbRegexp, String parent) throws psidev.psi.tools.ontology_manager.impl.local.OntologyLoaderException
Constructor for AbstractMIOntologyAccess.
-
AbstractMIOntologyAccess
public AbstractMIOntologyAccess(OntologyTermFetcher termBuilder, String dbName, String dbIdentifier, Pattern dbRegexp, String parent) throws psidev.psi.tools.ontology_manager.impl.local.OntologyLoaderException
Constructor for AbstractMIOntologyAccess.
- Parameters:
termBuilder
- aOntologyTermFetcher
object.dbName
- aString
object.dbIdentifier
- aString
object.dbRegexp
- aPattern
object.parent
- aString
object.- Throws:
psidev.psi.tools.ontology_manager.impl.local.OntologyLoaderException
- if any.
-
-
Method Detail
-
createNewOntologyTerm
protected MIOntologyTermI createNewOntologyTerm(String identifier, String name) throws BridgeFailedException
createNewOntologyTerm.
- Parameters:
identifier
- aString
object.name
- aString
object.- Returns:
- a
MIOntologyTermI
object. - Throws:
BridgeFailedException
- if any.
-
getOntologyID
public String getOntologyID()
Getter for the field
ontologyID
.- Specified by:
getOntologyID
in interfaceMIOntologyAccess
- Returns:
- a
String
object.
-
getDatabaseIdentifier
public String getDatabaseIdentifier()
Getter for the field
databaseIdentifier
.- Specified by:
getDatabaseIdentifier
in interfaceMIOntologyAccess
- Returns:
- a
String
object.
-
getParentFromOtherOntology
public String getParentFromOtherOntology()
getParentFromOtherOntology.
- Specified by:
getParentFromOtherOntology
in interfaceMIOntologyAccess
- Returns:
- a
String
object.
-
getRootTerms
public Collection<MIOntologyTermI> getRootTerms()
getRootTerms.
- Specified by:
getRootTerms
in interfaceMIOntologyAccess
- Returns:
- a
Collection
object.
-
getDatabaseRegexp
public Pattern getDatabaseRegexp()
Getter for the field
databaseRegexp
.- Specified by:
getDatabaseRegexp
in interfaceMIOntologyAccess
- Returns:
- a
Pattern
object.
-
getOntologyTermFetcher
public OntologyTermFetcher getOntologyTermFetcher()
getOntologyTermFetcher.
- Specified by:
getOntologyTermFetcher
in interfaceMIOntologyAccess
- Returns:
- a
OntologyTermFetcher
object.
-
loadOntology
public abstract void loadOntology(String ontologyID, String name, String version, String format, URI uri) throws psidev.psi.tools.ontology_manager.impl.local.OntologyLoaderException
- Specified by:
loadOntology
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
- Throws:
psidev.psi.tools.ontology_manager.impl.local.OntologyLoaderException
-
setOntologyDirectory
public void setOntologyDirectory(File directory)
- Specified by:
setOntologyDirectory
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
-
getValidTerms
public Set<MIOntologyTermI> getValidTerms(String accession, boolean allowChildren, boolean useTerm)
Method that is used by the validator to determine a Set of Ontology terms that are valid terms for a particular rule. E.g. according to the flags, this can be the term corresponding to the provided accession or its children or both.- Specified by:
getValidTerms
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
-
getTermForAccession
public MIOntologyTermI getTermForAccession(String accession)
- Specified by:
getTermForAccession
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
-
isObsolete
public boolean isObsolete(MIOntologyTermI term)
isObsolete.
- Specified by:
isObsolete
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
- Parameters:
term
- aMIOntologyTermI
object.- Returns:
- a boolean.
-
getDirectParents
public Set<MIOntologyTermI> getDirectParents(MIOntologyTermI term)
getDirectParents.
- Specified by:
getDirectParents
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
- Parameters:
term
- aMIOntologyTermI
object.- Returns:
- a
Set
object.
-
getDirectChildren
public Set<MIOntologyTermI> getDirectChildren(MIOntologyTermI term)
getDirectChildren.
- Specified by:
getDirectChildren
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
- Parameters:
term
- aMIOntologyTermI
object.- Returns:
- a
Set
object.
-
getAllParents
public Set<MIOntologyTermI> getAllParents(MIOntologyTermI term)
getAllParents.
- Specified by:
getAllParents
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
- Parameters:
term
- aMIOntologyTermI
object.- Returns:
- a
Set
object.
-
getAllChildren
public Set<MIOntologyTermI> getAllChildren(MIOntologyTermI term)
getAllChildren.
- Specified by:
getAllChildren
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
- Parameters:
term
- aMIOntologyTermI
object.- Returns:
- a
Set
object.
-
isOntologyUpToDate
public abstract boolean isOntologyUpToDate() throws psidev.psi.tools.ontology_manager.impl.local.OntologyLoaderException
isOntologyUpToDate.
- Specified by:
isOntologyUpToDate
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
- Returns:
- a boolean.
- Throws:
psidev.psi.tools.ontology_manager.impl.local.OntologyLoaderException
- if any.
-
isUseTermSynonyms
public boolean isUseTermSynonyms()
isUseTermSynonyms.
- Specified by:
isUseTermSynonyms
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
- Returns:
- a boolean.
-
setUseTermSynonyms
public void setUseTermSynonyms(boolean useTermSynonyms)
- Specified by:
setUseTermSynonyms
in interfacepsidev.psi.tools.ontology_manager.interfaces.OntologyAccessTemplate<MIOntologyTermI>
-
getDatabaseName
public String getDatabaseName()
Getter for the field
databaseName
.- Specified by:
getDatabaseName
in interfaceMIOntologyAccess
- Returns:
- a
String
object.
-
setOntologyID
protected void setOntologyID(String ontologyID)
Setter for the field
ontologyID
.- Parameters:
ontologyID
- aString
object.
-
setOntologyTermFetcher
protected void setOntologyTermFetcher(OntologyTermFetcher termFetcher)
setOntologyTermFetcher.
- Parameters:
termFetcher
- aOntologyTermFetcher
object.
-
-