libSBML Python API
5.8.0
|
Class to store level, version and namespace information of SBML extension package.
Public Member Functions | |
def | addNamespace |
def | addNamespaces |
def | addPackageNamespace |
def | addPackageNamespaces |
def | clone |
def | getLevel |
def | getNamespaces |
def | getPackageName |
def | getSBMLNamespaceURI |
def | getSupportedNamespaces |
def | getURI |
def | getVersion |
def | isSBMLNamespace |
def | isValidCombination |
def | removeNamespace |
def | removePackageNamespace |
|
inherited |
Python method signature(s):
addNamespace(SBMLNamespaces self, string uri, string prefix)int
Add an XML namespace (a pair of URI and prefix) to the set of namespaces within this SBMLNamespaces object.
uri | the XML namespace to be added. |
prefix | the prefix of the namespace to be added. |
|
inherited |
Python method signature(s):
addNamespaces(SBMLNamespaces self, XMLNamespaces xmlns)int
Add the given XML namespaces list to the set of namespaces within this SBMLNamespaces object.
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
.
sbmlDoc = None try: sbmlDoc = SBMLDocument(3, 1) except ValueError: # Do something to handle exceptional situation. Candidate # causes include invalid combinations of SBML Level and Version # (impossible if hardwired as given here), running out of memory, and # unknown system exceptions. namespaces = sbmlDoc.getNamespaces() if namespaces == None: # Do something to handle case of no namespaces. status = namespaces.add('http://www.w3.org/1999/xhtml', 'html') if status != LIBSBML_OPERATION_SUCCESS: # Do something to handle failure.
xmlns | the XML namespaces to be added. |
|
inherited |
Python method signature(s):
addPackageNamespace(SBMLNamespaces self, string pkgName, long pkgVersion, string prefix="")int addPackageNamespace(SBMLNamespaces self, string pkgName, long pkgVersion)
int
Add an XML namespace (a pair of URI and prefix) of a package extension to the set of namespaces within this SBMLNamespaces object. 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). |
|
inherited |
Python method signature(s):
addPackageNamespaces(SBMLNamespaces self, XMLNamespaces xmlns)int
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).
xmlns | the XML namespaces to be added. |
def libsbml.LayoutPkgNamespaces.clone | ( | self | ) |
Class to store level, version and namespace information of SBML extension package.
Python method signature(s):
clone(LayoutPkgNamespaces self)ISBMLExtensionNamespaces
Creates and returns a deep copy of this SBMLNamespaces.
|
inherited |
Python method signature(s):
getLevel(SBMLNamespaces self)long getLevel(SBMLNamespaces self)
long
Get the SBML Level of this SBMLNamespaces object.
|
inherited |
Python method signature(s):
getNamespaces(SBMLNamespaces self)XMLNamespaces getNamespaces(SBMLNamespaces self)
XMLNamespaces
Get the XML namespaces list for this SBMLNamespaces object.
The plural 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 there may be multiple XML namespaces involved too. However, until the introduction of SBML Level 3, the SBMLNamespaces object only records one SBML Level/Version/namespace combination at a time, and so this method will also only return a list of one item.
def libsbml.LayoutPkgNamespaces.getPackageName | ( | self | ) |
Python method signature(s):
getPackageName(LayoutPkgNamespaces self)string
Returns the name of the main package for this namespace.
|
inherited |
Python method signature(s):
getSBMLNamespaceURI(long level, long version)string
Returns a string representing the SBML XML namespace for the given level
and version
of SBML.
level | the SBML level |
version | the SBML version |
|
inherited |
getSupportedNamespaces() List *
Returns a list of all supported SBMLNamespaces in this version of libsbml.
def libsbml.LayoutPkgNamespaces.getURI | ( | self | ) |
Python method signature(s):
getURI(LayoutPkgNamespaces self)string
Returns a string representing the SBML XML namespace of this object.
|
inherited |
Python method signature(s):
getVersion(SBMLNamespaces self)long getVersion(SBMLNamespaces self)
long
Get the SBML Version of this SBMLNamespaces object.
|
inherited |
Python method signature(s):
isSBMLNamespace(string uri)bool
Predicate returning True
if the given URL is one of SBML XML namespaces.
uri | the URI of namespace |
True
if the 'uri' is one of SBML namespaces, False
otherwise.
|
inherited |
Python method signature(s):
isValidCombination(SBMLNamespaces self)bool
Predicate returning True
if the given set of namespaces represent a valid set
True
if the set of namespaces is valid, False
otherwise.
|
inherited |
Python method signature(s):
removeNamespace(SBMLNamespaces self, string uri)int
Removes an XML namespace from the set of namespaces within this SBMLNamespaces object.
uri | the XML namespace to be added. |
|
inherited |
Python method signature(s):
removePackageNamespace(SBMLNamespaces self, long level, long version, string pkgName, long pkgVersion)int
Removes an XML namespace of a package extension from the set of namespaces within this SBMLNamespaces object.
level | the SBML level |
version | the SBML version |
pkgName | the string of package name (e.g. 'layout', 'multi') |
pkgVersion | the package version |