Package ubic.gemma.core.ontology
Interface OntologyService
-
- All Known Implementing Classes:
OntologyServiceImpl
public interface OntologyService
- Author:
- Paul
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addExpressionExperimentStatement(Characteristic vc, ExpressionExperiment ee)
Will add the give vocab characteristic to the expression experiment.Map<String,CharacteristicValueObject>
countObsoleteOccurrences(int start, int stop, int step)
Collection<CharacteristicValueObject>
findExperimentsCharacteristicTags(String searchQuery, boolean useNeuroCartaOntology)
Using the ontology and values in the database, for a search searchQuery given by the client give an ordered list of possible choicesCollection<OntologyTerm>
findTerms(String search)
Given a search string will look through the loaded ontologies for terms that match the search term.Collection<CharacteristicValueObject>
findTermsInexact(String givenQueryString, Taxon taxon)
Given a search string will first look through the characteristic database for any entries that have a match.Collection<OntologyTerm>
getCategoryTerms()
Set<OntologyTerm>
getChildren(Collection<OntologyTerm> matchingTerms, boolean direct, boolean includeAdditionalProperties)
Obtain the children of a collection of terms.String
getDefinition(String uri)
Set<OntologyTerm>
getParents(Collection<OntologyTerm> terms, boolean direct, boolean includeAdditionalProperties)
Obtain the parents of a collection of terms.OntologyTerm
getTerm(String uri)
Set<OntologyTerm>
getTerms(Collection<String> uris)
Return all the terms matching the given URIs.boolean
isObsolete(String uri)
void
reindexAllOntologies()
Recreate the search indices, for ontologies that are loaded.void
reinitializeAllOntologies()
Reinitialize all the ontologies "from scratch".void
removeBioMaterialStatement(Long characterId, BioMaterial bm)
void
saveBioMaterialStatement(Characteristic vc, BioMaterial bm)
Will persist the give vocab characteristic to the given biomaterialCollection<Characteristic>
termsToCharacteristics(Collection<OntologyTerm> terms)
-
-
-
Method Detail
-
addExpressionExperimentStatement
void addExpressionExperimentStatement(Characteristic vc, ExpressionExperiment ee)
Will add the give vocab characteristic to the expression experiment. Does NOT handle persisting of the experiment afterwards.- Parameters:
vc
- If the evidence code is null, it will be filled in with IC. A category and value must be provided.ee
- ee
-
countObsoleteOccurrences
Map<String,CharacteristicValueObject> countObsoleteOccurrences(int start, int stop, int step)
-
findExperimentsCharacteristicTags
Collection<CharacteristicValueObject> findExperimentsCharacteristicTags(String searchQuery, boolean useNeuroCartaOntology) throws SearchException
Using the ontology and values in the database, for a search searchQuery given by the client give an ordered list of possible choices- Parameters:
searchQuery
- search queryuseNeuroCartaOntology
- use neurocarta ontology- Returns:
- characteristic vos
- Throws:
SearchException
-
findTerms
Collection<OntologyTerm> findTerms(String search) throws SearchException
Given a search string will look through the loaded ontologies for terms that match the search term. If the query looks like a URI, it just retrieves the term. For other queries, this a lucene backed search, is inexact and for general terms can return a lot of results.- Parameters:
search
- search- Returns:
- returns a collection of ontologyTerm's
- Throws:
SearchException
-
findTermsInexact
Collection<CharacteristicValueObject> findTermsInexact(String givenQueryString, @Nullable Taxon taxon) throws SearchException
Given a search string will first look through the characteristic database for any entries that have a match. If a ontologyTermURI is given it will add all the individuals from that URI that match the search term criteria to the returned list also.- Parameters:
taxon
- Only used if we're going to search for genes or taxon is otherwise relevant; if null, restriction is not used.givenQueryString
- query string- Returns:
- characteristic vos
- Throws:
SearchException
-
getCategoryTerms
Collection<OntologyTerm> getCategoryTerms()
- Returns:
- terms which are allowed for use in the Category of a Characteristic
-
getParents
Set<OntologyTerm> getParents(Collection<OntologyTerm> terms, boolean direct, boolean includeAdditionalProperties)
Obtain the parents of a collection of terms.
-
getChildren
Set<OntologyTerm> getChildren(Collection<OntologyTerm> matchingTerms, boolean direct, boolean includeAdditionalProperties)
Obtain the children of a collection of terms.
-
getDefinition
String getDefinition(String uri)
- Parameters:
uri
- uri- Returns:
- the definition of the associated OntologyTerm. This requires that the ontology be loaded.
-
getTerm
@Nullable OntologyTerm getTerm(String uri)
- Parameters:
uri
- uri- Returns:
- the OntologyTerm for the specified URI.
-
getTerms
Set<OntologyTerm> getTerms(Collection<String> uris)
Return all the terms matching the given URIs.
-
isObsolete
boolean isObsolete(String uri)
-
reindexAllOntologies
void reindexAllOntologies()
Recreate the search indices, for ontologies that are loaded.
-
reinitializeAllOntologies
void reinitializeAllOntologies()
Reinitialize all the ontologies "from scratch". This is necessary if indices are old etc. This should be admin-only.
-
removeBioMaterialStatement
void removeBioMaterialStatement(Long characterId, BioMaterial bm)
-
saveBioMaterialStatement
void saveBioMaterialStatement(Characteristic vc, BioMaterial bm)
Will persist the give vocab characteristic to the given biomaterial- Parameters:
bm
- bmvc
- vc
-
termsToCharacteristics
Collection<Characteristic> termsToCharacteristics(Collection<OntologyTerm> terms)
-
-