Easier access to qualfiers information
mephenor opened this issue · comments
The following methods to accessing information about the qualifiers used in CVTerms would be highly appreciated (name given for indication purposes only):
* Get the qualifier's name
for example: cvterm.getModelQualifier().getName()
which would return 'isDescribedBy', 'is', 'occursIn', ...
* Get qualifier's type
for example: cvterm.getModelQualifier().getType()
which could return 'model' or 'biology'
The fact to need to do:
if (cvterm.getQualifierType().toString().equals("MODEL_QUALIFIER"))
{
do something
}
else
{
do something else
}
is really cumbersome.
Thanks.
Reported by: perkeo
I would agree that the methods in the CVTerm class are not really nice and easy to use.
I would be in favor to deprecate getModelQualifier() and getBiologicalQualifier() and the related set/unset methods to have only a getQualifier() method that return a CVTerm.Qualifier enum. From this enum value, we can infer the qualifier type so we don't really need to store the CVTerm.Type directly in the CVTerm.
We could add a method in the CVTerm Qualifier enum, named getType() that would return a CVTerm.Type and deprecate most of the methods related to CVTerm.Type in CVTerm.
The set of non deprecated methods would then be much more simple and easy to use and understand (I think).
Nico
Original comment by: niko-rodrigue
We did improve the CVTerm API, although all of the old methods are still there to allow retro-compatibility with old code.