libSBML C API
5.18.0
|
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_t, ModelCreator_t, ModelHistory_t, RDFAnnotationParser_t, and Date_t.
The SBML annotation format consists of RDF-based content placed inside an <annotation>
element attached to an SBML component such as Species_t, Compartment_t, 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_t 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_t 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.
Annotations that refer to controlled vocabularies are managed in libSBML using CVTerm_t objects. The relation-resource pairs discussed in the previous section are the "controlled vocabulary" terms that CVTerm_t is designed to store and manipulate. A set of RDF-based annotations attached to a given SBML <annotation>
element are read by RDFAnnotationParser_t and converted into a list of these CVTerm_t objects. Each CVTerm_t 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_t 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_t, the qualifiers can be manipulated using the methods CVTerm_t::getQualifierType(), CVTerm_t::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_t class, the resource component can be manipulated using the methods CVTerm_t::addResource() and CVTerm_t::removeResource().
Note that a CVTerm_t 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_t 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.
Public Member Functions | |
BiolQualifierType_t | BiolQualifierType_fromString (const char *s) |
This method takes a string and returns a biol qualifier representing the string. More... | |
const char * | BiolQualifierType_toString (BiolQualifierType_t type) |
This method takes a biol qualifier type code and returns a string representing the code. More... | |
int | CVTerm_addNestedCVTerm (CVTerm_t *cvt, const CVTerm_t *term) |
Adds a copy of the given CVTerm_t to the list of nested CVTerm_t's within this CVTerm_t structure. More... | |
int | CVTerm_addResource (CVTerm_t *term, const char *resource) |
Adds a resource to the CVTerm_t. More... | |
CVTerm_t * | CVTerm_clone (const CVTerm_t *term) |
Creates a deep copy of the given CVTerm_t structure. More... | |
CVTerm_t * | CVTerm_createFromNode (const XMLNode_t *node) |
Create a new CVTerm_t from the given XMLNode_t and returns a pointer to it. More... | |
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. More... | |
void | CVTerm_free (CVTerm_t *c) |
Frees the given CVTerm_t structure. More... | |
BiolQualifierType_t | CVTerm_getBiologicalQualifierType (CVTerm_t *term) |
Takes a CVTerm_t structure and returns the BiolQualifierType_t. More... | |
const List_t * | CVTerm_getListNestedCVTerms (const CVTerm_t *cvt) |
Returns a list of CVTerm_t structures contained within this CVTerm_t structure. More... | |
ModelQualifierType_t | CVTerm_getModelQualifierType (CVTerm_t *term) |
Takes a CVTerm_t structure and returns the ModelQualifierType_t type. More... | |
const CVTerm_t * | CVTerm_getNestedCVTerm (const CVTerm_t *cvt, unsigned int n) |
Returns the nth CVTerm_t in the list of CVTerm_t's of this CVTerm_t structure. More... | |
unsigned int | CVTerm_getNumNestedCVTerms (const CVTerm_t *cvt) |
Returns the number of CVTerm_t structures nested within this CVTerm_t structure. More... | |
unsigned int | CVTerm_getNumResources (CVTerm_t *term) |
Returns the number of resources for this CVTerm_t. More... | |
QualifierType_t | CVTerm_getQualifierType (CVTerm_t *term) |
Takes a CVTerm_t structure and returns its QualifierType_t type. More... | |
XMLAttributes_t * | CVTerm_getResources (CVTerm_t *term) |
Takes a CVTerm_t structure and returns the resources. More... | |
char * | CVTerm_getResourceURI (CVTerm_t *term, unsigned int n) |
Returns the value of the nth resource for this CVTerm_t. More... | |
int | CVTerm_hasRequiredAttributes (CVTerm_t *term) |
Checks if the CVTerm_t has all the required attributes. More... | |
CVTerm_t * | CVTerm_removeNestedCVTerm (CVTerm_t *cvt, unsigned int n) |
Removes the nth CVTerm_t in the list of CVTerm_t's of this CVTerm_t structure and returns a pointer to it. More... | |
int | CVTerm_removeResource (CVTerm_t *term, const char *resource) |
Removes a resource from the CVTerm_t. More... | |
int | CVTerm_setBiologicalQualifierType (CVTerm_t *term, BiolQualifierType_t type) |
Sets the BiolQualifierType_t of this CVTerm_t. More... | |
int | CVTerm_setBiologicalQualifierTypeByString (CVTerm_t *term, const char *qualifier) |
Sets the BiolQualifierType_t of this CVTerm_t. More... | |
int | CVTerm_setModelQualifierType (CVTerm_t *term, ModelQualifierType_t type) |
Sets the ModelQualifierType_t of this CVTerm_t. More... | |
int | CVTerm_setModelQualifierTypeByString (CVTerm_t *term, const char *qualifier) |
Sets the ModelQualifierType_t of this CVTerm_t. More... | |
int | CVTerm_setQualifierType (CVTerm_t *term, QualifierType_t type) |
Sets the QualifierType_t of this CVTerm_t. More... | |
ModelQualifierType_t | ModelQualifierType_fromString (const char *s) |
This method takes a string and returns a model qualifier representing the string. More... | |
const char * | ModelQualifierType_toString (ModelQualifierType_t type) |
This method takes a model qualifier type code and returns a string representing the code. More... | |
BiolQualifierType_t BiolQualifierType_fromString | ( | const char * | s | ) |
This method takes 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 "hasVersion"
will return the qualifier BQB_HAS_VERSION.
s | the string to translate to a BiolQualifierType_t value. |
const char * BiolQualifierType_toString | ( | BiolQualifierType_t | type | ) |
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 "hasVersion"
.
type | the BiolQualifierType_t value to translate. |
Adds a copy of the given CVTerm_t to the list of nested CVTerm_t's within this CVTerm_t structure.
int CVTerm_addResource | ( | CVTerm_t * | term, |
const char * | resource | ||
) |
Adds a resource to the CVTerm_t.
term | the CVTerm_t structure to set. |
resource | string representing the resource e.g. http://www.geneontology.org/#GO:0005892 |
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_t of CVTerm_t's. This allows the user to interact with the CVTerm_t's directly. When LibSBML reads in a model containing RDFAnnotations it parses them into a List of CVTerm_t's and when writing a model it parses the CVTerm_t's into the appropriate annotation structure. This function creates a CVTerm_t from the XMLNode_t supplied.
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.
The possible QualifierTypes are MODEL_QUALIFIER and BIOLOGICAL_QUALIFIER.
type | a QualifierType_t. |
void CVTerm_free | ( | CVTerm_t * | c | ) |
BiolQualifierType_t CVTerm_getBiologicalQualifierType | ( | CVTerm_t * | term | ) |
Takes a CVTerm_t structure and returns the BiolQualifierType_t.
term | the CVTerm_t structure whose BiolQualifierType_t value is sought. |
ModelQualifierType_t CVTerm_getModelQualifierType | ( | CVTerm_t * | term | ) |
Takes a CVTerm_t structure and returns the ModelQualifierType_t type.
term | the CVTerm_t structure whose ModelQualifierType_t is sought. |
unsigned int CVTerm_getNumNestedCVTerms | ( | const CVTerm_t * | cvt | ) |
unsigned int CVTerm_getNumResources | ( | CVTerm_t * | term | ) |
Returns the number of resources for this CVTerm_t.
term | the CVTerm_t structure whose resources are sought. |
QualifierType_t CVTerm_getQualifierType | ( | CVTerm_t * | term | ) |
Takes a CVTerm_t structure and returns its QualifierType_t type.
term | the CVTerm_t structure whose QualifierType_t value is sought. |
XMLAttributes_t * CVTerm_getResources | ( | CVTerm_t * | term | ) |
Takes a CVTerm_t structure and returns the resources.
term | the CVTerm_t structure whose resources are sought. |
char * CVTerm_getResourceURI | ( | CVTerm_t * | term, |
unsigned int | n | ||
) |
Returns the value of the nth resource for this CVTerm_t.
term | the CVTerm_t structure. |
n | the index of the resource to query. |
int CVTerm_hasRequiredAttributes | ( | CVTerm_t * | term | ) |
int CVTerm_removeResource | ( | CVTerm_t * | term, |
const char * | resource | ||
) |
Removes a resource from the CVTerm_t.
term | the CVTerm_t structure. |
resource | string representing the resource e.g. http://www.geneontology.org/#GO:0005892 |
int CVTerm_setBiologicalQualifierType | ( | CVTerm_t * | term, |
BiolQualifierType_t | type | ||
) |
Sets the BiolQualifierType_t of this CVTerm_t.
term | the CVTerm_t structure to set. |
type | the BiolQualifierType_t. |
int CVTerm_setBiologicalQualifierTypeByString | ( | CVTerm_t * | term, |
const char * | qualifier | ||
) |
Sets the BiolQualifierType_t of this CVTerm_t.
term | the CVTerm_t structure to set. |
qualifier | the string representing a biol qualifier. |
int CVTerm_setModelQualifierType | ( | CVTerm_t * | term, |
ModelQualifierType_t | type | ||
) |
Sets the ModelQualifierType_t of this CVTerm_t.
term | the CVTerm_t structure to set. |
type | the ModelQualifierType_t. |
int CVTerm_setModelQualifierTypeByString | ( | CVTerm_t * | term, |
const char * | qualifier | ||
) |
Sets the ModelQualifierType_t of this CVTerm_t.
term | the CVTerm_t structure to set. |
qualifier | the string representing a model qualifier. |
int CVTerm_setQualifierType | ( | CVTerm_t * | term, |
QualifierType_t | type | ||
) |
Sets the QualifierType_t of this CVTerm_t.
term | the CVTerm_t structure to set. |
type | the QualifierType_t. |
ModelQualifierType_t ModelQualifierType_fromString | ( | const char * | s | ) |
This method takes 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 "isDescribedBy"
will return the qualifier BQM_IS_DESCRIBED_BY.
s | the string to translate to a ModelQualifierType_t value. |
const char * ModelQualifierType_toString | ( | ModelQualifierType_t | type | ) |
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 "isDescribedBy"
.
type | the ModelQualifierType_t value to translate. |