@Unstable(value="New API introduced in 1.3, it may still change")
@Role
public interface VocabularyExtension
isVocabularySupported(org.phenotips.vocabulary.Vocabulary)
method. Every time one of the supported vocabularies
is reindexed
, first indexingStarted(org.phenotips.vocabulary.Vocabulary)
is called,
so that the extension can prepare its needed resources, if any. Then, for each term parsed from its source the
extendTerm(org.phenotips.vocabulary.VocabularyInputTerm, org.phenotips.vocabulary.Vocabulary)
method is called, and new fields can be added to it. Once all the terms have been indexed,
indexingEnded(org.phenotips.vocabulary.Vocabulary)
is called, and any resources can be freed.Modifier and Type | Method and Description |
---|---|
void |
extendQuery(org.apache.solr.client.solrj.SolrQuery query,
Vocabulary vocabulary)
Called for each query on the vocabulary, this method modifies the query terms by changing, adding or removing
fields.
|
void |
extendTerm(VocabularyInputTerm term,
Vocabulary vocabulary)
Called for each term during vocabulary reindexing, this method modifies the parsed terms by changing, adding or
removing fields.
|
default String |
getAnnotationSource()
Specifies the annotation source URL.
|
default String |
getName()
The official name of the vocabulary extension.
|
void |
indexingEnded(Vocabulary vocabulary)
Called when a vocabulary reindex is done, so that this extension can clean up its resources, if any.
|
void |
indexingStarted(Vocabulary vocabulary)
Called when a vocabulary reindex begins, so that this extension can prepare its needed resources, if any.
|
boolean |
isVocabularySupported(Vocabulary vocabulary)
Checks if a vocabulary is supported by this extension.
|
boolean isVocabularySupported(Vocabulary vocabulary)
vocabulary
- the vocabulary to checktrue
if the target vocabulary is supported, false
if not and this extension should no
longer be invoked when processing that vocabularyvoid indexingStarted(Vocabulary vocabulary)
supported vocabularies
.vocabulary
- the vocabulary being indexedvoid extendTerm(VocabularyInputTerm term, Vocabulary vocabulary)
supported vocabularies
.term
- the parsed term which can be alteredvocabulary
- the the vocabulary being indexedvoid indexingEnded(Vocabulary vocabulary)
supported vocabularies
.vocabulary
- the vocabulary that was indexedvoid extendQuery(org.apache.solr.client.solrj.SolrQuery query, Vocabulary vocabulary)
query
- the query to processvocabulary
- the the vocabulary being querieddefault String getAnnotationSource()
file:///
reference, a classpath resource, or any other URL format that can be read by the JVM.default String getName()
The Disease HPO negative annotations
Copyright © 2011–2018 University of Toronto, Computational Biology Lab. All rights reserved.