libSBML C++ API  5.20.2
CVTerm Class Reference

Detailed Description

A MIRIAM-compliant controlled vocabulary term.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.

The SBML Level 2 and Level 3 specifications define a simple format for annotating models when (a) referring to controlled vocabulary terms and database identifiers that define and describe biological and biochemical entities, and (b) describing the creator of a model and the model's modification history. This SBML format is a concrete syntax that conforms to the guidelines of MIRIAM ("Minimum Information Requested in the Annotation of biochemical Models", Nature Biotechnology, vol. 23, no. 12, Dec. 2005). The format uses a subset of W3C RDF (Resource Description Format). In order to help application developers work with annotations in this format, libSBML provides several helper classes that provide higher-level interfaces to the data elements; these classes include CVTerm, ModelCreator, ModelHistory, RDFAnnotationParser, and Date.

Components of an SBML annotation

The SBML annotation format consists of RDF-based content placed inside an <annotation> element attached to an SBML component such as Species, Compartment, etc. A small change was introduced in SBML Level 2 Version 5 and SBML Level 3 Version 2 to permit nested annotations: lower Versions of the SBML specifications did not explicitly allow this. We first describe the different parts of SBML annotations in XML form for SBML Level 2 below Version 5 and SBML Level 3 below Version 2:

<SBML_ELEMENT +++ metaid="meta id" +++>
  +++
  <annotation>
    +++
    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:dcterm="http://purl.org/dc/terms/"
             xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#"
             xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
             xmlns:bqmodel="http://biomodels.net/model-qualifiers/" >
      <rdf:Description rdf:about="#meta id">
        HISTORY
        <RELATION_ELEMENT>
          <rdf:Bag>
            <rdf:li rdf:resource="URI" />
            ...
          </rdf:Bag>
        </RELATION_ELEMENT>
        ...
      </rdf:Description>
      +++
    </rdf:RDF>
    +++
  </annotation>
  +++
</SBML_ELEMENT>

In the template above, the placeholder SBML_ELEMENT stands for the XML tag name of an SBML model component (e.g., model, reaction, etc.) and the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, the symbol +++ is a placeholder for either no content or valid XML content that is not defined by this annotation scheme, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element. The optional content HISTORY is a creation and modification history; in libSBML, this is stored using ModelHistory objects.

The placeholder RELATION_ELEMENT refers to a BioModels.net qualifier element name. This is an element in either the XML namespace "http://biomodels.net/model-qualifiers" (for model qualifiers) or "http://biomodels.net/biology-qualifiers" (for biological qualifier). Note that these namespace URIs are only labels, and not actual Web locations, which means you cannot visit an address such as "http://biomodels.net/model-qualifiers" in your browser or try to have your application access it. Refer instead to the enumerations ModelQualifierType_t and BiolQualifierType_t for a list of the available relationship elements that can be used for RELATION_ELEMENT.

The URI is a required data value that uniquely identifies a resource and data within that resource to which the annotation refers. Again, being URIs, these do not refer to physical Web locations; nevertheless, applications will often want a means of finding the resource to which a given URI refers. Providing the facilities for this task is the purpose of MIRIAM Resources, described in detail online at http://biomodels.net/miriam) and also in the paper "MIRIAM Resources: tools to generate and resolve robust cross-references in Systems Biology", BMC Systems Biology, 58(1), 2007.

Finally, the following is the same template as above, but this time showing the nested content permitted by the most recent SBML specifications (SBML Level 2 Version 5 and Level 3 Version 2):

<SBML_ELEMENT +++ metaid="meta id" +++>
  +++
  <annotation>
    +++
    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:dcterm="http://purl.org/dc/terms/"
             xmlns:vcard="http://www.w3.org/2001/vcard-rdf/3.0#"
             xmlns:bqbiol="http://biomodels.net/biology-qualifiers/"
             xmlns:bqmodel="http://biomodels.net/model-qualifiers/" >
      <rdf:Description rdf:about="#meta id">
        HISTORY
        <RELATION_ELEMENT>
          <rdf:Bag>
            <rdf:li rdf:resource="URI" />
            NESTED_CONTENT
            ...
          </rdf:Bag>
        </RELATION_ELEMENT>
        ...
      </rdf:Description>
      +++
    </rdf:RDF>
    +++
  </annotation>
  +++
</SBML_ELEMENT>

The placeholder NESTED_CONTENT refers to other optional RDF elements such as "bqbiol:isDescribedBy" that describe a clarification or another annotation about the RELATION_ELEMENT in which it appears. Nested content allows one to, for example, describe protein modifications on species, or to add evidence codes for an annotation. Nested content relates to its containing RELATION_ELEMENT, not the other way around. It qualifies it, but does not change its meaning. As such, ignoring a NESTED_CONTENT does not affect the information provided by the containing RELATION_ELEMENT.

For more information about SBML annotations in general, please refer to Section 6 in the SBML Level 2 (Versions 2–4) or Level 3 specification documents.

The parts of a CVTerm

Annotations that refer to controlled vocabularies are managed in libSBML using CVTerm objects. The relation-resource pairs discussed in the previous section are the "controlled vocabulary" terms that CVTerm is designed to store and manipulate. A set of RDF-based annotations attached to a given SBML <annotation> element are read by RDFAnnotationParser and converted into a list of these CVTerm objects. Each CVTerm object instance stores the following components of an annotation:

  • The qualifier, which can be a BioModels.net "biological qualifier", a BioModels.net "model qualifier", or an unknown qualifier (as far as the CVTerm class is concerned). Qualifiers are used in MIRIAM to indicate the nature of the relationship between the object being annotated and the resource. In CVTerm, the qualifiers can be manipulated using the methods CVTerm::getQualifierType(), CVTerm::setQualifierType(), and related methods.

  • The resource, represented by a URI (which, we must remind developers, is not the same as a URL). In the CVTerm class, the resource component can be manipulated using the methods CVTerm::addResource() and CVTerm::removeResource().

Note that a CVTerm contains a single qualifier, but possibly more than one resource. This corresponds to the possibility of an annotation that points to multiple resources, all of which are qualified by the same BioModels.net qualifier. The CVTerm object class supports this by supporting a list of resources.

Detailed explanations of the qualifiers defined by BioModels.net can be found at http://co.mbine.org/standards/qualifiers.

Examples
addCVTerms.cpp, addingEvidenceCodes_1.cpp, and addingEvidenceCodes_2.cpp.

Public Member Functions

int addNestedCVTerm (const CVTerm *term)
 Adds a copy of the given CVTerm object to the list of nested CVTerm objects within this CVTerm object. More...
 
int addResource (const std::string &resource)
 Adds a resource reference to this CVTerm object. More...
 
CVTermclone () const
 Creates and returns a deep copy of this CVTerm object. More...
 
 CVTerm (const CVTerm &orig)
 Copy constructor; creates a copy of a CVTerm object. More...
 
 CVTerm (const XMLNode node)
 Creates a new CVTerm from the given XMLNode. More...
 
 CVTerm (QualifierType_t type=UNKNOWN_QUALIFIER)
 Creates an empty CVTerm, optionally with the given QualifierType_t value type . More...
 
BiolQualifierType_t getBiologicalQualifierType ()
 Returns the biological qualifier type of this CVTerm object. More...
 
BiolQualifierType_t getBiologicalQualifierType () const
 Returns the biological qualifier type of this CVTerm object. More...
 
ListgetListNestedCVTerms ()
 Returns a list of CVTerm objects contained within this CVTerm object. More...
 
const ListgetListNestedCVTerms () const
 Returns a list of CVTerm objects contained within this CVTerm object. More...
 
ModelQualifierType_t getModelQualifierType ()
 Returns the model qualifier type of this CVTerm object. More...
 
ModelQualifierType_t getModelQualifierType () const
 Returns the model qualifier type of this CVTerm object. More...
 
CVTermgetNestedCVTerm (unsigned int n)
 Returns the nth CVTerm in the list of CVTerms of this CVTerm object. More...
 
const CVTermgetNestedCVTerm (unsigned int n) const
 Returns the nth CVTerm in the list of CVTerms of this CVTerm object. More...
 
unsigned int getNumNestedCVTerms () const
 Returns the number of CVTerm objects nested within this CVTerm object. More...
 
unsigned int getNumResources ()
 Returns the number of resources for this CVTerm object. More...
 
unsigned int getNumResources () const
 Returns the number of resources for this CVTerm object. More...
 
QualifierType_t getQualifierType ()
 Returns the qualifier type of this CVTerm object. More...
 
QualifierType_t getQualifierType () const
 Returns the qualifier type of this CVTerm object. More...
 
XMLAttributesgetResources ()
 Returns the resource references for this CVTerm object. More...
 
const XMLAttributesgetResources () const
 Returns the resources for this CVTerm object. More...
 
std::string getResourceURI (unsigned int n)
 Returns the value of the nth resource for this CVTerm object. More...
 
std::string getResourceURI (unsigned int n) const
 Returns the value of the nth resource for this CVTerm object. More...
 
bool hasRequiredAttributes ()
 Predicate returning true if all the required elements for this CVTerm object have been set. More...
 
CVTermoperator= (const CVTerm &rhs)
 Assignment operator for CVTerm. More...
 
CVTermremoveNestedCVTerm (unsigned int n)
 Removes the nth CVTerm in the list of CVTerms of this CVTerm object and returns a pointer to it. More...
 
int removeResource (std::string resource)
 Removes a resource URI from the set of resources stored in this CVTerm object. More...
 
int setBiologicalQualifierType (BiolQualifierType_t type)
 Sets the BiolQualifierType_t value of this CVTerm object. More...
 
int setBiologicalQualifierType (const std::string &qualifier)
 Sets the BiolQualifierType_t of this CVTerm object. More...
 
int setModelQualifierType (const std::string &qualifier)
 Sets the ModelQualifierType_t value of this CVTerm object. More...
 
int setModelQualifierType (ModelQualifierType_t type)
 Sets the ModelQualifierType_t value of this CVTerm object. More...
 
int setQualifierType (QualifierType_t type)
 Sets the QualifierType_t of this CVTerm object. More...
 
 ~CVTerm ()
 Destroys this CVTerm. More...
 

Constructor & Destructor Documentation

◆ CVTerm() [1/3]

CVTerm::CVTerm ( QualifierType_t  type = UNKNOWN_QUALIFIER)

Creates an empty CVTerm, optionally with the given QualifierType_t value type .

The SBML Level 2 and Level 3 specifications define a simple format for annotating models when (a) referring to controlled vocabulary terms and database identifiers that define and describe biological and other entities, and (b) describing the creator of a model and the model's modification history. The annotation content is stored in <annotation> elements attached to individual SBML elements. The format for storing the content inside SBML <annotation> elements is a subset of W3C RDF (Resource Description Format) expressed in XML. The CVTerm class provides a programming interface for working directly with controlled vocabulary term ("CV term") objects without having to deal directly with the XML form. When libSBML reads in an SBML model containing RDF annotations, it parses those annotations into a list of CVTerm objects, and when writing a model, it parses the CVTerm objects back into the appropriate SBML <annotation> structure.

This method creates an empty CVTerm object. The possible qualifier types usable as values of type are MODEL_QUALIFIER and BIOLOGICAL_QUALIFIER. If an explicit value for type is not given, this method defaults to using UNKNOWN_QUALIFIER. The QualifierType_t value can be set later using the CVTerm::setQualifierType() method.

Different BioModels.net qualifier elements encode different types of relationships. Please refer to the SBML specification or the BioModels.net qualifiers web page for an explanation of the meaning of these different qualifiers.

Parameters
typea QualifierType_t value.

◆ CVTerm() [2/3]

CVTerm::CVTerm ( const XMLNode  node)

Creates a new CVTerm from the given XMLNode.

The SBML Level 2 and Level 3 specifications define a simple format for annotating models when (a) referring to controlled vocabulary terms and database identifiers that define and describe biological and other entities, and (b) describing the creator of a model and the model's modification history. The annotation content is stored in <annotation> elements attached to individual SBML elements. The format for storing the content inside SBML <annotation> elements is a subset of W3C RDF (Resource Description Format) expressed in XML. The CVTerm class provides a programming interface for working directly with controlled vocabulary term ("CV term") objects without having to deal directly with the XML form. When libSBML reads in an SBML model containing RDF annotations, it parses those annotations into a list of CVTerm objects, and when writing a model, it parses the CVTerm objects back into the appropriate SBML <annotation> structure.

This method creates a CVTerm object from the given XMLNode object node. XMLNode is libSBML's representation of a node in an XML tree of elements, and each such element can be placed in a namespace. This constructor looks for the element to be in the XML namespaces "http://biomodels.net/model-qualifiers" (for model qualifiers) and "http://biomodels.net/biology-qualifiers" (for biological qualifier), and if they are, creates CVTerm objects for the result.

Parameters
nodean XMLNode representing a CVTerm.
Note
This method assumes that the given XMLNode object node is of the correct structural form.

◆ ~CVTerm()

CVTerm::~CVTerm ( )

Destroys this CVTerm.

◆ CVTerm() [3/3]

CVTerm::CVTerm ( const CVTerm orig)

Copy constructor; creates a copy of a CVTerm object.

Parameters
origthe CVTerm instance to copy.

Member Function Documentation

◆ addNestedCVTerm()

int CVTerm::addNestedCVTerm ( const CVTerm term)

Adds a copy of the given CVTerm object to the list of nested CVTerm objects within this CVTerm object.

Parameters
termthe CVTerm to assign.
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:

◆ addResource()

int CVTerm::addResource ( const std::string &  resource)

Adds a resource reference to this CVTerm object.

The SBML Level 2 and Level 3 specifications define a simple format for annotating models when (a) referring to controlled vocabulary terms and database identifiers that define and describe biological and other entities, and (b) describing the creator of a model and the model's modification history. The annotation content is stored in <annotation> elements attached to individual SBML elements. The format for storing the content inside SBML <annotation> elements is a subset of W3C RDF (Resource Description Format) expressed in XML. The CVTerm class provides a programming interface for working directly with controlled vocabulary term ("CV term") objects without having to deal directly with the XML form. When libSBML reads in an SBML model containing RDF annotations, it parses those annotations into a list of CVTerm objects, and when writing a model, it parses the CVTerm objects back into the appropriate SBML <annotation> structure.

The specific RDF element used in this SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element containing one or more <rdf:li> elements. Each such element refers to a data item in an external resource; the resource and data item are together identified uniquely using a URI. The following template illustrates the structure:

<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
      <rdf:li rdf:resource="resource URI" />
      ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>

In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element. The placeholder RELATION_ELEMENT refers to a BioModels.net qualifier element name. This is an element in either the XML namespace "http://biomodels.net/model-qualifiers" (for model qualifiers) or "http://biomodels.net/biology-qualifiers" (for biological qualifier).

The resource URI is a required data value that uniquely identifies a resource and data within that resource to which the annotation refers. The present method allows callers to add a reference to a resource URI with the same relationship to the enclosing SBML object. (In other words, the argument to this method is a resource URI as shown in the XML fragment above.) Resources are stored in this CVTerm object within an XMLAttributes object.

The relationship of this CVTerm to the enclosing SBML object can be determined using the CVTerm methods such as CVTerm::getModelQualifierType() and CVTerm::getBiologicalQualifierType().

Parameters
resourcea string representing the URI of the resource and data item being referenced; 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:
See also
getResources()
removeResource(std::string resource)
getQualifierType()
getModelQualifierType()
getBiologicalQualifierType()
Examples
addCVTerms.cpp, addingEvidenceCodes_1.cpp, and addingEvidenceCodes_2.cpp.

◆ clone()

CVTerm * CVTerm::clone ( ) const

Creates and returns a deep copy of this CVTerm object.

Returns
the (deep) copy of this CVTerm object.

◆ getBiologicalQualifierType() [1/2]

BiolQualifierType_t CVTerm::getBiologicalQualifierType ( )

Returns the biological qualifier type of this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The placeholder RELATION_ELEMENT refers to a BioModels.net qualifier element name. This is an element in either the XML namespace "http://biomodels.net/model-qualifiers" (for model qualifiers) or "http://biomodels.net/biology-qualifiers" (for biological qualifier). Callers will typically use CVTerm::getQualifierType() to find out the type of qualifier relevant to this particular CVTerm object, then if it is a biological qualifier, use the present method to determine the specific qualifier.

Annotations with biological qualifiers express a relationship between an annotation resource and the biological concept represented by a given object in the model. The diagram below illustrates the relationship in this case:

Relationship expressed by biological qualifiers


The set of known biological qualifiers is, at the time of this libSBML release, the following:

Any other BioModels.net qualifier found in the model is considered unknown by libSBML and reported as BQB_UNKNOWN.

Returns
the BiolQualifierType_t value of this object or BQB_UNKNOWN (the default).

◆ getBiologicalQualifierType() [2/2]

BiolQualifierType_t CVTerm::getBiologicalQualifierType ( ) const

Returns the biological qualifier type of this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The placeholder RELATION_ELEMENT refers to a BioModels.net qualifier element name. This is an element in either the XML namespace "http://biomodels.net/model-qualifiers" (for model qualifiers) or "http://biomodels.net/biology-qualifiers" (for biological qualifier). Callers will typically use CVTerm::getQualifierType() to find out the type of qualifier relevant to this particular CVTerm object, then if it is a biological qualifier, use the present method to determine the specific qualifier.

Annotations with biological qualifiers express a relationship between an annotation resource and the biological concept represented by a given object in the model. The diagram below illustrates the relationship in this case:

Relationship expressed by biological qualifiers


The set of known biological qualifiers is, at the time of this libSBML release, the following:

Any other BioModels.net qualifier found in the model is considered unknown by libSBML and reported as BQB_UNKNOWN.

Returns
the BiolQualifierType_t value of this object or BQB_UNKNOWN (the default).

◆ getListNestedCVTerms() [1/2]

List* CVTerm::getListNestedCVTerms ( )

Returns a list of CVTerm objects contained within this CVTerm object.

Returns
the list of CVTerms for this CVTerm object.

◆ getListNestedCVTerms() [2/2]

const List* CVTerm::getListNestedCVTerms ( ) const

Returns a list of CVTerm objects contained within this CVTerm object.

Returns
the list of CVTerms for this CVTerm object.

◆ getModelQualifierType() [1/2]

ModelQualifierType_t CVTerm::getModelQualifierType ( )

Returns the model qualifier type of this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The placeholder RELATION_ELEMENT refers to a BioModels.net qualifier element name. This is an element in either the XML namespace "http://biomodels.net/model-qualifiers" (for model qualifiers) or "http://biomodels.net/biology-qualifiers" (for biological qualifier). Callers will typically use CVTerm::getQualifierType() to find out the type of qualifier relevant to this particular CVTerm object, then if it is a model qualifier, use the present method to determine the specific qualifier.

Annotations with model qualifiers express a relationship between an annotation resource and the modeling concept represented by a given object in the model. The diagram below illustrates the relationship in this case:

Relationship expressed by model qualifiers


The set of known model qualifiers is, at the time of this libSBML release, the following:

Any other BioModels.net qualifier found in the model is considered unknown by libSBML and reported as BQM_UNKNOWN.

Returns
the ModelQualifierType_t value of this object or BQM_UNKNOWN (the default).

◆ getModelQualifierType() [2/2]

ModelQualifierType_t CVTerm::getModelQualifierType ( ) const

Returns the model qualifier type of this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The placeholder RELATION_ELEMENT refers to a BioModels.net qualifier element name. This is an element in either the XML namespace "http://biomodels.net/model-qualifiers" (for model qualifiers) or "http://biomodels.net/biology-qualifiers" (for biological qualifier). Callers will typically use CVTerm::getQualifierType() to find out the type of qualifier relevant to this particular CVTerm object, then if it is a model qualifier, use the present method to determine the specific qualifier.

Annotations with model qualifiers express a relationship between an annotation resource and the modeling concept represented by a given object in the model. The diagram below illustrates the relationship in this case:

Relationship expressed by model qualifiers


The set of known model qualifiers is, at the time of this libSBML release, the following:

Any other BioModels.net qualifier found in the model is considered unknown by libSBML and reported as BQM_UNKNOWN.

Returns
the ModelQualifierType_t value of this object or BQM_UNKNOWN (the default).

◆ getNestedCVTerm() [1/2]

CVTerm* CVTerm::getNestedCVTerm ( unsigned int  n)

Returns the nth CVTerm in the list of CVTerms of this CVTerm object.

Parameters
nunsigned int the index of the CVTerm to retrieve.
Returns
the nth CVTerm in the list of CVTerms for this CVTerm object or NULL if no such object exists.

◆ getNestedCVTerm() [2/2]

const CVTerm* CVTerm::getNestedCVTerm ( unsigned int  n) const

Returns the nth CVTerm in the list of CVTerms of this CVTerm object.

Parameters
nunsigned int the index of the CVTerm to retrieve.
Returns
the nth CVTerm in the list of CVTerms for this CVTerm object or NULL if no such object exists.

◆ getNumNestedCVTerms()

unsigned int CVTerm::getNumNestedCVTerms ( ) const

Returns the number of CVTerm objects nested within this CVTerm object.

Returns
the number of CVTerms nested within this CVTerm object.
Note
this does not recurse through potentially nested CVTerm objects within a given nested CVTerm. It returns the number of terms immediately nested within this CVTerm.

◆ getNumResources() [1/2]

unsigned int CVTerm::getNumResources ( )

Returns the number of resources for this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The fragment above illustrates that there can be more than one resource referenced by a given relationship annotation (i.e., the resource URI values associated with a particular RELATION_ELEMENT). The present method returns a count of the resources stored in this CVTerm object.

Returns
the number of resources in the set of XMLAttributes of this CVTerm.
See also
getResources()
getResourceURI(unsigned int n)

◆ getNumResources() [2/2]

unsigned int CVTerm::getNumResources ( ) const

Returns the number of resources for this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The fragment above illustrates that there can be more than one resource referenced by a given relationship annotation (i.e., the resource URI values associated with a particular RELATION_ELEMENT). The present method returns a count of the resources stored in this CVTerm object.

Returns
the number of resources in the set of XMLAttributes of this CVTerm.
See also
getResources()
getResourceURI(unsigned int n)

◆ getQualifierType() [1/2]

QualifierType_t CVTerm::getQualifierType ( )

Returns the qualifier type of this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The placeholder RELATION_ELEMENT refers to a BioModels.net qualifier element name. This is an element in either the XML namespace "http://biomodels.net/model-qualifiers" (for model qualifiers) or "http://biomodels.net/biology-qualifiers" (for biological qualifier). The present method returns a code identifying which one of these two relationship namespaces is being used; any other qualifier in libSBML is considered unknown (as far as the CVTerm class is concerned). Consequently, this method will return one of the following values:

The specific relationship of this CVTerm to the enclosing SBML object can be determined using the CVTerm methods such as CVTerm::getModelQualifierType() and CVTerm::getBiologicalQualifierType(). Callers will typically want to use the present method to find out which one of the other two methods to call to find out the specific relationship.

Returns
the QualifierType_t value of this object or UNKNOWN_QUALIFIER (the default).
See also
getResources()
getModelQualifierType()
getBiologicalQualifierType()

◆ getQualifierType() [2/2]

QualifierType_t CVTerm::getQualifierType ( ) const

Returns the qualifier type of this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The placeholder RELATION_ELEMENT refers to a BioModels.net qualifier element name. This is an element in either the XML namespace "http://biomodels.net/model-qualifiers" (for model qualifiers) or "http://biomodels.net/biology-qualifiers" (for biological qualifier). The present method returns a code identifying which one of these two relationship namespaces is being used; any other qualifier in libSBML is considered unknown (as far as the CVTerm class is concerned). Consequently, this method will return one of the following values:

The specific relationship of this CVTerm to the enclosing SBML object can be determined using the CVTerm methods such as CVTerm::getModelQualifierType() and CVTerm::getBiologicalQualifierType(). Callers will typically want to use the present method to find out which one of the other two methods to call to find out the specific relationship.

Returns
the QualifierType_t value of this object or UNKNOWN_QUALIFIER (the default).
See also
getResources()
getModelQualifierType()
getBiologicalQualifierType()

◆ getResources() [1/2]

XMLAttributes * CVTerm::getResources ( )

Returns the resource references for this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The resource URI values shown in the template above are stored internally in CVTerm objects using an XMLAttributes object. Each attribute stored inside the XMLAttributes will have the same name (specifically, "rdf:resource") but a different value, and the value will be a resource URI shown in the XML template above.

A valid CVTerm entity must always have at least one resource and a value for the relationship qualifier.

Returns
the XMLAttributes that store the resources of this CVTerm.
See also
getQualifierType()
addResource(const std::string& resource)
getResourceURI(unsigned int n)

◆ getResources() [2/2]

const XMLAttributes * CVTerm::getResources ( ) const

Returns the resources for this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The resource URI values shown in the template above are stored internally in CVTerm objects using an XMLAttributes object. Each attribute stored inside the XMLAttributes will have the same name (specifically, "rdf:resource") but a different value, and the value will be a resource URI shown in the XML template above.

A valid CVTerm entity must always have at least one resource and a value for the relationship qualifier.

Returns
the XMLAttributes that store the resources of this CVTerm.
See also
getQualifierType()
addResource(const std::string& resource)
getResourceURI(unsigned int n)

◆ getResourceURI() [1/2]

std::string CVTerm::getResourceURI ( unsigned int  n)

Returns the value of the nth resource for this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The fragment above illustrates that there can be more than one resource referenced by a given relationship annotation (i.e., the resource URI values associated with a particular RELATION_ELEMENT). LibSBML stores all resource URIs in a single CVTerm object for a given relationship. Callers can use CVTerm::getNumResources() to find out how many resources are stored in this CVTerm object, then call this method to retrieve the nth resource URI.

Parameters
nthe index of the resource to query.
Returns
string representing the value of the nth resource in the set of XMLAttributes of this CVTerm.
See also
getNumResources()
getQualifierType()

◆ getResourceURI() [2/2]

std::string CVTerm::getResourceURI ( unsigned int  n) const

Returns the value of the nth resource for this CVTerm object.

The RDF element used in the SBML format for referring to external entities is <rdf:Description>, with a <rdf:Bag> element inside of it containing one or more <rdf:li> elements. The following template illustrates the structure:
<rdf:Description rdf:about="#meta id">
  HISTORY
  <RELATION_ELEMENT>
    <rdf:Bag>
    <rdf:li rdf:resource="resource URI" />
    ...
    </rdf:Bag>
  </RELATION_ELEMENT>
  ...
</rdf:Description>
In the template above, the placeholder meta id stands for the element's meta identifier, which is a field available on all SBML components derived from the SBase base object class. The dotted portions are optional, and the ellipses ... are placeholders for zero or more elements of the same form as the immediately preceding element.

The fragment above illustrates that there can be more than one resource referenced by a given relationship annotation (i.e., the resource URI values associated with a particular RELATION_ELEMENT). LibSBML stores all resource URIs in a single CVTerm object for a given relationship. Callers can use CVTerm::getNumResources() to find out how many resources are stored in this CVTerm object, then call this method to retrieve the nth resource URI.

Parameters
nthe index of the resource to query.
Returns
string representing the value of the nth resource in the set of XMLAttributes of this CVTerm.
See also
getNumResources()
getQualifierType()

◆ hasRequiredAttributes()

bool CVTerm::hasRequiredAttributes ( )

Predicate returning true if all the required elements for this CVTerm object have been set.

Note
The required attributes for a CVTerm are:
  • a qualifier type, which can be either a model qualifier or a biological qualifier
  • at least one resource

◆ operator=()

CVTerm & CVTerm::operator= ( const CVTerm rhs)

Assignment operator for CVTerm.

Parameters
rhsthe object whose values are used as the basis of the assignment.

◆ removeNestedCVTerm()

CVTerm* CVTerm::removeNestedCVTerm ( unsigned int  n)

Removes the nth CVTerm in the list of CVTerms of this CVTerm object and returns a pointer to it.

Parameters
nunsigned int the index of the CVTerm to retrieve.
Returns
a pointer to the nth CVTerm in the list of CVTerms for this CVTerm object.

◆ removeResource()

int CVTerm::removeResource ( std::string  resource)

Removes a resource URI from the set of resources stored in this CVTerm object.

Parameters
resourcea string representing the resource URI to remove; 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:
See also
addResource(const std::string& resource)

◆ setBiologicalQualifierType() [1/2]

int CVTerm::setBiologicalQualifierType ( BiolQualifierType_t  type)

Sets the BiolQualifierType_t value of this CVTerm object.

Parameters
typethe BiolQualifierType_t value.
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:
Note
If the Qualifier Type of this object is not BIOLOGICAL_QUALIFIER, then the BiolQualifierType_t value will default to BQB_UNKNOWN.
See also
getQualifierType()
setQualifierType()
Examples
addCVTerms.cpp, addingEvidenceCodes_1.cpp, and addingEvidenceCodes_2.cpp.

◆ setBiologicalQualifierType() [2/2]

int CVTerm::setBiologicalQualifierType ( const std::string &  qualifier)

Sets the BiolQualifierType_t of this CVTerm object.

Parameters
qualifierthe string representing a biology 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:
Note
If the Qualifier Type of this object is not BIOLOGICAL_QUALIFIER, then the BiolQualifierType_t will default to BQB_UNKNOWN.
See also
getQualifierType()
setQualifierType()

◆ setModelQualifierType() [1/2]

int CVTerm::setModelQualifierType ( const std::string &  qualifier)

Sets the ModelQualifierType_t value of this CVTerm object.

Parameters
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:
Note
If the Qualifier Type of this object is not MODEL_QUALIFIER, then the ModelQualifierType_t value will default to BQM_UNKNOWN.
See also
getQualifierType()
setQualifierType()

◆ setModelQualifierType() [2/2]

int CVTerm::setModelQualifierType ( ModelQualifierType_t  type)

Sets the ModelQualifierType_t value of this CVTerm object.

Parameters
typethe ModelQualifierType_t value.
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:
Note
If the QualifierType_t value of this object is not MODEL_QUALIFIER, then the then the ModelQualifierType_t value will default to BQM_UNKNOWN.
See also
getQualifierType()
setQualifierType()

◆ setQualifierType()

int CVTerm::setQualifierType ( QualifierType_t  type)

Sets the QualifierType_t of this CVTerm object.

Parameters
typethe QualifierType_t value.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. This particular function only does one thing irrespective of user input or object state, and thus will only return a single value:
See also
getQualifierType()
Examples
addCVTerms.cpp.