java.io.Serializable
, java.lang.Cloneable
, javax.swing.tree.TreeNode
, SBase
, TreeNodeWithChangeSupport
public class SBMLDocument extends AbstractSBase
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
URI_NAMESPACE_L1 |
The namespace URI of SBML Level 1 Version 1 and 2.
|
static java.lang.String |
URI_NAMESPACE_L2V1 |
The namespace URI of SBML Level 2 Version 1.
|
static java.lang.String |
URI_NAMESPACE_L2V2 |
The namespace URI of SBML Level 2 Version 2.
|
static java.lang.String |
URI_NAMESPACE_L2V3 |
The namespace URI of SBML Level 2 Version 3.
|
static java.lang.String |
URI_NAMESPACE_L2V4 |
The namespace URI of SBML Level 2 Version 4.
|
static java.lang.String |
URI_NAMESPACE_L2V5 |
The namespace URI of SBML Level 2 Version 5.
|
static java.lang.String |
URI_NAMESPACE_L3V1Core |
The namespace URI of SBML Level 3 Version 1.
|
static java.lang.String |
URI_NAMESPACE_L3V2Core |
The namespace URI of SBML Level 3 Version 2.
|
JSBML_WRONG_SBO_TERM
Constructor | Description |
---|---|
SBMLDocument() |
Creates a
SBMLDocument instance. |
SBMLDocument(int level,
int version) |
Creates a SBMLDocument instance from a level and version.
|
SBMLDocument(SBMLDocument sb) |
Creates a new
SBMLDocument instance from a given
SBMLDocument . |
Modifier and Type | Method | Description |
---|---|---|
void |
addNamespace(java.lang.String namespaceName,
java.lang.String prefix,
java.lang.String URI) |
Deprecated.
|
int |
checkConsistency() |
Validates the
SBMLDocument . |
int |
checkConsistencyOffline() |
Validates the
SBMLDocument using the JSBML internal
offline validator. |
int |
checkConsistencyOnline() |
Validates the
SBMLDocument using the
SBML.org online validator (http://sbml.org/validator/). |
SBMLDocument |
clone() |
Creates a deep copy of this object, i.e., a new
SBase with the same
properties
like this one. |
boolean |
containsMetaId(java.lang.String metaId) |
A check to see whether elements have been registered to this
SBMLDocument with the given meta identifier. |
Model |
createModel() |
Creates a new Model inside this
SBMLDocument , and returns a
pointer to it. |
Model |
createModel(java.lang.String id) |
Creates a new instance of Model from id and the level and version of this
SBMLDocument.
|
void |
disablePackage(java.lang.String packageURIOrName) |
Disables the given SBML Level 3 package on this
SBMLDocument . |
void |
enablePackage(java.lang.String packageURIOrName) |
Enables the given SBML Level 3 package on this
SBMLDocument . |
void |
enablePackage(java.lang.String packageURIOrName,
boolean enabled) |
Enables or disables the given SBML Level 3 package on this
SBMLDocument . |
boolean |
equals(java.lang.Object o) |
|
SBase |
findSBase(java.lang.String metaId) |
Looks up the
SBase registered in this SBMLDocument for the
given metaId. |
boolean |
getAllowsChildren() |
|
javax.swing.tree.TreeNode |
getChildAt(int index) |
|
int |
getChildCount() |
|
int |
getDefaultLevel() |
Returns the default SBML Level of new SBMLDocument objects.
|
int |
getDefaultVersion() |
Returns the default Version of new SBMLDocument objects.
|
SBase |
getElementByMetaId(java.lang.String metaid) |
|
java.lang.String |
getElementName() |
Returns the XML element name of this object.
|
java.lang.String |
getEnabledPackageNamespace(java.lang.String packageURIOrName) |
Return the package namespace enabled on this SBMLDocument or null if the
package is not enabled.
|
SBMLError |
getError(int i) |
Returns the ith error or warning encountered during consistency
checking.
|
int |
getErrorCount() |
Returns the number of errors or warnings encountered during consistency
checking.
|
SBMLErrorLog |
getErrorLog() |
Returns a collection of all
SBMLError s reflecting
problems in the overall data structure of this SBMLDocument . |
SBMLErrorLog |
getListOfErrors() |
Returns a collection of all
SBMLError s reflecting
problems in the overall data structure of this SBMLDocument . |
java.lang.String |
getLocationURI() |
Returns the URI specifying whence this
SBMLDocument was read. |
Model |
getModel() |
Returns the model of this
SBMLDocument . |
int |
getNumErrors() |
Returns the number of errors or warnings encountered during consistency
checking.
|
boolean |
getPackageRequired(java.lang.String nameOrUri) |
Returns the required attribute of the given package extension.
|
boolean |
getPkgRequired(java.lang.String pckage) |
Deprecated.
|
java.util.Map<java.lang.String,java.lang.String> |
getSBMLDocumentAttributes() |
Returns the map of attribute names and values of this SBMLDocument.
|
java.util.Map<java.lang.String,java.lang.String> |
getSBMLDocumentNamespaces() |
Deprecated.
|
int |
hashCode() |
Returns a hash code value for this
SBase instance. |
boolean |
isIgnoredPackage(java.lang.String nameOrURI) |
Returns
true if the given package extension is one of an ignored
packages, otherwise returns false . |
boolean |
isIgnoredPkg(java.lang.String pkgURI) |
Deprecated.
|
boolean |
isPackageEnabled(java.lang.String packageURIOrName) |
Returns
true if the given SBML Level 3 package is enabled within
the SBMLDocument . |
java.lang.Boolean |
isPackageEnabledOrDisabled(java.lang.String packageURIOrName) |
Returns
true if the given SBML Level 3 package is enabled within
the SBMLDocument , false
if the package was disabled using the method
disablePackage(String) or null if this package
was neither enabled or disabled on this SBMLDocument . |
boolean |
isSetLocationURI() |
|
boolean |
isSetModel() |
|
boolean |
isSetPackageRequired(java.lang.String nameOrURI) |
Returns
true . |
boolean |
isSetPkgRequired(java.lang.String pckage) |
Deprecated.
|
java.util.Collection<java.lang.String> |
metaIds() |
Provides access to all registered metaIds in this
SBMLDocument . |
java.lang.String |
nextMetaId() |
Randomly creates a new
String that can be used as a metaid, i.e., a
String that is a valid metaid and that is not yet used by any other element
within this SBMLDocument . |
void |
printErrors(java.io.PrintStream stream) |
Prints all the errors or warnings encountered trying to check this SBML
document.
|
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value) |
Sets the given attribute in this
SBase . |
void |
setConsistencyChecks(SBMLValidator.CHECK_CATEGORY category,
boolean apply) |
Controls the consistency checks that are performed when
checkConsistency() is called. |
boolean |
setLevelAndVersion(int level,
int version) |
Sets the SBML Level and Version of this
SBMLDocument instance,
without attempting to convert the model. |
boolean |
setLevelAndVersion(int level,
int version,
boolean strict) |
Sets the SBML Level and Version of this
SBMLDocument instance,
attempting to convert the model as needed. |
void |
setLocationURI(java.lang.String uri) |
Sets the locationURI of this
SBMLDocument : Denotes, whence this Document is understood to have
been read. |
void |
setModel(Model model) |
|
boolean |
setPackageRequired(java.lang.String nameOrUri,
boolean flag) |
Sets the required attribute value of the given package extension (does
nothing in fact!).
|
boolean |
setPkgRequired(java.lang.String pckage,
boolean flag) |
Deprecated.
|
void |
setSBMLDocumentAttributes(java.util.Map<java.lang.String,java.lang.String> attributes) |
Sets the
SBMLDocumentAttributes . |
java.lang.String |
toString() |
Returns a String representing this SBase with all the
attributes that are defined.
|
boolean |
unsetModel() |
|
java.util.Map<java.lang.String,java.lang.String> |
writeXMLAttributes() |
Returns a map with all the attributes of this
SBase that
need to be written out in XML. |
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, addResources, appendAnnotation, appendAnnotation, appendNotes, appendNotes, createHistory, createPlugin, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAllDeclaredNamespaces, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementBySId, getExtension, getExtensionCount, getExtensionPackages, getFirstElementIndex, getHistory, getId, getLevel, getLevelAndVersion, getMetaId, getName, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParent, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hasExtension, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isIdMandatory, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetId, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetName, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, registerChild, removeCVTerm, removeCVTerm, removeDeclaredNamespaceByNamespace, removeDeclaredNamespaceByPrefix, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setAnnotation, setHistory, setId, setLevel, setMetaId, setName, setNamespace, setNotes, setNotes, setPackageVersion, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetId, unsetMetaId, unsetName, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySet
removeTreeNodeChangeListener
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
public static final transient java.lang.String URI_NAMESPACE_L1
public static final transient java.lang.String URI_NAMESPACE_L2V1
public static final java.lang.String URI_NAMESPACE_L2V2
public static final transient java.lang.String URI_NAMESPACE_L2V3
public static final transient java.lang.String URI_NAMESPACE_L2V4
public static final transient java.lang.String URI_NAMESPACE_L2V5
public static final transient java.lang.String URI_NAMESPACE_L3V1Core
public static final transient java.lang.String URI_NAMESPACE_L3V2Core
public SBMLDocument()
SBMLDocument
instance. By default, the parent SBML object
of
this object is itself. The model is null
. The
SBMLDocumentAttributes and
the SBMLDocumentNamespaces are empty.public SBMLDocument(int level, int version)
null
. The
SBMLDocumentAttributes and the SBMLDocumentNamespaces are empty.level
- the SBML levelversion
- the SBML versionpublic SBMLDocument(SBMLDocument sb)
SBMLDocument
instance from a given
SBMLDocument
.sb
- @Deprecated public void addNamespace(java.lang.String namespaceName, java.lang.String prefix, java.lang.String URI)
SBase.addDeclaredNamespace(String, String)
SBMLDocument
.namespaceName
- prefix
- URI
- public int checkConsistencyOffline()
SBMLDocument
using the JSBML internal
offline validator.
You can control the consistency checks that are performed when
checkConsistencyOffline()
is called with the
setConsistencyChecks(CHECK_CATEGORY, boolean)
method.
It will fill this SBMLDocument
's listOfErrors
with SBMLError
s for each problem within this whole data
structure. You will then be able to obtain this list by calling
getError(int)
or getListOfErrors()
.
If this method returns a nonzero value (meaning, one or more
consistency checks have failed for SBML document), the failures may be
due to warnings or errors. Callers should inspect the severity
flag in the individual SBMLError objects returned by
getError(int)
to determine the nature of the failures.
The offline validator is not yet as complete as the online one so it is not
currently used by default when calling checkConsistency()
but it might be
in future versions. To get an up to date status, please check the page
Offline-validator-status.
SBMLErrorLog.getErrorsBySeverity(org.sbml.jsbml.SBMLError.SEVERITY)
,
SBMLErrorLog.getNumFailsWithSeverity(org.sbml.jsbml.SBMLError.SEVERITY)
public int checkConsistencyOnline()
SBMLDocument
using the
SBML.org online validator (http://sbml.org/validator/).
You can control the consistency checks that are performed when
checkConsistencyOnline()
is called with the
setConsistencyChecks(CHECK_CATEGORY, boolean)
method.
It will fill this SBMLDocument
's listOfErrors
with SBMLError
s for each problem within this whole data
structure. You will then be able to obtain this list by calling
getError(int)
or getListOfErrors()
.
If this method returns a nonzero value (meaning, one or more
consistency checks have failed for SBML document), the failures may be
due to warnings or errors. Callers should inspect the severity
flag in the individual SBMLError objects returned by
getError(int)
to determine the nature of the failures.
setConsistencyChecks(CHECK_CATEGORY, boolean)
public int checkConsistency()
SBMLDocument
.
The validation is currently performed using the SBML.org online validator (http://sbml.org/validator/).
You can control the consistency checks that are performed when
checkConsistency()
is called with the
setConsistencyChecks(CHECK_CATEGORY, boolean)
method.
It will fill this SBMLDocument
's listOfErrors
with SBMLError
s for each problem within this whole data
structure. You will then be able to obtain this list by calling
getError(int)
or getListOfErrors()
.
If this method returns a nonzero value (meaning, one or more
consistency checks have failed for SBML document), the failures may be
due to warnings or errors. Callers should inspect the severity
flag in the individual SBMLError objects returned by
getError(int)
to determine the nature of the failures.
setConsistencyChecks(CHECK_CATEGORY, boolean)
,
checkConsistencyOnline()
,
checkConsistencyOffline()
public SBMLDocument clone()
SBase
SBase
with the same
properties
like this one.clone
in interface SBase
clone
in class AbstractSBase
public boolean containsMetaId(java.lang.String metaId)
SBMLDocument
with the given meta identifier.metaId
- public Model createModel()
SBMLDocument
, and returns a
pointer to it.
In SBML Level 2, the use of an identifier on a Model
object is
optional. This method takes an optional argument, sid, for setting the
identifier. If not supplied, the identifier attribute on the Model
instance is not set.Model
instance.public Model createModel(java.lang.String id)
id
- Model
instance.public void disablePackage(java.lang.String packageURIOrName)
SBMLDocument
.disablePackage
in interface SBase
disablePackage
in class AbstractSBase
packageURIOrName
- a package namespace URI or package namepublic void enablePackage(java.lang.String packageURIOrName)
SBMLDocument
.enablePackage
in interface SBase
enablePackage
in class AbstractSBase
packageURIOrName
- a package namespace URI or package namepublic void enablePackage(java.lang.String packageURIOrName, boolean enabled)
SBMLDocument
.enablePackage
in interface SBase
enablePackage
in class AbstractSBase
packageURIOrName
- a package namespace URI or package nameenabled
- a boolean to tell if the package need to be enabled or disabled. It
true
the package will be enabled, otherwise it will be
disabled.public boolean equals(java.lang.Object o)
SBase
public SBase findSBase(java.lang.String metaId)
SBase
registered in this SBMLDocument
for the
given metaId.metaId
- public boolean getAllowsChildren()
getAllowsChildren
in interface javax.swing.tree.TreeNode
getAllowsChildren
in class AbstractSBase
public javax.swing.tree.TreeNode getChildAt(int index)
getChildAt
in interface javax.swing.tree.TreeNode
getChildAt
in class AbstractSBase
public int getChildCount()
getChildCount
in interface javax.swing.tree.TreeNode
getChildCount
in class AbstractSBase
public int getDefaultLevel()
public int getDefaultVersion()
public java.lang.String getElementName()
SBase
getElementName
in interface SBase
getElementName
in class AbstractSBase
public SBase getElementByMetaId(java.lang.String metaid)
SBase
with the given metaid in this
SBMLDocument
or null
if no such SBase
is found.
This method make use of HashMap
so it is more efficient
to search for metaid than anywhere else down in the SBML hierarchy.
getElementByMetaId
in interface SBase
getElementByMetaId
in class AbstractSBase
metaid
- - the metaid of SBase
to findSBase
with the given metaid or nullfindSBase(String)
public java.lang.String getEnabledPackageNamespace(java.lang.String packageURIOrName)
packageURIOrName
- the name or URI of the package extension.public SBMLError getError(int i)
i
- - the index of the SBMLError
to getjava.lang.IndexOutOfBoundsException
- if the index is wronggetNumErrors()
public int getErrorCount()
public SBMLErrorLog getErrorLog()
SBMLError
s reflecting
problems in the overall data structure of this SBMLDocument
.SBMLError
s encountered during
consistency checking.public SBMLErrorLog getListOfErrors()
SBMLError
s reflecting
problems in the overall data structure of this SBMLDocument
.SBMLError
s encountered during
consistency checking.public java.lang.String getLocationURI()
SBMLDocument
was read. Need not be set
(i.e. may be null
).null
if not set.public Model getModel()
SBMLDocument
.getModel
in interface SBase
getModel
in class AbstractSBase
SBMLDocument
. Can be null if it is not
set.public int getNumErrors()
getErrorCount()
public boolean getPackageRequired(java.lang.String nameOrUri)
nameOrUri
- the name or URI of the package extension.@Deprecated public boolean getPkgRequired(java.lang.String pckage)
getPackageRequired(String)
pckage
- the name or URI of the package extension.SBMLDocument
.public java.util.Map<java.lang.String,java.lang.String> getSBMLDocumentAttributes()
@Deprecated public java.util.Map<java.lang.String,java.lang.String> getSBMLDocumentNamespaces()
SBase.getDeclaredNamespaces()
public int hashCode()
SBase
SBase
instance.hashCode
in interface SBase
hashCode
in class AbstractSBase
SBase
instance.Object.hashCode()
public boolean isIgnoredPackage(java.lang.String nameOrURI)
true
if the given package extension is one of an ignored
packages, otherwise returns false
.
An ignored package is one that is defined to be used in this
SBMLDocument
, but the package is not supported in this copy of
JSBML.
nameOrURI
- the name or URI of the package extension.true
if the package is being ignored and
false
otherwise.@Deprecated public boolean isIgnoredPkg(java.lang.String pkgURI)
isIgnoredPackage(String)
An ignored package is one that is defined to be used in this SBMLDocument, but the package is not supported in this copy of JSBML.
pkgURI
- the URI of the package extension.public boolean isPackageEnabled(java.lang.String packageURIOrName)
true
if the given SBML Level 3 package is enabled within
the SBMLDocument
.
If the namespace was declared on the sbml element, or if any elements of this package were found while building the SBMLDocument structure, the package will be enabled.
For the parameter 'packageNameorUri
', you should use the package
shortLabel or name, for example 'distrib', as given by
DistribConstants.shortLabel
, this way,
you don't mind about the specific package version. If you want to check for
a specific package version, then you can use the namespace instead.
isPackageEnabled
in interface SBase
isPackageEnabled
in class AbstractSBase
packageURIOrName
- the name or URI of the package extension.true
if the given SBML Level 3 package is enabled within
the SBMLDocument
, false
otherwise.public java.lang.Boolean isPackageEnabledOrDisabled(java.lang.String packageURIOrName)
true
if the given SBML Level 3 package is enabled within
the SBMLDocument
, false
if the package was disabled using the method
disablePackage(String)
or null
if this package
was neither enabled or disabled on this SBMLDocument
.
This method can be used, for example, by the SBMLWriter
to know if
a package was really disabled,
in which case the package elements won't be written down,
or if the user forgot to enable it, in which case it will be enabled and
the package elements will be written.
packageURIOrName
- the name or URI of the package extension.true
if the given SBML Level 3 package is enabled within
the SBMLDocument
, false
if the package was disabled using the method
disablePackage(String)
or null
if this package
was neither enabled or disabled on this SBMLDocument
.public boolean isSetLocationURI()
null
public boolean isSetModel()
true
if the Model
of this SBMLDocument
is
not null
.public boolean isSetPackageRequired(java.lang.String nameOrURI)
true
.nameOrURI
- the name or URI of the package extension.true
@Deprecated public boolean isSetPkgRequired(java.lang.String pckage)
isSetPackageRequired(String)
true
pckage
- the name or URI of the package extension.public java.lang.String nextMetaId()
String
that can be used as a metaid, i.e., a
String that is a valid metaid and that is not yet used by any other element
within this SBMLDocument
.SBMLDocument
.public void printErrors(java.io.PrintStream stream)
stream
- the stream where to print the SBMLDocument
errors.public boolean readAttribute(java.lang.String attributeName, java.lang.String prefix, java.lang.String value)
SBase
SBase
.
If the given attribute name is not recognized, nothing is done and
false
is returned.
readAttribute
in interface SBase
readAttribute
in class AbstractSBase
attributeName
- localName of the XML attributeprefix
- prefix of the XML attributevalue
- value of the XML attributetrue
if the attribute has been successfully read.public java.util.Collection<java.lang.String> metaIds()
SBMLDocument
. The
given collection is unmodifiable. Modifications made to the values has
hence no effect. This method is helpful to iterate through all metaIds in
the document and to query elements based on the metaId.String
s as a view of the
actual metaIds within this SBMLDocument
. Hence, modifying
any of the values returned by this method does not have any effect
for the content of this document.public void setConsistencyChecks(SBMLValidator.CHECK_CATEGORY category, boolean apply)
checkConsistency()
is called.
This method works by adding or subtracting consistency checks from the
set of all possible checks that checkConsistency()
knows
how to perform. This method may need to be called multiple times in
order to achieve the desired combination of checks. The first
argument (category
) in a call to this method indicates the category
of consistency/error checks that are to be turned on or off, and the
second argument (apply
, a boolean) indicates whether to turn it on
(value of true
) or off (value of false
).
The possible categories (values to the argument category
) are the
set of values from the
SBMLValidator.CHECK_CATEGORY
enumeration.
The following are the possible choices:
SBMLValidator.CHECK_CATEGORY.GENERAL_CONSISTENCY
:
Correctness and consistency of specific SBML language constructs.
Performing this set of checks is highly recommended. With respect to
the SBML specification, these concern failures in applying the
validation rules numbered 2xxxx in the Level 2 Versions 2, 3
and 4 specifications.
SBMLValidator.CHECK_CATEGORY.IDENTIFIER_CONSISTENCY
:
Correctness and consistency of identifiers used for model entities.
An example of inconsistency would be using a species identifier in a
reaction rate formula without first having declared the species. With
respect to the SBML specification, these concern failures in applying
the validation rules numbered 103xx in the Level 2
Versions 2, 3 and 4 specifications.
SBMLValidator.CHECK_CATEGORY.UNITS_CONSISTENCY
:
Consistency of measurement units associated with quantities in a
model. With respect to the SBML specification, these concern failures
in applying the validation rules numbered 105xx in the Level 2
Versions 2, 3 and 4 specifications.
SBMLValidator.CHECK_CATEGORY.MATHML_CONSISTENCY
:
Syntax of MathML constructs. With respect to the SBML specification,
these concern failures in applying the validation rules numbered 102xx
in the Level 2 Versions 2, 3 and 4 specifications.
SBMLValidator.CHECK_CATEGORY.SBO_CONSISTENCY
:
Consistency and validity of SBO identifiers (if any) used in the
model. With respect to the SBML specification, these concern failures
in applying the validation rules numbered 107xx in the Level 2
Versions 2, 3 and 4 specifications.
SBMLValidator.CHECK_CATEGORY.OVERDETERMINED_MODEL
:
Static analysis of whether the system of equations implied by a model
is mathematically over-determined. With respect to the SBML
specification, this is validation rule #10601 in the SBML Level 2
Versions 2, 3 and 4 specifications.
SBMLValidator.CHECK_CATEGORY.MODELING_PRACTICE
:
Additional checks for recommended good modeling practice. (These are
tests performed by libSBML and do not have equivalent SBML validation
rules.)
By default, all validation checks are applied to the model in
an SBMLDocument
object unless
setConsistencyChecks(CHECK_CATEGORY, boolean)
is
called to
indicate that only a subset should be applied. Further, this default
(i.e., performing all checks) applies separately to each new
SBMLDocument
object created. In other words, each time a model
is read using SBMLReader.readSBML(String)
,
SBMLReader.readSBMLFromString(String)
, a new
SBMLDocument
is created and for that document, a call to
checkConsistency()
will default to applying all
possible checks.
Calling programs must invoke
setConsistencyChecks(CHECK_CATEGORY, boolean)
for each
such new
model if they wish to change the consistency checks applied.
category
- a value drawn from JSBML#JSBML.SBML_VALIDATOR_* indicating the
consistency checking/validation to be turned on or off
apply
- a boolean indicating whether the checks indicated by
category
should be applied or not.
checkConsistency()
public boolean setLevelAndVersion(int level, int version)
Sets the SBML Level and Version of this SBMLDocument
instance,
without attempting to convert the model.
level
- the desired SBML Levelversion
- the desired Version within the SBML Leveltrue
if 'level' and 'version' are valid.setLevelAndVersion(int, int, boolean)
public boolean setLevelAndVersion(int level, int version, boolean strict)
Sets the SBML Level and Version of this SBMLDocument
instance,
attempting to convert the model as needed.
This method is the principal way in JSBML to convert models between Levels and Versions of SBML. Generally, models can be converted upward without difficulty (e.g., from SBML Level 1 to Level 2, or from an earlier Version of Level 2 to the latest Version of Level 2). Sometimes models can be translated downward as well, if they do not use constructs specific to more advanced Levels of SBML.
Calling this method will not necessarily lead to a successful conversion.
If the conversion fails, it will be logged in the error list associated
with this SBMLDocument
. Callers should consult
getErrorCount()
to find out if the conversion succeeded
without problems. For conversions from Level 2 to Level 1, callers can
also check the Level of the model after calling this method to find out
whether it is Level 1. (If the conversion to Level 1 failed, the Level of
this model will be left unchanged.)
level
- the desired SBML Levelversion
- the desired Version within the SBML Levelstrict
- boolean indicating whether to check consistency of both the
source and target model when performing conversion (defaults
to true
)true
if 'level' and 'version' are valid.public void setLocationURI(java.lang.String uri)
SBMLDocument
: Denotes, whence this Document is understood to have
been read.uri
- A string encoding an absolute URI. This is not checked.public void setModel(Model model)
model
- public boolean setPackageRequired(java.lang.String nameOrUri, boolean flag)
nameOrUri
- the name or URI of the package extension.flag
- boolean value indicating whether the package is required.true
@Deprecated public boolean setPkgRequired(java.lang.String pckage, boolean flag)
setPackageRequired(String, boolean)
pckage
- the name or URI of the package extension.flag
- a Boolean value indicating whether the package is required.true
public void setSBMLDocumentAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
SBMLDocumentAttributes
.attributes
- public java.lang.String toString()
AbstractSBase
toString
in class AbstractSBase
public boolean unsetModel()
true
if calling this method changed the properties
of this element.public java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
SBase
SBase
that
need to be written out in XML.
The attribute name is used as a key and the attribute value as value. If a prefix is needed for the attribute name, it need to be set directly in this map.
writeXMLAttributes
in interface SBase
writeXMLAttributes
in class AbstractSBase
Map
containing the XML attributes of this object.