libSBML Python API
5.11.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.
There are differences in the definitions of components between different SBML Levels, as well as Versions within Levels. For example, the 'sboTerm' attribute was not introduced until Level 2 Version 2, and then only on certain component classes; the SBML Level 2 Version 3 specification moved the 'sboTerm' attribute to the SBase class, thereby allowing nearly all components to have SBO annotations. As a result of differences such as those, libSBML needs to track the SBML Level and Version of every object created.
The purpose of the SBMLNamespaces object class is to make it easier to communicate SBML Level and Version data between libSBML constructors and other methods. The SBMLNamespaces object class tracks 3-tuples (triples) consisting of SBML Level, Version, and the corresponding SBML XML namespace.
The plural name (SBMLNamespaces) is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model and therefore may have multiple namespaces associated with them; however, until the introduction of SBML Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.
Public Member Functions | |
def | __init__ (self, args) |
Set of SBML Level + Version + namespace triples. More... | |
def | addNamespace (self, uri, prefix) |
Add an XML namespace (a pair of URI and prefix) to the set of namespaces within this SBMLNamespaces object. More... | |
def | addNamespaces (self, xmlns) |
Add the given XML namespaces list to the set of namespaces within this SBMLNamespaces object. More... | |
def | addPackageNamespace (self, args) |
Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object. More... | |
def | addPackageNamespaces (self, xmlns) |
Add the XML namespaces of package extensions in the given XMLNamespace object to the set of namespaces within this SBMLNamespaces object (Non-package XML namespaces are not added by this function). More... | |
def | clone (self) |
Creates and returns a deep copy of this SBMLNamespaces object. More... | |
def | freeSBMLNamespaces (supportedNS) |
Frees the list of supported namespaces as generated by getSupportedNamespaces(). More... | |
def | getLevel (self, args) |
Get the SBML Level of this SBMLNamespaces object. More... | |
def | getNamespaces (self, args) |
Get the XML namespaces list for this SBMLNamespaces object. More... | |
def | getPackageName (self) |
Returns the name of the main package for this namespace. More... | |
def | getSBMLNamespaceURI (level, version) |
Returns a string representing the SBML XML namespace for the given level and version of SBML. More... | |
def | getSupportedNamespaces () |
Returns a list of all supported SBMLNamespaces in this version of libsbml. More... | |
def | getURI (self) |
Returns a string representing the SBML XML namespace of this object. More... | |
def | getVersion (self, args) |
Get the SBML Version of this SBMLNamespaces object. More... | |
def | isSBMLNamespace (uri) |
Predicate returning True if the given URL is one of SBML XML namespaces. More... | |
def | isValidCombination (self) |
Predicate returning True if the given set of namespaces represent a valid set. More... | |
def | removeNamespace (self, uri) |
Removes an XML namespace from the set of namespaces within this SBMLNamespaces object. More... | |
def | removePackageNamespace (self, level, version, pkgName, pkgVersion) |
Removes an XML namespace of a package extension from the set of namespaces within this SBMLNamespaces object. More... | |
def libsbml.SBMLNamespaces.addNamespace | ( | self, | |
uri, | |||
prefix | |||
) |
Add an XML namespace (a pair of URI and prefix) to the set of namespaces within this SBMLNamespaces object.
addNamespace(string uri, string prefix) int
uri | the XML namespace to be added. |
prefix | the prefix of the namespace to be added. |
def libsbml.SBMLNamespaces.addNamespaces | ( | self, | |
xmlns | |||
) |
Add the given XML namespaces list to the set of namespaces within this SBMLNamespaces object.
addNamespaces(XMLNamespaces xmlns) int
The following code gives an example of how one could add the XHTML namespace to the list of namespaces recorded by the top-level <sbml>
element of a model. It gives the new namespace a prefix of html
.
xmlns | the XML namespaces to be added. |
def libsbml.SBMLNamespaces.addPackageNamespace | ( | self, | |
args | |||
) |
Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object.
addPackageNamespace(string pkgName, long pkgVersion, string prefix) int addPackageNamespace(string pkgName, long pkgVersion) int
The SBML Level and SBML Version of this object is used.
pkgName | the string of package name (e.g. 'layout', 'multi') |
pkgVersion | the package version |
prefix | the prefix of the package namespace to be added. The package's name will be used if the given string is empty (default). |
def libsbml.SBMLNamespaces.addPackageNamespaces | ( | self, | |
xmlns | |||
) |
Add the XML namespaces of package extensions in the given XMLNamespace object to the set of namespaces within this SBMLNamespaces object (Non-package XML namespaces are not added by this function).
addPackageNamespaces(XMLNamespaces xmlns) int
xmlns | the XML namespaces to be added. |
def libsbml.SBMLNamespaces.clone | ( | self | ) |
Creates and returns a deep copy of this SBMLNamespaces object.
clone() SBMLNamespaces
def libsbml.SBMLNamespaces.freeSBMLNamespaces | ( | supportedNS | ) |
Frees the list of supported namespaces as generated by getSupportedNamespaces().
freeSBMLNamespaces(List * supportedNS)
supportedNS | the list to be freed. |
def libsbml.SBMLNamespaces.getLevel | ( | self, | |
args | |||
) |
Get the SBML Level of this SBMLNamespaces object.
getLevel() long
def libsbml.SBMLNamespaces.getNamespaces | ( | self, | |
args | |||
) |
Get the XML namespaces list for this SBMLNamespaces object.
getNamespaces() XMLNamespaces
The plural name (SBMLNamespaces) is not a mistake, because in SBML Level 3, objects may have extensions added by Level 3 packages used by a given model and therefore may have multiple namespaces associated with them. In SBML Levels below Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time. Most constructors for SBML objects in libSBML take a SBMLNamespaces object as an argument, thereby allowing the constructor to produce the proper combination of attributes and other internal data structures for the given SBML Level and Version.
def libsbml.SBMLNamespaces.getPackageName | ( | self | ) |
Returns the name of the main package for this namespace.
getPackageName() string
def libsbml.SBMLNamespaces.getSBMLNamespaceURI | ( | level, | |
version | |||
) |
Returns a string representing the SBML XML namespace for the given level
and version
of SBML.
getSBMLNamespaceURI(long level, long version) string
level | the SBML level |
version | the SBML version |
def libsbml.SBMLNamespaces.getSupportedNamespaces | ( | ) |
Returns a list of all supported SBMLNamespaces in this version of libsbml.
getSupportedNamespaces() List *
def libsbml.SBMLNamespaces.getURI | ( | self | ) |
Returns a string representing the SBML XML namespace of this object.
getURI() string
def libsbml.SBMLNamespaces.getVersion | ( | self, | |
args | |||
) |
Get the SBML Version of this SBMLNamespaces object.
getVersion() long
def libsbml.SBMLNamespaces.isSBMLNamespace | ( | uri | ) |
Predicate returning True
if the given URL is one of SBML XML namespaces.
isSBMLNamespace(string uri) bool
uri | the URI of namespace |
True
if the 'uri' is one of SBML namespaces, False
otherwise.def libsbml.SBMLNamespaces.isValidCombination | ( | self | ) |
Predicate returning True
if the given set of namespaces represent a valid set.
True
if the set of namespaces is valid, False
otherwise.isValidCombination() bool
def libsbml.SBMLNamespaces.removeNamespace | ( | self, | |
uri | |||
) |
Removes an XML namespace from the set of namespaces within this SBMLNamespaces object.
removeNamespace(string uri) int
uri | the XML namespace to be added. |
def libsbml.SBMLNamespaces.removePackageNamespace | ( | self, | |
level, | |||
version, | |||
pkgName, | |||
pkgVersion | |||
) |
Removes an XML namespace of a package extension from the set of namespaces within this SBMLNamespaces object.
removePackageNamespace(long level, long version, string pkgName, long pkgVersion) int
level | the SBML level |
version | the SBML version |
pkgName | the string of package name (e.g. 'layout', 'multi') |
pkgVersion | the package version |