libSBML Python API  5.11.0
libsbml.RDFAnnotationParser Class Reference
Inheritance diagram for libsbml.RDFAnnotationParser:
[legend]

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 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 and converted into a list of CVTerm objects. There are different versions of the main method, and RDFAnnotationParser.parseRDFAnnotation(), used depending on whether the annotation in question concerns the MIRIAM model history or other MIRIAM resource annotations. A special object class, ModelHistory, is used to make it easier to manipulate model history annotations.

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

Public Member Functions

def createAnnotation ()
  MIRIAM-compliant RDF annotation reader/writer. More...
 
def createCVTerms (obj)
 Takes a list of CVTerm objects and creates a the RDF 'Description' element. More...
 
def createRDFAnnotation ()
 Creates a blank RDF element suitable for use in SBML annotations. More...
 
def deleteRDFAnnotation (annotation)
 Deletes any SBML MIRIAM RDF annotation found in the given XMLNode tree and returns any remaining annotation content. More...
 
def deleteRDFCVTermAnnotation (annotation)
 Deletes any SBML MIRIAM RDF 'CVTerm' annotation found in the given XMLNode tree and returns any remaining annotation content. More...
 
def deleteRDFHistoryAnnotation (annotation)
 Deletes any SBML MIRIAM RDF 'History' annotation found in the given XMLNode tree and returns any remaining annotation content. More...
 
def parseCVTerms (obj)
 Takes a list of CVTerm objects and creates a complete SBML annotation around it. More...
 
def parseModelHistory (obj)
 Reads the model history and cvTerms stored in obj and creates the XML structure for an SBML annotation representing that metadata if there is a model history stored in obj. More...
 
def parseOnlyModelHistory (obj)
 Reads the model history stored in obj and creates the XML structure for an SBML annotation representing that history. More...
 
def parseRDFAnnotation (args)
 Parses an annotation (given as an XMLNode tree) into a list of CVTerm objects. More...
 

Member Function Documentation

def libsbml.RDFAnnotationParser.createCVTerms (   obj)

Takes a list of CVTerm objects and creates a the RDF 'Description' element.

createCVTerms(SBase obj)   XMLNode

This essentially takes the given SBML object, reads out the CVTerm objects attached to it, creates 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 tree corresponding to the Description element of an RDF annotation.
Note
Because this is a static method on a class, the Python language interface for libSBML will contain two variants. One will be the expected, normal static method on the class (i.e., a regular methodName), and the other will be a standalone top-level function with the name ClassName_methodName(). This is merely an artifact of how the language interfaces are created in libSBML. The methods are functionally identical.
def libsbml.RDFAnnotationParser.createRDFAnnotation ( )

Creates a blank RDF element suitable for use in SBML annotations.

createRDFAnnotation()   XMLNode

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. The result is the following XML:

<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/' >

</rdf:RDF>

Note that this does not create the containing SBML <annotation> element; the method RDFAnnotationParser.createAnnotation() is available for creating the container.

Returns
a pointer to an XMLNode
Note
Because this is a static method on a class, the Python language interface for libSBML will contain two variants. One will be the expected, normal static method on the class (i.e., a regular methodName), and the other will be a standalone top-level function with the name ClassName_methodName(). This is merely an artifact of how the language interfaces are created in libSBML. The methods are functionally identical.
See also
RDFAnnotationParser.createAnnotation()
def libsbml.RDFAnnotationParser.deleteRDFAnnotation (   annotation)

Deletes any SBML MIRIAM RDF annotation found in the given XMLNode tree and returns any remaining annotation content.

deleteRDFAnnotation(XMLNode annotation)   XMLNode

The name of the XMLNode given as parameter annotation must be 'annotation', or else this method returns None. The method will walk down the XML structure looking for elements that are in the RDF XML namespace, and remove them if they conform to the syntax of a History or CVTerm element.

Parameters
annotationthe XMLNode tree within which the RDF annotation is to be found and deleted
Returns
the XMLNode structure that is left after RDF annotations are deleted.
Note
Because this is a static method on a class, the Python language interface for libSBML will contain two variants. One will be the expected, normal static method on the class (i.e., a regular methodName), and the other will be a standalone top-level function with the name ClassName_methodName(). This is merely an artifact of how the language interfaces are created in libSBML. The methods are functionally identical.
def libsbml.RDFAnnotationParser.deleteRDFCVTermAnnotation (   annotation)

Deletes any SBML MIRIAM RDF 'CVTerm' annotation found in the given XMLNode tree and returns any remaining annotation content.

deleteRDFCVTermAnnotation(XMLNode annotation)   XMLNode

The name of the XMLNode given as parameter annotation must be 'annotation', or else this method returns None. The method will walk down the XML structure looking for elements that are in the RDF XML namespace, and remove any that conform to the syntax of a CVTerm element.

Parameters
annotationthe XMLNode tree within which the RDF annotation is to be found and deleted
Returns
the XMLNode structure that is left after RDF annotations are deleted.
Note
Because this is a static method on a class, the Python language interface for libSBML will contain two variants. One will be the expected, normal static method on the class (i.e., a regular methodName), and the other will be a standalone top-level function with the name ClassName_methodName(). This is merely an artifact of how the language interfaces are created in libSBML. The methods are functionally identical.
def libsbml.RDFAnnotationParser.deleteRDFHistoryAnnotation (   annotation)

Deletes any SBML MIRIAM RDF 'History' annotation found in the given XMLNode tree and returns any remaining annotation content.

deleteRDFHistoryAnnotation(XMLNode annotation)   XMLNode

The name of the XMLNode given as parameter annotation must be 'annotation', or else this method returns None. The method will walk down the XML structure looking for elements that are in the RDF XML namespace, and remove any that conform to the syntax of a History element.

Parameters
annotationthe XMLNode tree within which the RDF annotation is to be found and deleted
Returns
the XMLNode structure that is left after RDF annotations are deleted.
Note
Because this is a static method on a class, the Python language interface for libSBML will contain two variants. One will be the expected, normal static method on the class (i.e., a regular methodName), and the other will be a standalone top-level function with the name ClassName_methodName(). This is merely an artifact of how the language interfaces are created in libSBML. The methods are functionally identical.
def libsbml.RDFAnnotationParser.parseCVTerms (   obj)

Takes a list of CVTerm objects and creates a complete SBML annotation around it.

parseCVTerms(SBase obj)   XMLNode

This essentially takes the given SBML object, reads out the CVTerm objects attached to it, callsRDFAnnotationParser.createRDFAnnotation() to create an RDF annotation to hold the terms, and finally callsRDFAnnotationParser.createAnnotation() to wrap the result as an SBML <annotation> element.

Parameters
objthe SBML object to start from
Returns
the XMLNode tree corresponding to the annotation.
Note
Because this is a static method on a class, the Python language interface for libSBML will contain two variants. One will be the expected, normal static method on the class (i.e., a regular methodName), and the other will be a standalone top-level function with the name ClassName_methodName(). This is merely an artifact of how the language interfaces are created in libSBML. The methods are functionally identical.
def libsbml.RDFAnnotationParser.parseModelHistory (   obj)

Reads the model history and cvTerms stored in obj and creates the XML structure for an SBML annotation representing that metadata if there is a model history stored in obj.

parseModelHistory(SBase obj)   XMLNode
Parameters
objany SBase object
Returns
the XMLNode corresponding to an annotation containing MIRIAM-compliant model history and CV term information in RDF format.
Note
If the object does not have a history element stored then None is returned even if CVTerms are present.
Because this is a static method on a class, the Python language interface for libSBML will contain two variants. One will be the expected, normal static method on the class (i.e., a regular methodName), and the other will be a standalone top-level function with the name ClassName_methodName(). This is merely an artifact of how the language interfaces are created in libSBML. The methods are functionally identical.
def libsbml.RDFAnnotationParser.parseOnlyModelHistory (   obj)

Reads the model history stored in obj and creates the XML structure for an SBML annotation representing that history.

parseOnlyModelHistory(SBase obj)   XMLNode
Parameters
objany SBase object
Returns
the XMLNode corresponding to an annotation containing MIRIAM-compliant model history information in RDF format.
Note
Because this is a static method on a class, the Python language interface for libSBML will contain two variants. One will be the expected, normal static method on the class (i.e., a regular methodName), and the other will be a standalone top-level function with the name ClassName_methodName(). This is merely an artifact of how the language interfaces are created in libSBML. The methods are functionally identical.
def libsbml.RDFAnnotationParser.parseRDFAnnotation (   args)

Parses an annotation (given as an XMLNode tree) into a list of CVTerm objects.

parseRDFAnnotation(XMLNode annotation, string metaId=None, XMLInputStream stream=None)   ModelHistory
parseRDFAnnotation(XMLNode annotation, string metaId=None)   ModelHistory
parseRDFAnnotation(XMLNode annotation)   ModelHistory
parseRDFAnnotation(XMLNode annotation, CVTermList CVTerms)
parseRDFAnnotation(XMLNode annotation, CVTermList CVTerms, string metaId=None, XMLInputStream stream=None)
parseRDFAnnotation(XMLNode annotation, CVTermList CVTerms, string metaId=None)

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 CVTerm (controlled vocabulary term) objects.

Parameters
annotationXMLNode containing the annotation.
CVTermslist of CVTerm objects to be created.
metaIdoptional metaId, if set only the RDF annotation for this metaId will be returned.
streamoptional XMLInputStream that facilitates error logging.
Note
Because this is a static method on a class, the Python language interface for libSBML will contain two variants. One will be the expected, normal static method on the class (i.e., a regular methodName), and the other will be a standalone top-level function with the name ClassName_methodName(). This is merely an artifact of how the language interfaces are created in libSBML. The methods are functionally identical.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.