CVTerm.h File Reference

Detailed Description

Definition of a CVTerm class for adding annotations to a Model.

Author:
Sarah Keating
Include dependency graph for CVTerm.h:
This graph shows which files directly or indirectly include this file:

Enumerations

enum  BiolQualifierType_t {
  BQB_IS,
  BQB_HAS_PART,
  BQB_IS_PART_OF,
  BQB_IS_VERSION_OF,
  BQB_HAS_VERSION,
  BQB_IS_HOMOLOG_TO,
  BQB_IS_DESCRIBED_BY,
  BQB_IS_ENCODED_BY,
  BQB_ENCODES,
  BQB_OCCURS_IN,
  BQB_HAS_PROPERTY,
  BQB_IS_PROPERTY_OF,
  BQB_UNKNOWN
}
enum  ModelQualifierType_t {
  BQM_IS,
  BQM_IS_DESCRIBED_BY,
  BQM_IS_DERIVED_FROM,
  BQM_UNKNOWN
}
enum  QualifierType_t {
  MODEL_QUALIFIER,
  BIOLOGICAL_QUALIFIER,
  UNKNOWN_QUALIFIER
}

Functions

BiolQualifierType_t BiolQualifierType_fromString (const char *s)
 This method takes a a string and returns a biol qualifier representing the string.
const char * BiolQualifierType_toString (BiolQualifierType_t type)
 This method takes a biol qualifier type code and returns a string representing the code.
int CVTerm_addResource (CVTerm_t *CVT, const char *resource)
 Adds a resource to the CVTerm_t.
CVTerm_t * CVTerm_clone (const CVTerm_t *c)
 Creates a deep copy of the given CVTerm_t structure.
CVTerm_t * CVTerm_createFromNode (const XMLNode_t *)
 Create a new CVTerm_t from the given XMLNode_t and returns a pointer to it.
CVTerm_t * CVTerm_createWithQualifierType (QualifierType_t type)
 Creates a new CVTerm_t with the given QualifierType_t value type and returns a pointer to it.
void CVTerm_free (CVTerm_t *)
 Frees the given CVTerm_t structure.
BiolQualifierType_t CVTerm_getBiologicalQualifierType (CVTerm_t *)
 Takes a CVTerm_t structure and returns the BiolQualifierType_t.
ModelQualifierType_t CVTerm_getModelQualifierType (CVTerm_t *)
 Takes a CVTerm_t structure and returns the ModelQualifierType_t type.
unsigned int CVTerm_getNumResources (CVTerm_t *)
 Returns the number of resources for this CVTerm.
QualifierType_t CVTerm_getQualifierType (CVTerm_t *)
 Takes a CVTerm_t structure and returns its QualifierType_t type.
XMLAttributes_t * CVTerm_getResources (CVTerm_t *)
 Takes a CVTerm_t structure and returns the resources.
char * CVTerm_getResourceURI (CVTerm_t *cv, unsigned int n)
 Returns the value of the nth resource for this CVTerm.
int CVTerm_hasRequiredAttributes (CVTerm_t *cvt)
int CVTerm_removeResource (CVTerm_t *CVT, const char *resource)
 Removes a resource from the CVTerm_t.
int CVTerm_setBiologicalQualifierType (CVTerm_t *CVT, BiolQualifierType_t type)
 Sets the "BiolQualifierType_t" of this CVTerm_t.
int CVTerm_setBiologicalQualifierTypeByString (CVTerm_t *CVT, const char *qualifier)
 Sets the "BiolQualifierType_t" of this CVTerm_t.
int CVTerm_setModelQualifierType (CVTerm_t *CVT, ModelQualifierType_t type)
 Sets the "ModelQualifierType_t" of this CVTerm.
int CVTerm_setModelQualifierTypeByString (CVTerm_t *CVT, const char *qualifier)
 Sets the "ModelQualifierType_t" of this CVTerm.
int CVTerm_setQualifierType (CVTerm_t *CVT, QualifierType_t type)
 Sets the "QualifierType_t" of this CVTerm_t.
ModelQualifierType_t ModelQualifierType_fromString (const char *s)
 This method takes a a string and returns a model qualifier representing the string.
const char * ModelQualifierType_toString (ModelQualifierType_t type)
 This method takes a model qualifier type code and returns a string representing the code.

Enumeration Type Documentation

Enumerator:
BQB_IS 
BQB_HAS_PART 
BQB_IS_PART_OF 
BQB_IS_VERSION_OF 
BQB_HAS_VERSION 
BQB_IS_HOMOLOG_TO 
BQB_IS_DESCRIBED_BY 
BQB_IS_ENCODED_BY 
BQB_ENCODES 
BQB_OCCURS_IN 
BQB_HAS_PROPERTY 
BQB_IS_PROPERTY_OF 
BQB_UNKNOWN 
Enumerator:
BQM_IS 
BQM_IS_DESCRIBED_BY 
BQM_IS_DERIVED_FROM 
BQM_UNKNOWN 
Enumerator:
MODEL_QUALIFIER 
BIOLOGICAL_QUALIFIER 
UNKNOWN_QUALIFIER 

Function Documentation

This method takes a a string and returns a biol qualifier representing the string.

This method takes a string as argument and returns a biol qualifier type corresponding to that string. For example, passing it the string "<code>hasVersion</code>" will return the qualifier BQB_HAS_VERSION.

Returns:
a qualifier for the given human readable qualifier name.

This method takes a biol qualifier type code and returns a string representing the code.

This method takes a biol qualifier type as argument and returns a string name corresponding to that code. For example, passing it the qualifier BQB_HAS_VERSION will return the string "<code>hasVersion</code>".

Returns:
a human readable qualifier name for the given type.
Note:
The caller does not own the returned string and is therefore not allowed to modify it.
int CVTerm_addResource ( CVTerm_t *  term,
const char *  resource 
)

Adds a resource to the CVTerm_t.

Parameters:
termthe CVTerm_t structure to set.
resourcestring representing the resource e.g. http://www.geneontology.org/#GO:0005892
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED
Note:
this method adds the name "rdf:resource" to the attribute prior to adding it to the resources in this CVTerm.
CVTerm_t* CVTerm_clone ( const CVTerm_t *  c)

Creates a deep copy of the given CVTerm_t structure.

Parameters:
pthe CVTerm_t structure to be copied
Returns:
a (deep) copy of the given CVTerm_t structure.
CVTerm_t* CVTerm_createFromNode ( const XMLNode_t *  node)

Create a new CVTerm_t from the given XMLNode_t and returns a pointer to it.

RDFAnnotations within a model are stored as a List of CVTerms. This allows the user to interact with the CVTerms directly. When LibSBML reads in a model containing RDFAnnotations it parses them into a List of CVTerms and when writing a model it parses the CVTerms into the appropriate annotation structure. This function creates a CVTerm from the XMLNode supplied.

Parameters:
nodean XMLNode_t representing a CVTerm_t.
Returns:
a pointer to the newly created CVTerm_t structure.
Note:
this method assumes that the XMLNode_t is of the correct form

Creates a new CVTerm_t with the given QualifierType_t value type and returns a pointer to it.

The possible QualifierTypes are MODEL_QUALIFIER and BIOLOGICAL_QUALIFIER.

Parameters:
typea QualifierType_t
Returns:
a pointer to the newly created CVTerm_t structure.
void CVTerm_free ( CVTerm_t *  term)

Frees the given CVTerm_t structure.

Parameters:
termthe CVTerm_t structure to be freed.

Takes a CVTerm_t structure and returns the BiolQualifierType_t.

Parameters:
termthe CVTerm_t structure whose BiolQualifierType_t value is sought.
Returns:
the BiolQualifierType_t value of this CVTerm_t or BQB_UNKNOWN (default).

Takes a CVTerm_t structure and returns the ModelQualifierType_t type.

Parameters:
termthe CVTerm_t structure whose ModelQualifierType_t is sought.
Returns:
the ModelQualifierType_t value of this CVTerm_t or BQM_UNKNOWN (default).
unsigned int CVTerm_getNumResources ( CVTerm_t *  term)

Returns the number of resources for this CVTerm.

Parameters:
termthe CVTerm_t structure whose resources are sought.
Returns:
the number of resources in the set of XMLAttributes of this CVTerm.

Takes a CVTerm_t structure and returns its QualifierType_t type.

Parameters:
termthe CVTerm_t structure whose QualifierType_t value is sought
Returns:
the QualifierType_t value of this CVTerm_t or UNKNOWN_QUALIFIER (default).
XMLAttributes_t* CVTerm_getResources ( CVTerm_t *  term)

Takes a CVTerm_t structure and returns the resources.

Parameters:
termthe CVTerm_t structure whose resources are sought.
Returns:
the XMLAttributes_t that store the resources of this CVTerm_t.
char* CVTerm_getResourceURI ( CVTerm_t *  cv,
unsigned int  n 
)

Returns the value of the nth resource for this CVTerm.

Parameters:
termthe CVTerm_t structure
nthe index of the resource to query
Returns:
string representing the value of the nth resource in the set of XMLAttributes of this CVTerm.
Note:
Since the values of the resource attributes in a CVTerm are URIs this is a convenience function to facilitate interaction with the CVTerm class.
int CVTerm_hasRequiredAttributes ( CVTerm_t *  cvt)
int CVTerm_removeResource ( CVTerm_t *  term,
const char *  resource 
)

Removes a resource from the CVTerm_t.

Parameters:
termthe CVTerm_t structure.
resourcestring representing the resource e.g. http://www.geneontology.org/#GO:0005892
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
  • LIBSBML_INVALID_OBJECT
int CVTerm_setBiologicalQualifierType ( CVTerm_t *  term,
BiolQualifierType_t  type 
)

Sets the "BiolQualifierType_t" of this CVTerm_t.

Parameters:
termthe CVTerm_t structure to set.
typethe BiolQualifierType_t
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
  • LIBSBML_INVALID_OBJECT
Note:
if the QualifierType for this object is not BIOLOGICAL_QUALIFIER then the BiolQualifierType_t will default to BQB_UNKNOWN.
int CVTerm_setBiologicalQualifierTypeByString ( CVTerm_t *  term,
const char *  qualifier 
)

Sets the "BiolQualifierType_t" of this CVTerm_t.

Parameters:
termthe CVTerm_t structure to set.
qualifierthe string representing a biol qualifier
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
  • LIBSBML_INVALID_OBJECT
Note:
if the QualifierType for this object is not BIOLOGICAL_QUALIFIER then the BiolQualifierType_t will default to BQB_UNKNOWN.
int CVTerm_setModelQualifierType ( CVTerm_t *  term,
ModelQualifierType_t  type 
)

Sets the "ModelQualifierType_t" of this CVTerm.

Parameters:
termthe CVTerm_t structure to set.
typethe ModelQualifierType_t
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
  • LIBSBML_INVALID_OBJECT
Note:
if the QualifierType for this object is not MODEL_QUALIFIER then the ModelQualifierType will default to BQM_UNKNOWN.
int CVTerm_setModelQualifierTypeByString ( CVTerm_t *  term,
const char *  qualifier 
)

Sets the "ModelQualifierType_t" of this CVTerm.

Parameters:
termthe CVTerm_t structure to set.
qualifierthe string representing a model qualifier
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
  • LIBSBML_INVALID_OBJECT
Note:
if the QualifierType for this object is not MODEL_QUALIFIER then the ModelQualifierType will default to BQM_UNKNOWN.
int CVTerm_setQualifierType ( CVTerm_t *  term,
QualifierType_t  type 
)

Sets the "QualifierType_t" of this CVTerm_t.

Parameters:
termthe CVTerm_t structure to set.
typethe QualifierType_t
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT

This method takes a a string and returns a model qualifier representing the string.

This method takes a string as argument and returns a model qualifier type corresponding to that string. For example, passing it the string "<code>isDescribedBy</code>" will return the qualifier BQM_IS_DESCRIBED_BY.

Returns:
a qualifier for the given human readable qualifier name.

This method takes a model qualifier type code and returns a string representing the code.

This method takes a model qualifier type as argument and returns a string name corresponding to that code. For example, passing it the qualifier BQM_IS_DESCRIBED_BY will return the string "<code>isDescribedBy</code>".

Returns:
a human readable qualifier name for the given type.
Note:
The caller does not own the returned string and is therefore not allowed to modify it.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines