Adds annotation strings to a model and a species.
#include <iostream>
using namespace std;
LIBSBML_CPP_NAMESPACE_USE
int
main (int argc, char *argv[])
{
unsigned int errors;
if (argc != 3)
{
cout << endl
<< " usage: appendAnnotation <input-filename> <output-filename>" << endl
<< endl;
return 2;
}
if (errors > 0)
{
cout << "Read Error(s):" << endl;
cout << "Correct the above and re-run." << endl;
}
else
{
int n;
const string model_history_annotation =
"<annotation>\n"
" <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"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/\">\n"
" <rdf:Description rdf:about=\"#\">\n"
" <dc:creator rdf:parseType=\"Resource\">\n"
" <rdf:Bag>\n"
" <rdf:li rdf:parseType=\"Resource\">\n"
" <vCard:N rdf:parseType=\"Resource\">\n"
" <vCard:Family>Keating</vCard:Family>\n"
" <vCard:Given>Sarah</vCard:Given>\n"
" </vCard:N>\n"
" <vCard:EMAIL>sbml-team@caltech.edu</vCard:EMAIL>\n"
" <vCard:ORG>\n"
" <vCard:Orgname>University of Hertfordshire</vCard:Orgname>\n"
" </vCard:ORG>\n"
" </rdf:li>\n"
" </rdf:Bag>\n"
" </dc:creator>\n"
" <dcterms:created rdf:parseType=\"Resource\">\n"
" <dcterms:W3CDTF>1999-11-13T06:54:32Z</dcterms:W3CDTF>\n"
" </dcterms:created>\n"
" <dcterms:modified rdf:parseType=\"Resource\">\n"
" <dcterms:W3CDTF>2007-11-31T06:54:00-02:00</dcterms:W3CDTF>\n"
" </dcterms:modified>\n"
" </rdf:Description>\n"
" </rdf:RDF>\n"
"</annotation>\n";
if (n > 0)
{
const string cvterms_annotation =
"<annotation>\n"
" <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"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/\">\n"
" <rdf:Description rdf:about=\"#\">\n"
" <bqbiol:isVersionOf>\n"
" <rdf:Bag>\n"
" <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0005892\"/>\n"
" <rdf:li rdf:resource=\"http://www.ebi.ac.uk/interpro/#IPR002394\"/>\n"
" </rdf:Bag>\n"
" </bqbiol:isVersionOf>\n"
" <bqbiol:is>\n"
" <rdf:Bag>\n"
" <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0005895\"/>\n"
" </rdf:Bag>\n"
" </bqbiol:is>\n"
" </rdf:Description>\n"
" </rdf:RDF>\n"
"</annotation>\n";
}
}
delete d;
return errors;
}
Definition of a CVTerm class for adding annotations to a Model.
SBMLDocument_t * readSBML(const char *filename)
Reads an SBML document from the given file.
Include all SBML types in a single header file.
int writeSBML(const SBMLDocument_t *d, const char *filename)
Writes the given SBML document d to the file named by filename.
Class definition of XMLNode, a node in an XML document tree.
unsigned int getNumSpecies() const
Get the number of Species objects in this Model.
Definition: Model.cpp:3123
const Species * getSpecies(unsigned int n) const
Get the nth Species object in this Model.
Definition: Model.cpp:2564
virtual int appendAnnotation(const XMLNode *annotation)
Appends annotation content to any existing content in the "annotation" subelement of this object.
Definition: Model.cpp:2062
Definition: SBMLDocument.h:351
unsigned int getNumErrors() const
Returns the number of errors or warnings encountered during parsing, consistency checking,...
Definition: SBMLDocument.cpp:1169
void printErrors(std::ostream &stream=std::cerr) const
Prints all the errors or warnings encountered trying to parse, check, or translate this SBML document...
Definition: SBMLDocument.cpp:1192
const Model * getModel() const
Returns the Model object stored in this SBMLDocument.
Definition: SBMLDocument.cpp:350
virtual int appendAnnotation(const XMLNode *annotation)
Appends the given annotation to the "annotation" subelement of this object.
Definition: SBase.cpp:1486
class Species Species_t
Definition: sbmlfwd.h:131