libSBML Python API  5.10.0
 All Classes Namespaces Files Functions Variables Modules Pages
libsbml.LayoutPkgNamespaces Class Reference
Inheritance diagram for libsbml.LayoutPkgNamespaces:
[legend]

Detailed Description

{layout}

layout Class to store SBML Level, Version, and XML namespace for the SBML Layout (“layout”) package.

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.

SBML Level 3 “packages” add features on top of SBML Level 3 Core. When a model definition uses an SBML package, it must declare the Level and Version of SBML Core and the Version of the package being used. The package name, the SBML Level and Version, and the package Version correspond uniquely to an XML namespace added to the XML encoding of the SBML model.

LibSBML Level 3 extensions are implementations of support for SBML Level 3 packages. Each package is implemented as a separate extension. To allow software applications to query the level and version information of an extension's package implementation, libSBML uses specialized object classes. For the extension implementing the SBML “layout” package, the object class is LayoutPkgNamespaces. (This class is a specialization of a common base class called SBMLExtensionNamespaces that is not exposed in the libSBML programming language interfaces other than C++.)

Objects of class LayoutPkgNamespaces can be passed to constructors of SBML components defined by “layout” in order to ensure that the correct component structure is created. This is necessary because different versions of an SBML Level 3 package may introduce differences in the definition of the components defined by the package. (For example, later editions of a package may introduce new attributes on a component that are not present in earlier editions of the package specification.)

See also
CompPkgNamespaces
FbcPkgNamespaces
QualPkgNamespaces

Public Member Functions

def addNamespace
 
def addNamespaces
 
def addPackageNamespace
 
def addPackageNamespaces
 
def clone
 
def freeSBMLNamespaces
 
def getLevel
 
def getNamespaces
 
def getPackageName
 
def getSBMLNamespaceURI
 
def getSupportedNamespaces
 
def getURI
 
def getVersion
 
def isSBMLNamespace
 
def isValidCombination
 
def removeNamespace
 
def removePackageNamespace
 

Member Function Documentation

def libsbml.SBMLNamespaces.addNamespace (   self,
  args 
)
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.

Parameters
urithe XML namespace to be added.
prefixthe prefix of the namespace to be added.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.SBMLNamespaces.addNamespaces (   self,
  args 
)
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.
Parameters
xmlnsthe XML namespaces to be added.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.SBMLNamespaces.addPackageNamespace (   self,
  args 
)
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.

Parameters
pkgNamethe string of package name (e.g. 'layout', 'multi')
pkgVersionthe package version
prefixthe prefix of the package namespace to be added. The package's name will be used if the given string is empty (default).
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
An XML namespace of a non-registered package extension can't be added by this function (LIBSBML_INVALID_ATTRIBUTE_VALUE will be returned).
See also
addNamespace()
def libsbml.SBMLNamespaces.addPackageNamespaces (   self,
  args 
)
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).

Parameters
xmlnsthe XML namespaces to be added.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
XML namespaces of a non-registered package extensions are not added (just ignored) by this function. LIBSBML_INVALID_ATTRIBUTE_VALUE will be returned if the given xmlns is null.
def libsbml.LayoutPkgNamespaces.clone (   self)

{layout}

layout Class to store SBML Level, Version, and XML namespace for the SBML Layout (“layout”) package.

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.

SBML Level 3 “packages” add features on top of SBML Level 3 Core. When a model definition uses an SBML package, it must declare the Level and Version of SBML Core and the Version of the package being used. The package name, the SBML Level and Version, and the package Version correspond uniquely to an XML namespace added to the XML encoding of the SBML model.

LibSBML Level 3 extensions are implementations of support for SBML Level 3 packages. Each package is implemented as a separate extension. To allow software applications to query the level and version information of an extension's package implementation, libSBML uses specialized object classes. For the extension implementing the SBML “layout” package, the object class is LayoutPkgNamespaces. (This class is a specialization of a common base class called SBMLExtensionNamespaces that is not exposed in the libSBML programming language interfaces other than C++.)

Objects of class LayoutPkgNamespaces can be passed to constructors of SBML components defined by “layout” in order to ensure that the correct component structure is created. This is necessary because different versions of an SBML Level 3 package may introduce differences in the definition of the components defined by the package. (For example, later editions of a package may introduce new attributes on a component that are not present in earlier editions of the package specification.)

See also
CompPkgNamespaces
FbcPkgNamespaces
QualPkgNamespaces Python method signature(s):
clone(LayoutPkgNamespaces self)   LayoutPkgNamespaces

Creates and returns a deep copy of this SBMLExtensionNamespaces.

Returns
a (deep) copy of this SBMLExtensionNamespaces.
def libsbml.SBMLNamespaces.freeSBMLNamespaces (   args)
inherited

Python method signature(s):

freeSBMLNamespaces(List * supportedNS)

Frees the list of supported namespaces as generated by getSupportedNamespaces().

Parameters
supportedNSthe list to be freed.
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.SBMLNamespaces.getLevel (   self,
  args 
)
inherited

Python method signature(s):

getLevel(SBMLNamespaces self)   long
getLevel(SBMLNamespaces self)   long

Get the SBML Level of this SBMLNamespaces object.

Returns
the SBML Level of this SBMLNamespaces object.
def libsbml.SBMLNamespaces.getNamespaces (   self,
  args 
)
inherited

Python method signature(s):

getNamespaces(SBMLNamespaces self)   XMLNamespaces
getNamespaces(SBMLNamespaces self)   XMLNamespaces

Get the XML namespaces list for this SBMLNamespaces object.

SBMLNamespaces objects are used in libSBML to communicate SBML Level and Version data between constructors and other methods. The SBMLNamespaces object class holds triples consisting of SBML Level, Version, and the corresponding SBML XML namespace. 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.

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.

Returns
the XML namespaces of this SBMLNamespaces object.
def libsbml.LayoutPkgNamespaces.getPackageName (   self)

Python method signature(s):

getPackageName(LayoutPkgNamespaces self)   string

Returns the name of the main package for this namespace.

Returns
the name of the main package for this namespace. 'core' will be returned if this namespace is defined in the SBML core.
def libsbml.SBMLNamespaces.getSBMLNamespaceURI (   args)
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.

Parameters
levelthe SBML level
versionthe SBML version
Returns
a string representing the SBML namespace that reflects the SBML Level and Version specified.
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.SBMLNamespaces.getSupportedNamespaces ( )
inherited

Python method signature(s):

getSupportedNamespaces()   List *

Returns a list of all supported SBMLNamespaces in this version of libsbml.

Returns
a list with supported SBML namespaces.
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.LayoutPkgNamespaces.getURI (   self)

Python method signature(s):

getURI(LayoutPkgNamespaces self)   string

Returns a string representing the SBML XML namespace of this object.

Returns
a string representing the SBML namespace that reflects the SBML Level and Version of this object.
def libsbml.SBMLNamespaces.getVersion (   self,
  args 
)
inherited

Python method signature(s):

getVersion(SBMLNamespaces self)   long
getVersion(SBMLNamespaces self)   long

Get the SBML Version of this SBMLNamespaces object.

Returns
the SBML Version of this SBMLNamespaces object.
def libsbml.SBMLNamespaces.isSBMLNamespace (   args)
inherited

Python method signature(s):

isSBMLNamespace(string uri)   bool

Predicate returning True if the given URL is one of SBML XML namespaces.

Parameters
urithe URI of namespace
Returns
True if the 'uri' is one of SBML namespaces, False otherwise.
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.SBMLNamespaces.isValidCombination (   self)
inherited

Python method signature(s):

isValidCombination(SBMLNamespaces self)   bool

Predicate returning True if the given set of namespaces represent a valid set

Returns
True if the set of namespaces is valid, False otherwise.
def libsbml.SBMLNamespaces.removeNamespace (   self,
  args 
)
inherited

Python method signature(s):

removeNamespace(SBMLNamespaces self, string uri)   int

Removes an XML namespace from the set of namespaces within this SBMLNamespaces object.

Parameters
urithe XML namespace to be added.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.SBMLNamespaces.removePackageNamespace (   self,
  args 
)
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.

Parameters
levelthe SBML level
versionthe SBML version
pkgNamethe string of package name (e.g. 'layout', 'multi')
pkgVersionthe package version
Returns
integer value indicating success/failure of the function. The possible values returned by this function are: