CVTerm.cpp File Reference

Detailed Description

CVTerm I/O.

Author:
Sarah Keating

Copyright (C) 2009-2011 jointly by the following organizations: 1. California Institute of Technology, Pasadena, CA, USA 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK

Copyright (C) 2006-2008 by the California Institute of Technology, Pasadena, CA, USA

Copyright (C) 2002-2005 jointly by the following organizations: 1. California Institute of Technology, Pasadena, CA, USA 2. Japan Science and Technology Agency, Japan

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation. A copy of the license agreement is provided in the file named "LICENSE.txt" included with this software distribution. It is also available online at http://sbml.org/software/libsbml/license.html

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Include dependency graph for CVTerm.cpp:

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 *term, 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 *node)
 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 *term)
 Frees the given CVTerm_t structure.
BiolQualifierType_t CVTerm_getBiologicalQualifierType (CVTerm_t *term)
 Takes a CVTerm_t structure and returns the BiolQualifierType_t.
ModelQualifierType_t CVTerm_getModelQualifierType (CVTerm_t *term)
 Takes a CVTerm_t structure and returns the ModelQualifierType_t type.
unsigned int CVTerm_getNumResources (CVTerm_t *term)
 Returns the number of resources for this CVTerm.
QualifierType_t CVTerm_getQualifierType (CVTerm_t *term)
 Takes a CVTerm_t structure and returns its QualifierType_t type.
XMLAttributes_t * CVTerm_getResources (CVTerm_t *term)
 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 *term, const char *resource)
 Removes a resource from the CVTerm_t.
int CVTerm_setBiologicalQualifierType (CVTerm_t *term, BiolQualifierType_t type)
 Sets the "BiolQualifierType_t" of this CVTerm_t.
int CVTerm_setBiologicalQualifierTypeByString (CVTerm_t *term, const char *qualifier)
 Sets the "BiolQualifierType_t" of this CVTerm_t.
int CVTerm_setModelQualifierType (CVTerm_t *term, ModelQualifierType_t type)
 Sets the "ModelQualifierType_t" of this CVTerm.
int CVTerm_setModelQualifierTypeByString (CVTerm_t *term, const char *qualifier)
 Sets the "ModelQualifierType_t" of this CVTerm.
int CVTerm_setQualifierType (CVTerm_t *term, 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.

Variables

static const char * BIOL_QUALIFIER_STRINGS []
static const char * MODEL_QUALIFIER_STRINGS []

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.

Variable Documentation

const char* BIOL_QUALIFIER_STRINGS[] [static]
Initial value:
{
    "is"
  , "hasPart"
  , "isPartOf"
  , "isVersionOf"
  , "hasVersion"
  , "isHomologTo"
  , "isDescribedBy"
  , "isEncodedBy"
  , "encodes"
  , "occursIn"
  , "hasProperty"
  , "isPropertyOf"    
}
const char* MODEL_QUALIFIER_STRINGS[] [static]
Initial value:
{
    "is"
  , "isDescribedBy"
  , "isDerivedFrom"
}
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines