libSBML C API  5.18.0
RDFAnnotationParser_t Class Reference

Detailed Description

MIRIAM-compliant RDF annotation reader/writer.

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.

RDFAnnotationParser_t is a libSBML construct used as part of the libSBML support for annotations conforming to the guidelines specified by MIRIAM ("Minimum Information Requested in the Annotation of biochemical Models", Nature Biotechnology, vol. 23, no. 12, Dec. 2005). Section 6 of the SBML Level 2 and Level 3 specification documents defines a recommended way of encoding MIRIAM information using a subset of RDF (Resource Description Format). The general scheme is as follows. A set of RDF-based annotations attached to a given SBML <annotation> element are read by RDFAnnotationParser_t and converted into a list of CVTerm_t objects. There are different versions of the main method, RDFAnnotationParser_t::parseRDFAnnotation(const XMLNode_t *annotation, List *CVTerms) and RDFAnnotationParser_t::parseRDFAnnotation(const XMLNode_t *annotation), used depending on whether the annotation in question concerns the MIRIAM model history or other MIRIAM resource annotations. A special object class, ModelHistory_t, is used to make it easier to manipulate model history annotations.

All of the methods on RDFAnnotationParser_t are static; the class exists only to encapsulate the annotation and CVTerm_t parsing and manipulation functionality.

Public Member Functions

XMLNode_tRDFAnnotationParser_createAnnotation ()
 Creates a blank annotation and returns the XMLNode_t corresonding to it. More...
 
XMLNode_tRDFAnnotationParser_createCVTerms (const SBase_t *obj)
 Takes a list of CVTerms from an SBML object and creates a the RDF "Description" element. More...
 
XMLNode_tRDFAnnotationParser_createRDFAnnotation ()
 Creates blank RDF annotation content organized in the form defined in Section 6 of the SBML Level 2 Version 4 and the SBML Level 3 specifications. More...
 
XMLNode_tRDFAnnotationParser_createRDFAnnotationForLevelAndVersion (unsigned int level, unsigned int version)
 Creates blank RDF annotation content organized in the form defined in Section 6 of the SBML Level 2 Version 4 and the SBML Level 3 specifications. More...
 
XMLNode_tRDFAnnotationParser_createRDFDescription (const SBase_t *obj)
 Takes an SBML object and creates an XMLNode_t corresponding to an RDF "Description" element. More...
 
XMLNode_tRDFAnnotationParser_deleteRDFAnnotation (XMLNode_t *annotation)
 Deletes any RDF annotation found in the given XMLNode_t tree and returns any remaining annotation content. More...
 
XMLNode_tRDFAnnotationParser_parseCVTerms (const SBase_t *obj)
 Takes a list of CVTerms from an SBML object and creates a complete SBML annotation around it. More...
 
XMLNode_tRDFAnnotationParser_parseModelHistory (const SBase_t *obj)
 Takes an SBML Model_t structure, reads off the model history information stored in it, and creates a complete SBML annotation to store that history. More...
 
void RDFAnnotationParser_parseRDFAnnotation (const XMLNode_t *annotation, List_t *CVTerms)
 Parses an annotation (given as an XMLNode_t tree) into a list of CVTerms. More...
 
ModelHistory_tRDFAnnotationParser_parseRDFAnnotationWithModelHistory (const XMLNode_t *annotation)
 Parses an annotation into a ModelHistory_t structure. More...
 

Member Function Documentation

XMLNode_t * RDFAnnotationParser_createAnnotation ( )

Creates a blank annotation and returns the XMLNode_t corresonding to it.

The annotation created by this method is a completely empty SBML <annotation> element. One use for this is to then call createRDFAnnotation() to construct RDF content for this empty annotation.

Returns
a pointer to an XMLNode_t for the annotation
See also
RDFAnnotationParser_createRDFAnnotation()
XMLNode_t * RDFAnnotationParser_createCVTerms ( const SBase_t obj)

Takes a list of CVTerms from an SBML object and creates a the RDF "Description" element.

This essentially takes the given SBML object, reads out the CVTerms attached to it, calls createRDFDescription() to create an RDF "Description" element to hold the terms and adds each term with appropriate qualifiers.

Parameters
objthe SBML object to start from.
Returns
the XMLNode_t tree corresponding to the Description element of an RDF annotation.
XMLNode_t * RDFAnnotationParser_createRDFAnnotation ( )

Creates blank RDF annotation content organized in the form defined in Section 6 of the SBML Level 2 Version 4 and the SBML Level 3 specifications.

The annotation created by this method has namespace declarations for all the relevant XML namespaces used in RDF annotations and also has an empty RDF element. Note that this is not the containing <annotation> element; the method RDFAnnotationParser_createAnnotation() is available for that purpose.

Returns
a pointer to an XMLNode_t represting the annotation.
XMLNode_t * RDFAnnotationParser_createRDFAnnotationForLevelAndVersion ( unsigned int  level,
unsigned int  version 
)

Creates blank RDF annotation content organized in the form defined in Section 6 of the SBML Level 2 Version 4 and the SBML Level 3 specifications.

The annotation created by this method has namespace declarations for all the relevant XML namespaces used in RDF annotations and also has an empty RDF element. Note that this is not the containing <annotation> element; the method RDFAnnotationParser_createAnnotation() is available for that purpose.

Parameters
levelunsigned int giving the SBML level to target.
versionunsigned int giving the SBML version to target.
Returns
a pointer to an XMLNode_t represting the annotation.
XMLNode_t * RDFAnnotationParser_createRDFDescription ( const SBase_t obj)

Takes an SBML object and creates an XMLNode_t corresponding to an RDF "Description" element.

This method is a handy way of creating RDF description objects linked by the appropriate "metaid" field, for insertion into RDF annotations in a model. (Note that this method does not create a complete annotation; it only creates a description element. For creating empty RDF annotations that can serve as containers for RDF descriptions, see RDFAnnotationParser_createRDFAnnotation().

Parameters
objthe object to be annotated.
Returns
a new XMLNode_t containing the "rdf:about" structure for an RDF "Description" element.
See also
RDFAnnotationParser_createRDFAnnotation()
XMLNode_t * RDFAnnotationParser_deleteRDFAnnotation ( XMLNode_t annotation)

Deletes any RDF annotation found in the given XMLNode_t tree and returns any remaining annotation content.

The name of the given XMLNode_t must be "annotation", or else this method returns NULL.

Parameters
annotationthe XMLNode_t tree within which the RDF annotation is to be found and deleted.
Returns
the XMLNode_t structure with any RDF annotations deleted
XMLNode_t * RDFAnnotationParser_parseCVTerms ( const SBase_t obj)

Takes a list of CVTerms from an SBML object and creates a complete SBML annotation around it.

This essentially takes the given SBML object, calls RDFAnnotationParser_createRDFDescriptionWithCVTerms() to read out the CVTerms attached to it, calls RDFAnnotationParser_createAnnotation() to create an RDF annotation to hold the terms, and finally calls RDFAnnotationParser_createAnnotation() to wrap the result as an SBML <annotation> element.

Parameters
objthe SBML object to start from.
Returns
the XMLNode_t tree corresponding to the annotation.
XMLNode_t * RDFAnnotationParser_parseModelHistory ( const SBase_t obj)

Takes an SBML Model_t structure, reads off the model history information stored in it, and creates a complete SBML annotation to store that history.

Parameters
obja Model_t.
Returns
the XMLNode_t corresponding to an annotation containing MIRIAM-compliant model history information in RDF format
void RDFAnnotationParser_parseRDFAnnotation ( const XMLNode_t annotation,
List_t CVTerms 
)

Parses an annotation (given as an XMLNode_t tree) into a list of CVTerms.

This is used to take an annotation that has been read into an SBML model, identify the RDF elements within it, and create a list of corresponding CVTerms.

Parameters
annotationXMLNode_t containing the annotation.
CVTermslist of CVTerms to be created.
See also
RDFAnnotationParser_parseRDFAnnotationWithModelHistory (const XMLNode_t *annotation)
ModelHistory_t * RDFAnnotationParser_parseRDFAnnotationWithModelHistory ( const XMLNode_t annotation)

Parses an annotation into a ModelHistory_t structure.

This is used to take an annotation that has been read into an SBML model, identify the RDF elements representing model history information, and create a list of corresponding CVTerms.

Parameters
annotationXMLNode_t containing the annotation.
Returns
a pointer to the ModelHistory_t created.
See also
RDFAnnotationParser_parseRDFAnnotation (const XMLNode_t *annotation, List_t *CVTerms)