@Unstable
public interface VocabularyTerm
Vocabulary
. A few common properties are available as explicit individual methods, and any
property defined for the term can be accessed using the generic get(String)
method. As a minimum, each term
should have an identifier and a name. Terms can be accessed either using the owner Vocabulary
, or the generic
VocabularyManager
.Modifier and Type | Method and Description |
---|---|
Object |
get(String name)
Generic property access.
|
Set<VocabularyTerm> |
getAncestors()
Returns the ancestors (both direct and indirect ancestors) of this term.
|
Set<VocabularyTerm> |
getAncestorsAndSelf()
Returns the ancestors (both direct and indirect ancestors) of this term and the term itself.
|
String |
getDescription()
The human-readable term description, usually a longer phrase or paragraph that describes the term.
|
long |
getDistanceTo(VocabularyTerm other)
Find the distance to another term in the same vocabulary, if the owner vocabulary is a structured ontology that
supports computing such a distance.
|
String |
getId()
The (mandatory) term identifier, in the format
<vocabulary prefix>:<term id> , for example
HP:0002066 or MIM:260540 . |
String |
getName()
The short human-readable term name, for example
Gait ataxia . |
Set<VocabularyTerm> |
getParents()
Returns the parents (direct ancestors) of this term.
|
String |
getTranslatedDescription()
The human-readable term description, translated in the current locale if a translation is available, usually a
longer phrase or paragraph that describes the term.
|
String |
getTranslatedName()
The short human-readable term name, translated in the current locale if a translation is available, for example
Marcha atáxica if the current user is browsing in Spanish. |
Collection<?> |
getTranslatedValues(String name)
Generic translated property access.
|
Vocabulary |
getVocabulary()
Returns the vocabulary where this term is defined.
|
org.json.JSONObject |
toJSON()
Serialize all the known information about this term as a JSON object.
|
String getId()
<vocabulary prefix>:<term id>
, for example
HP:0002066
or MIM:260540
.null
if the term doesn't have an associated identifierString getName()
Gait ataxia
.null
if the term doesn't have an associated nameString getTranslatedName()
Marcha atáxica
if the current user is browsing in Spanish.null
if the term doesn't
have an associated nameString getDescription()
null
if the term doesn't have a descriptionString getTranslatedDescription()
null
if the
term doesn't have a descriptionSet<VocabularyTerm> getParents()
Set<VocabularyTerm> getAncestors()
Set<VocabularyTerm> getAncestorsAndSelf()
long getDistanceTo(VocabularyTerm other)
other
- the term to which the distance should be computed-1
if this is an unstructured vocabulary, the terms are not connected, or if the other term is
null
Object get(String name)
name
- the name of the property to accessnull
if no value is definedCollection<?> getTranslatedValues(String name)
name
- the name of the translatable property to accessnull
if no value is definedVocabulary getVocabulary()
org.json.JSONObject toJSON()
{ "id":"HP:0001824", "name":"Weight loss", "def":"Reduction in existing body weight.", "is_a":[ "HP:0004325 ! Decreased body weight" ], "term_category":[ "HP:0004325", "HP:0004323", "HP:0000001", "HP:0001507", "HP:0000118" ], "xref":[ "MeSH:D015431 \"Weight Loss\"", "UMLS:C0043096 \"Decreased body weight\"" ] }
Copyright © 2011–2018 University of Toronto, Computational Biology Lab. All rights reserved.