public class libsbml extends Object implements libsbmlConstants
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.
In the C++ and C versions of libSBML, there exists a small number of methods that are global in scope in addition, libSBML uses a number of enum's to define such things as error codes in a way that can be used by both C++ and C. This poses a problem in languages such as Java, where there is no concept of global method or global constant. SWIG wraps these global identifiers in the class whose documentation you see before you.
Modifier and Type | Field and Description |
---|---|
static OStream |
cerr
Stream handle for low-level C++ standard error stream.
|
static OStream |
clog
Stream handle for low-level C++ standard logging stream.
|
static OStream |
cout
Stream handle for low-level C++ standard output stream.
|
AllChecksON, AllowedAttributesOnAlgRule, AllowedAttributesOnAssignRule, AllowedAttributesOnCompartment, AllowedAttributesOnConstraint, AllowedAttributesOnDelay, AllowedAttributesOnEvent, AllowedAttributesOnEventAssignment, AllowedAttributesOnFunc, AllowedAttributesOnInitialAssign, AllowedAttributesOnKineticLaw, AllowedAttributesOnListOfComps, AllowedAttributesOnListOfConstraints, AllowedAttributesOnListOfEventAssign, AllowedAttributesOnListOfEvents, AllowedAttributesOnListOfFuncs, AllowedAttributesOnListOfInitAssign, AllowedAttributesOnListOfLocalParam, AllowedAttributesOnListOfMods, AllowedAttributesOnListOfParams, AllowedAttributesOnListOfReactions, AllowedAttributesOnListOfRules, AllowedAttributesOnListOfSpecies, AllowedAttributesOnListOfSpeciesRef, AllowedAttributesOnListOfUnitDefs, AllowedAttributesOnListOfUnits, AllowedAttributesOnLocalParameter, AllowedAttributesOnModel, AllowedAttributesOnModifier, AllowedAttributesOnParameter, AllowedAttributesOnPriority, AllowedAttributesOnRateRule, AllowedAttributesOnReaction, AllowedAttributesOnSBML, AllowedAttributesOnSpecies, AllowedAttributesOnSpeciesReference, AllowedAttributesOnTrigger, AllowedAttributesOnUnit, AllowedAttributesOnUnitDefinition, AND_ASSOCIATION, AnnotationNotElement, AnnotationNotesNotAllowedLevel1, ApplyCiMustBeModelComponent, ApplyCiMustBeUserFunction, ArgsToEqNeedSameType, AssignmentToConstantEntity, AssignRuleCompartmentMismatch, AssignRuleParameterMismatch, AssignRuleSpeciesMismatch, AssignRuleStoichiometryMismatch, AST_CONSTANT_E, AST_CONSTANT_FALSE, AST_CONSTANT_PI, AST_CONSTANT_TRUE, AST_DIVIDE, AST_FUNCTION, AST_FUNCTION_ABS, AST_FUNCTION_ARCCOS, AST_FUNCTION_ARCCOSH, AST_FUNCTION_ARCCOT, AST_FUNCTION_ARCCOTH, AST_FUNCTION_ARCCSC, AST_FUNCTION_ARCCSCH, AST_FUNCTION_ARCSEC, AST_FUNCTION_ARCSECH, AST_FUNCTION_ARCSIN, AST_FUNCTION_ARCSINH, AST_FUNCTION_ARCTAN, AST_FUNCTION_ARCTANH, AST_FUNCTION_CEILING, AST_FUNCTION_COS, AST_FUNCTION_COSH, AST_FUNCTION_COT, AST_FUNCTION_COTH, AST_FUNCTION_CSC, AST_FUNCTION_CSCH, AST_FUNCTION_DELAY, AST_FUNCTION_EXP, AST_FUNCTION_FACTORIAL, AST_FUNCTION_FLOOR, AST_FUNCTION_LN, AST_FUNCTION_LOG, AST_FUNCTION_PIECEWISE, AST_FUNCTION_POWER, AST_FUNCTION_ROOT, AST_FUNCTION_SEC, AST_FUNCTION_SECH, AST_FUNCTION_SIN, AST_FUNCTION_SINH, AST_FUNCTION_TAN, AST_FUNCTION_TANH, AST_INTEGER, AST_LAMBDA, AST_LOGICAL_AND, AST_LOGICAL_NOT, AST_LOGICAL_OR, AST_LOGICAL_XOR, AST_MINUS, AST_NAME, AST_NAME_AVOGADRO, AST_NAME_TIME, AST_PLUS, AST_POWER, AST_RATIONAL, AST_REAL, AST_REAL_E, AST_RELATIONAL_EQ, AST_RELATIONAL_GEQ, AST_RELATIONAL_GT, AST_RELATIONAL_LEQ, AST_RELATIONAL_LT, AST_RELATIONAL_NEQ, AST_TIMES, AST_UNKNOWN, AvogadroNotSupported, BadCsymbolDefinitionURLValue, BadlyFormedXML, BadMathML, BadMathMLNodeType, BadProcessingInstruction, BadXMLAttribute, BadXMLAttributeValue, BadXMLComment, BadXMLDecl, BadXMLDeclLocation, BadXMLDOCTYPE, BadXMLDocumentStructure, BadXMLIDRef, BadXMLIDValue, BadXMLPrefix, BadXMLPrefixValue, BIOLOGICAL_QUALIFIER, BooleanOpsNeedBooleanArgs, BothAmountAndConcentrationSet, BothStoichiometryAndMath, BQB_ENCODES, BQB_HAS_PART, BQB_HAS_PROPERTY, BQB_HAS_VERSION, BQB_IS, BQB_IS_DESCRIBED_BY, BQB_IS_ENCODED_BY, BQB_IS_HOMOLOG_TO, BQB_IS_PART_OF, BQB_IS_PROPERTY_OF, BQB_IS_VERSION_OF, BQB_OCCURS_IN, BQB_UNKNOWN, BQM_IS, BQM_IS_DERIVED_FROM, BQM_IS_DESCRIBED_BY, BQM_UNKNOWN, CannotConvertToL1V1, CelsiusNoLongerValid, CircularRuleDependency, CNV_TYPE_BOOL, CNV_TYPE_DOUBLE, CNV_TYPE_INT, CNV_TYPE_SINGLE, CNV_TYPE_STRING, CompartmentNotOnL1Reaction, CompartmentOnReaction, CompartmentShouldHaveSize, CompartmentTypeNotValidAttribute, CompartmentTypeNotValidComponent, ConstantNotValidAttribute, ConstantSpeciesNotValidAttribute, ConstraintContainsDOCTYPE, ConstraintContainsXMLDecl, ConstraintMathNotBoolean, ConstraintNotInXHTMLNamespace, ConstraintNotValidComponent, ConversionFactorMustConstant, ConversionFactorNotInL1, ConversionFactorOnSpecies, DanglingUnitSIdRef, DelayNeedsValuesFromTriggerTime, DelayUnitsNotTime, DisallowedDefinitionURLUse, DisallowedMathMLEncodingUse, DisallowedMathMLSymbol, DisallowedMathTypeAttributeUse, DisallowedMathTypeAttributeValue, DisallowedMathUnitsUse, DuplicateAnnotationInvalidInL2v2, DuplicateAnnotationInvalidInL2v3, DuplicateAnnotationInvalidInL2v4, DuplicateAnnotationInvalidInL3v1, DuplicateAnnotationNamespaces, DuplicateComponentId, DuplicateLocalParameterId, DuplicateMetaId, DuplicateUnitDefinitionId, DuplicateXMLAttribute, EmptyListElement, EmptyListInKineticLaw, EmptyListInReaction, EmptyListOfUnits, EmptyUnitListElement, EventAndAssignmentRuleForId, EventAssignCompartmentMismatch, EventAssignmentForConstantEntity, EventAssignParameterMismatch, EventAssignSpeciesMismatch, EventAssignStoichiometryMismatch, EventNotValidComponent, ExtentUnitsNotSubstance, FailedMathMLReadOfDouble, FailedMathMLReadOfExponential, FailedMathMLReadOfInteger, FailedMathMLReadOfRational, FLUXBOUND_OPERATION_EQUAL, FLUXBOUND_OPERATION_GREATER, FLUXBOUND_OPERATION_GREATER_EQUAL, FLUXBOUND_OPERATION_LESS, FLUXBOUND_OPERATION_LESS_EQUAL, FLUXBOUND_OPERATION_UNKNOWN, FormulaInLevel1KL, FuncDefNotValidComponent, FunctionDefMathNotLambda, GENE_ASSOCIATION, GeneralWarningNotSpecified, GlobalUnitsNotDeclared, HasOnlySubsNoSpatialUnits, HasOnlySubstanceUnitsNotinL1, HasOnlySubsUnitsNotValidAttribute, IdCheckOFF, IdCheckON, IdNotValidAttribute, InconsistentArgUnits, InconsistentArgUnitsWarnings, InconsistentExponUnitsWarnings, InconsistentKineticLawUnitsL3, InconsistentPowerUnitsWarnings, IncorrectCompartmentSpatialDimensions, IncorrectOrderInConstraint, IncorrectOrderInEvent, IncorrectOrderInKineticLaw, IncorrectOrderInModel, IncorrectOrderInReaction, InitAssignCompartmenMismatch, InitAssignmentAndRuleForSameId, InitAssignParameterMismatch, InitAssignSpeciesMismatch, InitAssignStoichiometryMismatch, InitialAssignNotValidComponent, InitialValueFalseEventNotSupported, InitialValueNotBoolean, IntegerSpatialDimensions, InternalXMLParserError, Invalid1DCompartmentUnits, Invalid2DCompartmentUnits, Invalid3DCompartmentUnits, InvalidAfterXMLContent, InvalidApplyCiInLambda, InvalidAreaRedefinition, InvalidAssignRuleVariable, InvalidCharInXML, InvalidCiInLambda, InvalidCompartmentSBOTerm, InvalidCompartmentTypeRef, InvalidCompartmentTypeSBOTerm, InvalidConstraintContent, InvalidConstraintSBOTerm, InvalidDelaySBOTerm, InvalidEventAssignmentSBOTerm, InvalidEventAssignmentVariable, InvalidEventSBOTerm, InvalidFunctionDefReturnType, InvalidFunctionDefSBOTerm, InvalidIdSyntax, InvalidInitAssignSBOTerm, InvalidInitAssignSymbol, InvalidKineticLawSBOTerm, InvalidL1CompartmentUnits, InvalidLengthRedefinition, InvalidMathElement, InvalidMetaidSyntax, InvalidModelSBOTerm, InvalidModifiersList, InvalidNamespaceOnSBML, InvalidNameSyntax, InvalidNoArgsPassedToFunctionDef, InvalidNotesContent, InvalidParameterSBOTerm, InvalidParameterUnits, InvalidRateRuleVariable, InvalidReactantsProductsList, InvalidReactionSBOTerm, InvalidRuleOrdering, InvalidRuleSBOTerm, InvalidSBMLLevelVersion, InvalidSBOTermSyntax, InvalidSpeciesCompartmentRef, InvalidSpeciesReference, InvalidSpeciesReferenceSBOTerm, InvalidSpeciesSBOTerm, InvalidSpeciesSusbstanceUnits, InvalidSpeciesTypeRef, InvalidSpeciesTypeSBOTerm, InvalidSubstanceRedefinition, InvalidTargetLevelVersion, InvalidTimeRedefinition, InvalidTriggerSBOTerm, InvalidUnitDefId, InvalidUnitIdSyntax, InvalidUnitKind, InvalidUnitsValue, InvalidVolumeRedefinition, InvalidXMLConstruct, KineticLawNotSubstancePerTime, KineticLawParametersAreLocalOnly, L1V1CompartmentVolumeReqd, L3AreaUnitsOnModel, L3ConversionFactorOnModel, L3ExtentUnitsOnModel, L3LengthUnitsOnModel, L3NotSchemaConformant, L3NotSupported, L3P_AVOGADRO_IS_CSYMBOL, L3P_AVOGADRO_IS_NAME, L3P_COLLAPSE_UNARY_MINUS, L3P_EXPAND_UNARY_MINUS, L3P_NO_UNITS, L3P_PARSE_LOG_AS_ERROR, L3P_PARSE_LOG_AS_LN, L3P_PARSE_LOG_AS_LOG10, L3P_PARSE_UNITS, L3PackageOnLowerSBML, L3SpatialDimensionsUnset, L3SubstanceUnitsOnModel, L3TimeUnitsOnModel, L3VolumeUnitsOnModel, LambdaOnlyAllowedInFunctionDef, LevelPositiveInteger, LIBSBML_ANNOTATION_NAME_NOT_FOUND, LIBSBML_ANNOTATION_NS_NOT_FOUND, LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_CAT_IDENTIFIER_CONSISTENCY, LIBSBML_CAT_INTERNAL, LIBSBML_CAT_INTERNAL_CONSISTENCY, LIBSBML_CAT_MATHML_CONSISTENCY, LIBSBML_CAT_MODELING_PRACTICE, LIBSBML_CAT_OVERDETERMINED_MODEL, LIBSBML_CAT_SBML, LIBSBML_CAT_SBML_L1_COMPAT, LIBSBML_CAT_SBML_L2V1_COMPAT, LIBSBML_CAT_SBML_L2V2_COMPAT, LIBSBML_CAT_SBML_L2V3_COMPAT, LIBSBML_CAT_SBML_L2V4_COMPAT, LIBSBML_CAT_SBML_L3V1_COMPAT, LIBSBML_CAT_SBO_CONSISTENCY, LIBSBML_CAT_SYSTEM, LIBSBML_CAT_UNITS_CONSISTENCY, LIBSBML_CAT_XML, LIBSBML_CONV_CONVERSION_NOT_AVAILABLE, LIBSBML_CONV_INVALID_SRC_DOCUMENT, LIBSBML_CONV_INVALID_TARGET_NAMESPACE, LIBSBML_CONV_PKG_CONSIDERED_UNKNOWN, LIBSBML_CONV_PKG_CONVERSION_NOT_AVAILABLE, LIBSBML_DOTTED_VERSION, LIBSBML_DUPLICATE_ANNOTATION_NS, LIBSBML_DUPLICATE_OBJECT_ID, LIBSBML_INDEX_EXCEEDS_SIZE, LIBSBML_INVALID_ATTRIBUTE_VALUE, LIBSBML_INVALID_OBJECT, LIBSBML_INVALID_XML_OPERATION, LIBSBML_LEVEL_MISMATCH, LIBSBML_NAMESPACES_MISMATCH, LIBSBML_OPERATION_FAILED, LIBSBML_OPERATION_SUCCESS, LIBSBML_PKG_CONFLICT, LIBSBML_PKG_CONFLICTED_VERSION, LIBSBML_PKG_DISABLED, LIBSBML_PKG_UNKNOWN, LIBSBML_PKG_UNKNOWN_VERSION, LIBSBML_PKG_VERSION_MISMATCH, LIBSBML_SEV_ERROR, LIBSBML_SEV_FATAL, LIBSBML_SEV_GENERAL_WARNING, LIBSBML_SEV_INFO, LIBSBML_SEV_NOT_APPLICABLE, LIBSBML_SEV_SCHEMA_ERROR, LIBSBML_SEV_WARNING, LIBSBML_UNEXPECTED_ATTRIBUTE, LIBSBML_VERSION, LIBSBML_VERSION_MISMATCH, LIBSBML_VERSION_STRING, LibSBMLAdditionalCodesLowerBound, LocalParameterShadowsId, MathCheckOFF, MathCheckON, MathResultMustBeNumeric, MetaIdNotValidAttribute, MissingAnnotationNamespace, MissingEventAssignment, MissingModel, MissingOrInconsistentLevel, MissingOrInconsistentVersion, MissingSpeciesCompartment, MissingTriggerInEvent, MissingXMLAttributeValue, MissingXMLDecl, MissingXMLElements, MissingXMLEncoding, MissingXMLRequiredAttribute, MODEL_QUALIFIER, ModelSBOBranchChangedBeyondL2v2, ModelSBOBranchChangedBeyondL2v3, ModelSBOBranchChangedInL2v4, ModelSBOBranchChangedInL3v1, MultipleAnnotations, MultipleAssignmentOrRateRules, MultipleEventAssignmentsForId, MultipleInitAssignments, MultiplierNotValidAttribute, MultSpeciesSameTypeInCompartment, NameNotValidAttribute, NeedCompartmentIfHaveSpecies, NoBodyInFunctionDef, NoCompartmentOutsideInL3v1, NoCompartmentTypeInL1, NoCompartmentTypeInL2v1, NoCompartmentTypeInL3v1, NoConcentrationInZeroD, NoConstraintsInL1, NoConstraintsInL2v1, NoDelayedEventAssignmentInL2v1, NoDelayedEventAssignmentInL2v2, NoDelayedEventAssignmentInL2v3, NoEventsInL1, NoEventTimeUnitsInL2v3, NoEventTimeUnitsInL2v4, NoEventTimeUnitsInL3v1, NoFancyStoichiometryMathInL1, NoFunctionDefinitionsInL1, NoIdOnSpeciesReferenceInL2v1, NoInitialAssignmentsInL1, NoInitialAssignmentsInL2v1, NoKineticLawSubstanceUnitsInL2v2, NoKineticLawSubstanceUnitsInL2v3, NoKineticLawSubstanceUnitsInL2v4, NoKineticLawSubstanceUnitsInL3v1, NoKineticLawTimeUnitsInL2v2, NoKineticLawTimeUnitsInL2v3, NoKineticLawTimeUnitsInL2v4, NoKineticLawTimeUnitsInL3v1, NonBoundarySpeciesAssignedAndUsed, NonConstantLocalParameter, NonConstantSpeciesUsed, NoNon3DCompartmentsInL1, NoNonIntegerStoichiometryInL1, NonPersistentNotSupported, NoReactantsOrProducts, NoSBOTermsInL1, NoSBOTermsInL2v1, NoSpatialUnitsInZeroD, NoSpeciesSpatialSizeUnitsInL1, NoSpeciesSpatialSizeUnitsInL2v3, NoSpeciesSpatialSizeUnitsInL2v4, NoSpeciesSpatialSizeUnitsInL3v1, NoSpeciesTypeInL2v1, NoSpeciesTypeInL3v1, NoSpeciesTypesInL1, NoStoichiometryMathInL3v1, NotesContainsDOCTYPE, NotesContainsXMLDecl, NotesNotInXHTMLNamespace, NoTimeSymbolInFunctionDef, NotSchemaConformant, NotUTF8, NoUnitMultipliersOrOffsetsInL1, NoUnitOffsetInL2v2, NoUnitOffsetInL2v3, NoUnitOffsetInL2v4, NoUnitOffsetInL3v1, NoUnitsOnCompartment, NumericOpsNeedNumericArgs, OBJECTIVE_TYPE_MAXIMIZE, OBJECTIVE_TYPE_MINIMIZE, OBJECTIVE_TYPE_UNKNOWN, ObseleteSBOTerm, OffsetNoLongerValid, OffsetNotValidAttribute, OneDimensionalCompartmentUnits, OneListOfEventAssignmentsPerEvent, OneListOfPerKineticLaw, OneListOfUnitsPerUnitDef, OneMathElementPerConstraint, OneMathElementPerFunc, OneMathElementPerInitialAssign, OneMathElementPerRule, OneMathPerDelay, OneMathPerEventAssignment, OneMathPerKineticLaw, OneMathPerPriority, OneMathPerTrigger, OneMessageElementPerConstraint, OneOfEachListOf, OneSubElementPerReaction, OnlyCompartmentsInListOfCompartments, OnlyConstraintsInListOfConstraints, OnlyEventAssignInListOfEventAssign, OnlyEventsInListOfEvents, OnlyFuncDefsInListOfFuncDefs, OnlyInitAssignsInListOfInitAssigns, OnlyLocalParamsInListOfLocalParams, OnlyOneDelayPerEvent, OnlyOneNotesElementAllowed, OnlyOnePriorityPerEvent, OnlyParametersInListOfParameters, OnlyReactionsInListOfReactions, OnlyRulesInListOfRules, OnlySpeciesInListOfSpecies, OnlyUnitDefsInListOfUnitDefs, OnlyUnitsInListOfUnits, OpsNeedCorrectNumberOfArgs, OR_ASSOCIATION, OverdeterCheckOFF, OverdeterCheckON, OverdeterminedSystem, PackageConversionNotSupported, PackageNSMustMatch, PackageRequiredShouldBeFalse, ParameterShouldHaveUnits, ParameterUnits, PersistentNotBoolean, PieceNeedsBoolean, PiecewiseNeedsConsistentTypes, PracticeCheckOFF, PracticeCheckON, PriorityLostFromL3, PriorityUnitsNotDimensionless, RateRuleCompartmentMismatch, RateRuleForConstantEntity, RateRuleParameterMismatch, RateRuleSpeciesMismatch, RateRuleStoichiometryMismatch, RDFAboutTagNotMetaid, RDFEmptyAboutTag, RDFMissingAboutTag, RDFNotCompleteModelHistory, RDFNotModelHistory, RecursiveCompartmentContainment, RecursiveFunctionDefinition, RepeatedRule10304, RepeatedRule20611, RequiredPackagePresent, RULE_TYPE_INVALID, RULE_TYPE_RATE, RULE_TYPE_SCALAR, SBML_ALGEBRAIC_RULE, SBML_ASSIGNMENT_RULE, SBML_COMP_DELETION, SBML_COMP_EXTERNALMODELDEFINITION, SBML_COMP_MODELDEFINITION, SBML_COMP_PORT, SBML_COMP_REPLACEDBY, SBML_COMP_REPLACEDELEMENT, SBML_COMP_SBASEREF, SBML_COMP_SUBMODEL, SBML_COMPARTMENT, SBML_COMPARTMENT_TYPE, SBML_COMPARTMENT_VOLUME_RULE, SBML_CONSTRAINT, SBML_DELAY, SBML_DOCUMENT, SBML_EVENT, SBML_EVENT_ASSIGNMENT, SBML_FBC_ASSOCIATION, SBML_FBC_FLUXBOUND, SBML_FBC_FLUXOBJECTIVE, SBML_FBC_GENEASSOCIATION, SBML_FBC_OBJECTIVE, SBML_FUNCTION_DEFINITION, SBML_INITIAL_ASSIGNMENT, SBML_KINETIC_LAW, SBML_LAYOUT_BOUNDINGBOX, SBML_LAYOUT_COMPARTMENTGLYPH, SBML_LAYOUT_CUBICBEZIER, SBML_LAYOUT_CURVE, SBML_LAYOUT_DIMENSIONS, SBML_LAYOUT_GENERALGLYPH, SBML_LAYOUT_GRAPHICALOBJECT, SBML_LAYOUT_LAYOUT, SBML_LAYOUT_LINESEGMENT, SBML_LAYOUT_POINT, SBML_LAYOUT_REACTIONGLYPH, SBML_LAYOUT_REFERENCEGLYPH, SBML_LAYOUT_SPECIESGLYPH, SBML_LAYOUT_SPECIESREFERENCEGLYPH, SBML_LAYOUT_TEXTGLYPH, SBML_LIST_OF, SBML_LOCAL_PARAMETER, SBML_MODEL, SBML_MODIFIER_SPECIES_REFERENCE, SBML_PARAMETER, SBML_PARAMETER_RULE, SBML_PRIORITY, SBML_RATE_RULE, SBML_REACTION, SBML_RULE, SBML_SPECIES, SBML_SPECIES_CONCENTRATION_RULE, SBML_SPECIES_REFERENCE, SBML_SPECIES_TYPE, SBML_STOICHIOMETRY_MATH, SBML_TRIGGER, SBML_UNIT, SBML_UNIT_DEFINITION, SBML_UNKNOWN, SBMLCheckOFF, SBMLCheckON, SBMLCodesUpperBound, SBMLNamespaceInAnnotation, SBOCheckOFF, SBOCheckON, SBOTermNotUniversalInL2v2, SBOTermNotValidAttributeBeforeL2V2, SBOTermNotValidAttributeBeforeL2V3, SpatialSizeUnitsNotValidAttribute, SpatialSizeUnitsRemoved, SpatialUnitsInOneD, SpatialUnitsInThreeD, SpatialUnitsInTwoD, SPECIES_ROLE_ACTIVATOR, SPECIES_ROLE_INHIBITOR, SPECIES_ROLE_MODIFIER, SPECIES_ROLE_PRODUCT, SPECIES_ROLE_SIDEPRODUCT, SPECIES_ROLE_SIDESUBSTRATE, SPECIES_ROLE_SUBSTRATE, SPECIES_ROLE_UNDEFINED, SpeciesCompartmentRequiredInL1, SpeciesInvalidExtentUnits, SpeciesShouldHaveValue, SpeciesTypeNotValidAttribute, SpeciesTypeNotValidComponent, StoichiometryMathNotValidComponent, StoichiometryMathNotYetSupported, StrictSBORequiredInL2v2, StrictSBORequiredInL2v3, StrictUnitsRequiredInL1, StrictUnitsRequiredInL2v1, StrictUnitsRequiredInL2v2, StrictUnitsRequiredInL2v3, SubstanceUnitsOnSpecies, SubsUnitsAllowedInKL, SubsUnitsNoLongerValid, ThreeDimensionalCompartmentUnits, TimeUnitsAllowedInKL, TimeUnitsEvent, TimeUnitsNoLongerValid, TimeUnitsRemoved, TriggerMathNotBoolean, TwoDimensionalCompartmentUnits, UnclosedXMLToken, UndeclaredExtentUnitsL3, UndeclaredObjectUnitsL3, UndeclaredSpeciesInStoichMath, UndeclaredSpeciesRef, UndeclaredTimeUnitsL3, UndeclaredUnits, UndefinedOutsideCompartment, UndefinedXMLEntity, UninterpretableXMLContent, UNIT_KIND_AMPERE, UNIT_KIND_AVOGADRO, UNIT_KIND_BECQUEREL, UNIT_KIND_CANDELA, UNIT_KIND_CELSIUS, UNIT_KIND_COULOMB, UNIT_KIND_DIMENSIONLESS, UNIT_KIND_FARAD, UNIT_KIND_GRAM, UNIT_KIND_GRAY, UNIT_KIND_HENRY, UNIT_KIND_HERTZ, UNIT_KIND_INVALID, UNIT_KIND_ITEM, UNIT_KIND_JOULE, UNIT_KIND_KATAL, UNIT_KIND_KELVIN, UNIT_KIND_KILOGRAM, UNIT_KIND_LITER, UNIT_KIND_LITRE, UNIT_KIND_LUMEN, UNIT_KIND_LUX, UNIT_KIND_METER, UNIT_KIND_METRE, UNIT_KIND_MOLE, UNIT_KIND_NEWTON, UNIT_KIND_OHM, UNIT_KIND_PASCAL, UNIT_KIND_RADIAN, UNIT_KIND_SECOND, UNIT_KIND_SIEMENS, UNIT_KIND_SIEVERT, UNIT_KIND_STERADIAN, UNIT_KIND_TESLA, UNIT_KIND_VOLT, UNIT_KIND_WATT, UNIT_KIND_WEBER, UnitsCheckOFF, UnitsCheckON, UnitsNotValidAttribute, UNKNOWN_ASSOCIATION, UNKNOWN_QUALIFIER, UnknownCoreAttribute, UnknownError, UnknownPackageAttribute, UnrecognisedSBOTerm, UnrecognizedElement, UnrecognizedXMLElement, UnrecognizedXMLParserCode, UnrequiredPackagePresent, UpperUnitBound, ValuesFromTriggerTimeNeedDelay, VariableNotValidAttribute, VersionPositiveInteger, VolumeLitreDefExponentNotOne, VolumeMetreDefExponentNot3, XMLAttributeTypeMismatch, XMLBadColon, XMLBadNumber, XMLBadUTF8Content, XMLContentEmpty, XMLEmptyValueNotPermitted, XMLErrorCodesUpperBound, XMLExpectedQuotedString, XMLFileOperationError, XMLFileUnreadable, XMLFileUnwritable, XMLNetworkAccessError, XMLOutOfMemory, XMLTagMismatch, XMLTranscoderError, XMLUnexpectedEOF, XMLUnknownError, ZeroDCompartmentContainment, ZeroDimensionalCompartmentConst, ZeroDimensionalCompartmentSize, ZeroDimensionalCompartmentUnits
Modifier and Type | Method and Description |
---|---|
static XMLNode |
deleteLayoutAnnotation(XMLNode pAnnotation)   |
static XMLNode |
deleteLayoutIdAnnotation(XMLNode pAnnotation)   |
static String |
formulaToString(ASTNode tree)
Converts an AST to a string representation of a formula using a syntax
basically derived from SBML Level 1.
|
static L3ParserSettings |
getDefaultL3ParserSettings()
Returns a copy of the default parser settings used by
libsbml.parseL3Formula(String formula) . |
static String |
getLastParseL3Error()
Returns the last error reported by the parser.
|
static String |
getLibSBMLDottedVersion()
Returns the version number of this copy of libSBML as a string.
|
static int |
getLibSBMLVersion()
Returns the version number of this copy of libSBML as an integer.
|
static String |
getLibSBMLVersionString()
Returns the version number of this copy of libSBML as a string without
periods.
|
static ASTNode |
parseFormula(String formula)
Parses the given SBML formula and returns a representation of it as an
Abstract Syntax Tree (AST).
|
static ASTNode |
parseL3Formula(String formula)
Parses the given mathematical formula and returns a representation of it
as an Abstract Syntax Tree (AST).
|
static ASTNode |
parseL3FormulaWithModel(String formula,
Model model)
Parses the given mathematical formula using specific a specific
Model to
resolve symbols, and returns an Abstract Syntax Tree (AST)
representation of the result. |
static ASTNode |
parseL3FormulaWithSettings(String formula,
L3ParserSettings settings)
Parses the given mathematical formula using specific parser settings and
returns an Abstract Syntax Tree (AST) representation of the result.
|
static void |
parseLayoutAnnotation(XMLNode annotation,
ListOfLayouts layouts)   |
static XMLNode |
parseLayoutId(SimpleSpeciesReference sr)   |
static XMLNode |
parseLayouts(Model pModel)   |
static void |
parseSpeciesReferenceAnnotation(XMLNode annotation,
SimpleSpeciesReference sr)   |
static ASTNode |
readMathMLFromString(String xml)
Reads the MathML from the given XML string, constructs a corresponding
abstract syntax tree, and returns a pointer to the root of the tree.
|
static SBMLDocument |
readSBML(String filename)
Reads an SBML document from the given file
filename . |
static SBMLDocument |
readSBMLFromFile(String filename)
Reads an SBML document from the given file
filename . |
static SBMLDocument |
readSBMLFromString(String xml)
Reads an SBML document from a string assumed to be in XML format.
|
static String |
SBMLTypeCode_toString(int tc,
String pkgName)
This method takes an SBML type code and returns a string representing
the code.
|
static int |
UnitKind_equals(int uk1,
int uk2)
Tests for logical equality between two given
UNIT_KIND_
code values. |
static int |
UnitKind_forName(String name)
Converts a text string naming a kind of unit to its corresponding
libSBML
UNIT_KIND_ constant/enumeration value. |
static int |
UnitKind_isValidUnitKindString(String str,
long level,
long version)
Predicate for testing whether a given string corresponds to a
predefined libSBML unit code.
|
static String |
UnitKind_toString(int uk)
Converts a unit code to a text string equivalent.
|
static String |
writeMathMLToString(ASTNode node)
Writes the given
ASTNode (and its children) to a string as MathML, and
returns the string. |
static int |
writeSBML(SBMLDocument d,
String filename)
Writes the given SBML document
d to the file named by filename . |
static int |
writeSBMLToFile(SBMLDocument d,
String filename)
Writes the given SBML document
d to the file filename . |
static String |
writeSBMLToString(SBMLDocument d)
Writes the given SBML document
d to an in-memory string and
returns the string. |
public static final OStream cerr
A few libSBML methods accept an argument for indicating where to send
text string output. An example is the SBMLDocument.printErrors(org.sbml.libsbml.OStream)
method. However, the methods use C++ style
streams and not Java stream objects. The OStream object class in the
libSBML Java interface provides a wrapper for the underlying C++
streams. The present object (cerr) is a static final variable that
can be used directly from your code. An example use might be
something like this:
SBMLDocument document = libsbml.readSBML("somefile.xml") if (document.getNumErrors() > 0) { document.printErrors(libsbml.cerr) println("Please correct the above problems first.") System.exit(1) }
By default, most operating systems have have their standard error and logging output streams directed to the console/terminal, and this is where text messages will be shown. This can usually be redirected elsewhere, although how to do this depends on the specific environment where the program is running.
libsbml.cout
,
libsbml.clog
public static final OStream clog
A few libSBML methods accept an argument for indicating where to send
text string output. An example is the SBMLDocument.printErrors(org.sbml.libsbml.OStream)
method. However, the methods use C++ style
streams and not Java stream objects. The OStream object class in the
libSBML Java interface provides a wrapper for the underlying C++
streams. The present object (clog) is a static final variable that
can be used directly from your code. An example use might be
something like this:
SBMLDocument document = libsbml.readSBML("somefile.xml") if (document.getNumErrors() > 0) { document.printErrors(libsbml.clog) println("Please correct the above problems first.") System.exit(1) }
By default, most operating systems have have their standard error and logging output streams directed to the console/terminal, and this is where text messages will be shown. This can usually be redirected elsewhere, although how to do this depends on the specific environment where the program is running.
libsbml.cout
,
libsbml.cerr
public static final OStream cout
A few libSBML methods accept an argument for indicating where to send
text string output. An example is the SBMLDocument.printErrors(org.sbml.libsbml.OStream)
method. However, the methods use C++ style
streams and not Java stream objects. The OStream object class in the
libSBML Java interface provides a wrapper for the underlying C++
streams. The present object (cout) is a static final variable that
can be used directly from your code. An example use might be
something like this:
SBMLDocument document = libsbml.readSBML("somefile.xml") if (document.getNumErrors() > 0) { document.printErrors(libsbml.cout) println("Please correct the above problems first.") System.exit(1) }
libsbml.cerr
,
libsbml.clog
public static XMLNode deleteLayoutAnnotation(XMLNode pAnnotation)
public static XMLNode deleteLayoutIdAnnotation(XMLNode pAnnotation)
public static String formulaToString(ASTNode tree)
The text-string form of mathematical formulas produced by
libsbml.formulaToString(ASTNode tree)
and read by libsbml.parseFormula(String formula)
use a simple C-inspired infix notation taken from SBML Level 1. A
formula in this text-string form therefore can be handed to a program
that understands SBML Level 1 mathematical expressions, or used as
part of a formula translation system. The syntax is described in detail
in the documentation for ASTNode
.
Note that this facility is provided as a convenience by libSBML&mdashthe MathML standard does not actually define a 'string-form' equivalent to MathML expression trees, so the choice of formula syntax is somewhat arbitrary. The approach taken by libSBML is to use the syntax defined by SBML Level 1 (which in fact used a text-string representation of formulas and not MathML). This formula syntax is based mostly on C programming syntax, and may contain operators, function calls, symbols, and white space characters. The following table provides the precedence rules for the different entities that may appear in formula strings.
Token | Operation | Class | Precedence | Associates |
---|---|---|---|---|
name | symbol reference | operand | 6 | n/a |
( expression) | expression grouping | operand | 6 | n/a |
f( ...) | function call | prefix | 6 | left |
- | negation | unary | 5 | right |
^ | power | binary | 4 | left |
* | multiplication | binary | 3 | left |
/ | divison | binary | 3 | left |
+ | addition | binary | 2 | left |
- | subtraction | binary | 2 | left |
, | argument delimiter | binary | 1 | left |
In the table above, operand implies the construct is an operand,
prefix implies the operation is applied to the following arguments,
unary implies there is one argument, and binary implies there are
two arguments. The values in the Precedence column show how the
order of different types of operation are determined. For example, the
expression a * b + c
is evaluated as (a * b) +
c
because the @c * operator has higher precedence. The
Associates column shows how the order of similar precedence
operations is determined for example, a - b + c
is
evaluated as (a - b) + c
because the +
and -
operators are left-associative.
The function call syntax consists of a function name, followed by optional white space, followed by an opening parenthesis token, followed by a sequence of zero or more arguments separated by commas (with each comma optionally preceded and/or followed by zero or more white space characters, followed by a closing parenthesis token. The function name must be chosen from one of the pre-defined functions in SBML or a user-defined function in the model. The following table lists the names of certain common mathematical functions this table corresponds to Table 6 in the SBML Level 1 Version 2 specification:
Name | Args | Formula or meaning | Argument Constraints | Result constraints |
---|---|---|---|---|
abs | x | absolute value of x | ||
acos | x | arc cosine of x in radians | -1.0 &le x &le 1.0 | 0 &le acos(x) &le &pi |
asin | x | arc sine of x in radians | -1.0 &le x &le 1.0 | 0 &le asin(x) &le &pi |
atan | x | arc tangent of x in radians | 0 &le atan(x) &le &pi | |
ceil | x | smallest number not less than x whose value is an exact integer | ||
cos | x | cosine of x | ||
exp | x | e x, where e is the base of the natural logarithm | ||
floor | x | the largest number not greater than x whose value is an exact integer | ||
log | x | natural logarithm of x | x > 0 | |
log10 | x | base 10 logarithm of x | x > 0 | |
pow | x, y | x y | ||
sqr | x | x2 | ||
sqrt | x | &radicx | x > 0 | sqrt(x) &ge 0 |
sin | x | sine of x | ||
tan | x | tangent of x | x &ne n*&pi/2, for odd integer n |
tree
- the AST to be converted.
libsbml.formulaToString(ASTNode tree)
,
libsbml.parseL3FormulaWithSettings(String formula, L3ParserSettings settings)
,
libsbml.parseL3Formula(String formula)
,
parseL3FormulaWithModel(String formula, Model model)
,
getLastParseL3Error()
,
getDefaultL3ParserSettings()
log(x)
represents the natural
logarithm, whereas in MathML, the natural logarithm is
<ln/>
. Application writers are urged to be careful
when translating between text forms and MathML forms, especially if they
provide a direct text-string input facility to users of their software
systems.public static L3ParserSettings getDefaultL3ParserSettings()
libsbml.parseL3Formula(String formula)
.
The settings structure allows callers to change the following parsing behaviors:
Model
object against which identifiers to compare
identifiers. This causes the parser to search the Model
for identifiers
that the parser encounters in the formula. If a given symbol in the
formula matches the identifier of a Species
, Compartment
, Parameter
,
Reaction
, SpeciesReference
or FunctionDefinition
in the Model
, then the
symbol is assumed to refer to that model entity instead of any possible
mathematical terms with the same symbol. For example, if the parser is
given a Model
containing a Species
with the identifier
"pi
", and the formula to be parsed is
"3*pi
", the MathML produced will contain the
construct <ci> pi </ci>
instead of the
construct <pi/>
.
log(x)
" with a single
argument as the base 10
logarithm of x, the natural logarithm of x, or treat the case as an
error.
number id
" by interpreting
id
as the identifier of a unit of measurement associated with the
number, or whether to treat the case as an error.
avogadro
" as an ASTNode
of
type AST_NAME_AVOGADRO
or
as type AST_NAME
.
AST_MINUS
for all unary minuses, or
collapse and remove minuses where possible.
For more details about the parser, please see the definition of
L3ParserSettings
and
libsbml.parseL3Formula(String formula)
.
public static String getLastParseL3Error()
If libsbml.parseL3Formula(String formula)
,
libsbml.parseL3FormulaWithSettings(String formula,
, or
L3ParserSettings
settings)libsbml.parseL3FormulaWithModel(String formula,
return Model
model)null
, an error is set internally which is accessible
via this function.
libsbml.formulaToString(ASTNode tree)
,
libsbml.parseL3FormulaWithSettings(String formula, L3ParserSettings settings)
,
libsbml.parseL3Formula(String formula)
,
parseL3FormulaWithModel(String formula, Model model)
,
getDefaultL3ParserSettings()
public static String getLibSBMLDottedVersion()
libsbml.getLibSBMLVersionString()
public static int getLibSBMLVersion()
public static String getLibSBMLVersionString()
libsbml.getLibSBMLDottedVersion()
public static ASTNode parseFormula(String formula)
The text-string form of mathematical formulas produced by
libsbml.formulaToString(ASTNode tree)
and read by libsbml.parseFormula(String formula)
and
libsbml.parseL3Formula(String formula)
use a simple C-inspired infix notation. A
formula in this text-string form therefore can be handed to a program
that understands SBML mathematical expressions, or used as
part of a formula translation system. The syntax is described in detail
in the documentation for ASTNode
.
This returns the root node of the AST corresponding to the formula. If
the formula contains a syntax error, null
is returned instead.
Note that this facility is provided as a convenience by libSBML&mdashthe MathML standard does not actually define a 'string-form' equivalent to MathML expression trees, so the choice of formula syntax is somewhat arbitrary. The approach taken by libSBML is to use the syntax defined by SBML Level 1 (which in fact used a text-string representation of formulas and not MathML). This formula syntax is based mostly on C programming syntax, and may contain operators, function calls, symbols, and white space characters. The following table provides the precedence rules for the different entities that may appear in formula strings.
Token | Operation | Class | Precedence | Associates |
---|---|---|---|---|
name | symbol reference | operand | 6 | n/a |
( expression) | expression grouping | operand | 6 | n/a |
f( ...) | function call | prefix | 6 | left |
- | negation | unary | 5 | right |
^ | power | binary | 4 | left |
* | multiplication | binary | 3 | left |
/ | divison | binary | 3 | left |
+ | addition | binary | 2 | left |
- | subtraction | binary | 2 | left |
, | argument delimiter | binary | 1 | left |
In the table above, operand implies the construct is an operand,
prefix implies the operation is applied to the following arguments,
unary implies there is one argument, and binary implies there are
two arguments. The values in the Precedence column show how the
order of different types of operation are determined. For example, the
expression a * b + c
is evaluated as (a * b) +
c
because the @c * operator has higher precedence. The
Associates column shows how the order of similar precedence
operations is determined for example, a - b + c
is
evaluated as (a - b) + c
because the +
and -
operators are left-associative.
The function call syntax consists of a function name, followed by optional white space, followed by an opening parenthesis token, followed by a sequence of zero or more arguments separated by commas (with each comma optionally preceded and/or followed by zero or more white space characters, followed by a closing parenthesis token. The function name must be chosen from one of the pre-defined functions in SBML or a user-defined function in the model. The following table lists the names of certain common mathematical functions this table corresponds to Table 6 in the SBML Level 1 Version 2 specification:
Name | Args | Formula or meaning | Argument Constraints | Result constraints |
---|---|---|---|---|
abs | x | absolute value of x | ||
acos | x | arc cosine of x in radians | -1.0 &le x &le 1.0 | 0 &le acos(x) &le &pi |
asin | x | arc sine of x in radians | -1.0 &le x &le 1.0 | 0 &le asin(x) &le &pi |
atan | x | arc tangent of x in radians | 0 &le atan(x) &le &pi | |
ceil | x | smallest number not less than x whose value is an exact integer | ||
cos | x | cosine of x | ||
exp | x | e x, where e is the base of the natural logarithm | ||
floor | x | the largest number not greater than x whose value is an exact integer | ||
log | x | natural logarithm of x | x > 0 | |
log10 | x | base 10 logarithm of x | x > 0 | |
pow | x, y | x y | ||
sqr | x | x2 | ||
sqrt | x | &radicx | x > 0 | sqrt(x) &ge 0 |
sin | x | sine of x | ||
tan | x | tangent of x | x &ne n*&pi/2, for odd integer n |
formula
- the text-string formula expression to be parsed
libsbml.formulaToString(ASTNode tree)
,
libsbml.parseL3FormulaWithSettings(String formula, L3ParserSettings settings)
,
libsbml.parseL3Formula(String formula)
,
parseL3FormulaWithModel(String formula, Model model)
,
getLastParseL3Error()
,
getDefaultL3ParserSettings()
log(x)
represents the natural
logarithm, whereas in MathML, the natural logarithm is
<ln/>
. Application writers are urged to be careful
when translating between text forms and MathML forms, especially if they
provide a direct text-string input facility to users of their software
systems.public static ASTNode parseL3Formula(String formula)
The text-string form of mathematical formulas read by this function
are expanded versions of the formats produced and read by libsbml.formulaToString(ASTNode tree)
and
libsbml.parseFormula(String formula)
,
respectively. The latter two libSBML functions were originally
developed to support conversion between SBML Levels 1 and 2,
and were focused on the syntax of mathematical formulas used in SBML
Level 1. With time, and the use of MathML in SBML Levels 2
and 3, it became clear that supporting Level 2 and 3's
expanded mathematical syntax would be useful for software developers.
To maintain backwards compatibility, the original
libsbml.formulaToString(ASTNode tree)
and
libsbml.parseFormula(String formula)
have been left untouched, and instead, the new functionality is
provided in the form of
libsbml.parseL3Formula(String formula)
.
The following are the differences in the formula syntax supported by
this function, compared to what is supported by libsbml.parseFormula(String formula)
:
SId
in the SBML specifications). The whitespace between
number
and unit
is optional.
&&
, ||
, !
, and !=
may be used.
@%
and
will produce a piecewise function in the MathML.
arc
as a prefix or simply a
in other words, both
arccsc
and acsc
are interpreted as the operator arccosecant
defined in MathML. (Many functions in the SBML Level 1 infix-notation
parser implemented by libsbml.parseFormula(String formula)
are defined this way as well, but not all.)
(integer/integer)No spaces are allowed in this construct in other words, "
(3 / 4)
" will be parsed into the MathML
<divide>
construct rather than a rational number. The
general number syntax allows you to assign units to a rational number, e.g.,
"(3/4) ml
". (If the string is a division, units
are not interpreted in this way.)
L3ParserSettings
object
in conjunction with the alternative function call
libsbml.parseL3FormulaWithSettings(String formula, L3ParserSettings
settings)
, including the following:
log
with a single argument ("log(x)
")
can be parsed as log10(x)
, ln(x)
, or treated
as an error, as desired.
- -3
")
can be removed from the input entirely and single unary minuses can be
incorporated into the number node, or all minuses can be preserved in
the AST node structure.
avogadro
can be parsed as a MathML csymbol or
as an identifier.
Model
object may optionally be provided to the parser using
the variant function call libsbml.parseL3FormulaWithModel(String formula, Model
model)
.
or stored in a L3ParserSettings
object passed to the variant function
libsbml.parseL3FormulaWithSettings(String formula, L3ParserSettings
settings)
.
When a Model
object is provided, identifiers (values of type SId
)
from that model are used in preference to pre-defined MathML
definitions. More precisely, the Model
entities whose identifiers will
shadow identical symbols in the mathematical formula are: Species
,
Compartment
, Parameter
, Reaction
, and SpeciesReference
. For instance,
if the parser is given a Model
containing a Species
with the identifier
"pi
", and the formula to be parsed is
"3*pi
", the MathML produced will contain the
construct <ci> pi </ci>
instead of the
construct <pi/>
.
Model
object is provided, SId
values of
user-defined functions present in the model will be used preferentially
over pre-defined MathML functions. For example, if the passed-in Model
contains a FunctionDefinition
with the identifier
"sin
", that function will be used instead of the
predefined MathML function <sin/>
.
libsbml.parseL3Formula(String formula)
),
but they can be change on a per-call basis by using the alternative function
libsbml.parseL3FormulaWithSettings(String formula, L3ParserSettings
settings)
This function returns the root node of the AST corresponding to the
formula given as the argument. If the formula contains a syntax error,
this function will return null
instead. When null
is returned, an
error is set information about the error can be retrieved using
libsbml.getLastParseL3Error()
.
Note that this facility and the SBML Level 1-based libsbml.parseFormula(String formula)
are provided as a convenience by libSBML&mdashthe MathML standard does not
actually define a 'string-form' equivalent to MathML expressions, so the
choice of formula syntax is arbitrary. The approach taken by libSBML is
to start with the syntax defined by SBML Level 1 (which in fact
used a text-string representation of formulas, and not MathML), and
expand it to include the above functionality. This formula syntax is
based mostly on C programming syntax, and may contain operators,
function calls, symbols, and white space characters. The following
table provides the precedence rules for the different entities that may
appear in formula strings.
Token | Operation | Class | Precedence | Associates |
---|---|---|---|---|
name | symbol reference | operand | 10 | n/a |
( expression) | expression grouping | operand | 10 | n/a |
f( ...) | function call | prefix | 9 | left |
- | negation | unary | 8 | right |
^ | power | binary | 7 | left |
*, /, % | multiplication, division, and modulo | binary | 6 | left |
+, - | addition and subtraction | binary | 5 | left |
! | boolean 'not' | unary | 4 | right |
==, <, >, <=, >=, != | boolean equality, inequality, and comparison | binary | 3 | left |
&&, || | boolean 'and' and 'or' | binary | 2 | left |
, | argument delimiter | binary | 1 | left |
In the table above, operand implies the construct is an operand,
prefix implies the operation is applied to the following arguments,
unary implies there is one argument, and binary implies there are
two arguments. The values in the Precedence column show how the
order of different types of operation are determined. For example, the
expression a + b * c
is evaluated as a + (b * c)
because the @c * operator has higher precedence. The
Associates column shows how the order of similar precedence
operations is determined for example, a && b || c
is
evaluated as (a && b) || c
because the &&
and ||
operators are left-associative and have the same precedence.
The function call syntax consists of a function name, followed by optional white space, followed by an opening parenthesis token, followed by a sequence of zero or more arguments separated by commas (with each comma optionally preceded and/or followed by zero or more white space characters), followed by a closing parenthesis token. The function name must be chosen from one of the pre-defined functions in SBML or a user-defined function in the model. The following table lists the names of certain common mathematical functions this table corresponds to Table 6 in the SBML Level 1 Version 2 specification with additions based on the functions added in SBML Level 2 and Level 3:
Name | Argument(s) | Formula or meaning | Argument Constraints | Result constraints |
---|---|---|---|---|
abs |
x | Absolute value of x. | ||
acos , arccos |
x | Arccosine of x in radians. | -1.0 &le x &le 1.0 | 0 &le acos(x) &le &pi |
acosh , arccosh |
x | Hyperbolic arccosine of x in radians. | ||
acot , arccot |
x | Arccotangent of x in radians. | ||
acoth , arccoth |
x | Hyperbolic arccotangent of x in radians. | ||
acsc , arccsc |
x | Arccosecant of x in radians. | ||
acsch , arccsch |
x | Hyperbolic arccosecant of x in radians. | ||
asec , arcsec |
x | Arcsecant of x in radians. | ||
asech , arcsech |
x | Hyperbolic arcsecant of x in radians. | ||
asin , arcsin |
x | Arcsine of x in radians. | -1.0 &le x &le 1.0 | 0 &le asin(x) &le &pi |
atan , arctan |
x | Arctangent of x in radians. | 0 &le atan(x) &le &pi | |
atanh , arctanh |
x | Hyperbolic arctangent of x in radians. | ||
ceil , ceiling |
x | Smallest number not less than x whose value is an exact integer. | ||
cos |
x | Cosine of x | ||
cosh |
x | Hyperbolic cosine of x. | ||
cot |
x | Cotangent of x. | ||
coth |
x | Hyperbolic cotangent of x. | ||
csc |
x | Cosecant of x. | ||
csch |
x | Hyperbolic cosecant of x. | ||
delay |
x, y | The value of x at y time units in the past. | ||
factorial |
n | The factorial of n. Factorials are defined by n! = n*(n-1)* ... * 1. | n must be an integer. | |
exp |
x | e x, where e is the base of the natural logarithm. | ||
floor |
x | The largest number not greater than x whose value is an exact integer. | ||
ln |
x | Natural logarithm of x. | x > 0 | |
log |
x | By default, the base 10 logarithm of x, but can be set to be the natural logarithm of x, or to be an illegal construct. | x > 0 | |
log |
x, y | The base x logarithm of y. | y > 0 | |
log10 |
x | Base 10 logarithm of x. | x > 0 | |
piecewise |
x1, y1, [x2, y2,] [...] [z] | A piecewise function: if (y1), x1. Otherwise, if (y2), x2, etc. Otherwise, z. | y1, y2, y3 [etc] must be boolean | |
pow , power |
x, y | x y. | ||
root |
b, x | The root base b of x. | ||
sec |
x | Secant of x. | ||
sech |
x | Hyperbolic secant of x. | ||
sqr |
x | x2. | ||
sqrt |
x | &radicx. | x > 0 | sqrt(x) &ge 0 |
sin |
x | Sine of x. | ||
sinh |
x | Hyperbolic sine of x. | ||
tan |
x | Tangent of x. | x &ne n*&pi/2, for odd integer n | |
tanh |
x | Hyperbolic tangent of x. | ||
and |
x, y, z... | Boolean and(x, y, z...): returns true if all of its arguments are true. Note that 'and' is an n-ary function, taking 0 or more arguments, and that and() returns 'true'. | All arguments must be boolean | |
not |
x | Boolean not(x) | x must be boolean | |
or |
x, y, z... | Boolean or(x, y, z...): returns true if at least one of its arguments is true. Note that 'or' is an n-ary function, taking 0 or more arguments, and that or() returns 'false'. | All arguments must be boolean | |
xor |
x, y, z... | Boolean xor(x, y, z...): returns true if an odd number of its arguments is true. Note that 'xor' is an n-ary function, taking 0 or more arguments, and that xor() returns 'false'. | All arguments must be boolean | |
eq |
x, y, z... | Boolean eq(x, y, z...): returns true if all arguments are equal. Note that 'eq' is an n-ary function, but must take 2 or more arguments. | ||
geq |
x, y, z... | Boolean geq(x, y, z...): returns true if each argument is greater than or equal to the argument following it. Note that 'geq' is an n-ary function, but must take 2 or more arguments. | ||
gt |
x, y, z... | Boolean gt(x, y, z...): returns true if each argument is greater than the argument following it. Note that 'gt' is an n-ary function, but must take 2 or more arguments. | ||
leq |
x, y, z... | Boolean leq(x, y, z...): returns true if each argument is less than or equal to the argument following it. Note that 'leq' is an n-ary function, but must take 2 or more arguments. | ||
lt |
x, y, z... | Boolean lt(x, y, z...): returns true if each argument is less than the argument following it. Note that 'lt' is an n-ary function, but must take 2 or more arguments. | ||
neq |
x, y | Boolean x != y: returns true unless x and y are equal. | ||
plus |
x, y, z... | x + y + z + ...: The sum of the arguments of the function. Note that 'plus' is an n-ary function taking 0 or more arguments, and that 'plus()' returns 0. | ||
times |
x, y, z... | x * y * z * ...: The product of the arguments of the function. Note that 'times' is an n-ary function taking 0 or more arguments, and that 'times()' returns 1. | ||
minus |
x, y | x - y. | ||
divide |
x, y | x / y. |
Note that this function's interpretation of the string
"log
" as a function with a single argument can be
changed use the function libsbml.parseL3FormulaWithSettings(String formula,
instead of this function and pass it an appropriate L3ParserSettings
settings)L3ParserSettings
object. By default, unlike the SBML Level 1 parser implemented by
libsbml.parseFormula(String formula)
,
the string "log
" is interpreted as the base 10
logarithm, and not as the natural logarithm. However, you can change
the interpretation to be base-10 log, natural log, or as an error since
the name 'log' by itself is ambiguous, you require that the parser uses
log10
or ln
instead, which are more clear. Please refer to
libsbml.parseL3FormulaWithSettings(String formula,
.
L3ParserSettings
settings)
In addition, the following symbols will be translated to their MathML
equivalents, if no symbol with the same SId
identifier string exists
in the Model
object provided:
Name | Meaning | MathML |
---|---|---|
true |
The boolean value true |
<true/> |
false |
The boolean value false |
<false/> |
pi |
The mathematical constant pi | <pi/> |
avogadro |
The numerical value of Avogadro's constant, as defined in the SBML specification | <csymbol encoding='text' definitionURL='http://www.sbml.org/sbml/symbols/avogadro'> avogadro </csymbol/> |
time |
Simulation time as defined in SBML | <csymbol encoding='text' definitionURL='http://www.sbml.org/sbml/symbols/time'> time </csymbol/> |
inf or infinity |
The mathematical constant 'infinity' | <infinity/> |
nan or notanumber |
The mathematical concept 'not a number' | <notanumber/> |
Note that whether the string "avogadro
" is parsed
as an AST node of type AST_NAME_AVOGADRO
or AST_NAME
is configurable use the alternate version of this
function, called
libsbml.parseL3FormulaWithSettings(String formula,
.
This functionality is provided because SBML Level 2 models may not
use L3ParserSettings
settings)AST_NAME_AVOGADRO
AST nodes.
formula
- the text-string formula expression to be parsed
null
if an error occurred while parsing the formula. When null
is returned, an error is recorded internally information about the
error can be retrieved using
libsbml.getLastParseL3Error()
.
libsbml.formulaToString(ASTNode tree)
,
libsbml.parseL3FormulaWithSettings(String formula, L3ParserSettings settings)
,
libsbml.parseL3Formula(String formula)
,
parseL3FormulaWithModel(String formula, Model model)
,
getLastParseL3Error()
,
getDefaultL3ParserSettings()
public static ASTNode parseL3FormulaWithModel(String formula, Model model)
Model
to
resolve symbols, and returns an Abstract Syntax Tree (AST)
representation of the result.
This is identical to
libsbml.parseL3Formula(String formula)
,
except that this function uses the given model in the argument model
to check against identifiers that appear in the formula
.
For more details about the parser, please see the definition of
the function libsbml.parseL3Formula(String formula)
.
formula
- the mathematical formula expression to be parsed
model
- the Model
object to use for checking identifiers
null
if an error occurred while parsing the formula. When null
is returned, an error is recorded internally information about the
error can be retrieved using
libsbml.getLastParseL3Error()
.
libsbml.formulaToString(ASTNode tree)
,
libsbml.parseL3FormulaWithSettings(String formula, L3ParserSettings settings)
,
libsbml.parseL3Formula(String formula)
,
getLastParseL3Error()
,
getDefaultL3ParserSettings()
public static ASTNode parseL3FormulaWithSettings(String formula, L3ParserSettings settings)
This is identical to
libsbml.parseL3Formula(String formula)
,
except that this function uses the parser settings given in the argument
settings
. The settings override the default parsing behavior.
The parameter settings
allows callers to change the following parsing
behaviors:
Model
object against which identifiers to compare
identifiers. This causes the parser to search the Model
for identifiers
that the parser encounters in the formula. If a given symbol in the
formula matches the identifier of a Species
, Compartment
, Parameter
,
Reaction
, SpeciesReference
or FunctionDefinition
in the Model
, then the
symbol is assumed to refer to that model entity instead of any possible
mathematical terms with the same symbol. For example, if the parser is
given a Model
containing a Species
with the identifier
"pi
", and the formula to be parsed is
"3*pi
", the MathML produced will contain the
construct <ci> pi </ci>
instead of the
construct <pi/>
.
log(x)
" with a single
argument as the base 10
logarithm of x, the natural logarithm of x, or treat the case as an
error.
number id
" by interpreting
id
as the identifier of a unit of measurement associated with the
number, or whether to treat the case as an error.
avogadro
" as an ASTNode
of
type AST_NAME_AVOGADRO
or
as type AST_NAME
.
AST_MINUS
for all unary minuses, or
collapse and remove minuses where possible.
For more details about the parser, please see the definition of
L3ParserSettings
and
libsbml.parseL3Formula(String formula)
.
formula
- the mathematical formula expression to be parsed
settings
- the settings to be used for this parser invocation
null
if an error occurred while parsing the formula. When null
is returned, an error is recorded internally information about the
error can be retrieved using
libsbml.getLastParseL3Error()
.
libsbml.formulaToString(ASTNode tree)
,
libsbml.parseL3Formula(String formula)
,
parseL3FormulaWithModel(String formula, Model model)
,
getLastParseL3Error()
,
getDefaultL3ParserSettings()
public static void parseLayoutAnnotation(XMLNode annotation, ListOfLayouts layouts)
public static XMLNode parseLayoutId(SimpleSpeciesReference sr)
public static XMLNode parseLayouts(Model pModel)
public static void parseSpeciesReferenceAnnotation(XMLNode annotation, SimpleSpeciesReference sr)
public static ASTNode readMathMLFromString(String xml)
xml
- a string containing a full MathML expression
null
is returned if the given string is null
or invalid.public static SBMLDocument readSBML(String filename)
filename
.
If filename
does not exist, or it is not an SBML file, an error will
be logged in the error log of the SBMLDocument
object returned by this
method. Calling programs can inspect this error log to determine
the nature of the problem. Please refer to the definition of
SBMLDocument
for more information about the error reporting mechanism.
SBMLDocument
read.public static SBMLDocument readSBMLFromFile(String filename)
filename
.
If filename
does not exist, or it is not an SBML file, an error will
be logged in the error log of the SBMLDocument
object returned by this
method. Calling programs can inspect this error log to determine
the nature of the problem. Please refer to the definition of
SBMLDocument
for more information about the error reporting mechanism.
SBMLDocument
read.public static SBMLDocument readSBMLFromString(String xml)
If the string does not begin with XML declaration,
<?xml version='1.0' encoding='UTF-8'?>
an XML declaration string will be prepended.
This method will report an error if the given string xml
is not SBML.
The error will be logged in the error log of the SBMLDocument
object
returned by this method. Calling programs can inspect this error log to
determine the nature of the problem. Please refer to the definition of
SBMLDocument
for more information about the error reporting mechanism.
SBMLDocument
read.public static String SBMLTypeCode_toString(int tc, String pkgName)
LibSBML attaches an identifying code to every
kind of SBML object. These are known as SBML type codes. In
other languages, the set of type codes is stored in an enumeration in
the Java language interface for libSBML, the type codes are defined as
static integer constants in the interface class libsbmlConstants
. The names of the type codes all begin with the
characters SBML_.
public static int UnitKind_equals(int uk1, int uk2)
UNIT_KIND_
code values.
This function behaves exactly like C's ==
operator, except
for the following two cases:
In the two cases above, C equality comparison would yield false
(because each of the above is a distinct enumeration value), but
this function returns true.
uk1
- a UNIT_KIND_
valueuk2
- a second UNIT_KIND_
value to compare to uk1
true
) if uk1
is logically equivalent to
uk2
, zero (for false
) otherwise.
Unit
.public static int UnitKind_forName(String name)
UNIT_KIND_
constant/enumeration value.
name
- a string, the name of a predefined base unit in SBML
UNIT_KIND_
codes
defined in class libsbmlConstants
, corresponding to the string
name
(determined in a case-insensitive manner).
Unit
.public static int UnitKind_isValidUnitKindString(String str, long level, long version)
str
- a text string naming a base unit defined by SBMLlevel
- the Level of SBMLversion
- the Version within the Level of SBML
true
) if string is the name of a valid
UNIT_KIND_
value, zero (for false
) otherwise.
Unit
.public static String UnitKind_toString(int uk)
uk
- a value from the set of UNIT_KIND_
codes
defined in the class libsbmlConstants
Unit
.
public static String writeMathMLToString(ASTNode node)
ASTNode
(and its children) to a string as MathML, and
returns the string.
node
- the root of an AST to write out to the stream.
null
is returned if the given
argument is null.
public static int writeSBML(SBMLDocument d, String filename)
d
to the file named by filename
.
This function is identical to writeSBMLToFile(SBMLDocument d, String filename)
.
If the given filename ends with the suffix ".gz"
(for example, "myfile.xml.gz"
), libSBML assumes the
caller wants the file to be written compressed in gzip format.
Similarly, if the given filename ends with ".zip"
or
".bz2"
, libSBML assumes the caller wants the file to
be compressed in zip or bzip2 format (respectively).
Files whose names lack these suffixes will be written uncompressed.
Special considerations for the zip format: If the given filename
ends with ".zip"
, the file placed in the zip archive
will have the suffix ".xml"
or
".sbml"
. For example, the file in the zip archive
will be named "test.xml"
if the given filename is
"test.xml.zip"
or "test.zip"
.
Similarly, the filename in the archive will be
"test.sbml"
if the given filename is
"test.sbml.zip"
.
d
- the SBMLDocument
object to be written out in XML format
filename
- a string giving the path to a file where the XML
content is to be written.
1
on success and 0
(zero) if filename
could not be
written. Some possible reasons for failure include (a) being unable to
open the file, and (b) using a filename that indicates a compressed SBML
file (i.e., a filename ending in ".zip"
or
similar) when the compression functionality has not been enabled in
the underlying copy of libSBML.
SBMLWriter.hasZlib()
,
SBMLWriter.hasBzip2()
public static int writeSBMLToFile(SBMLDocument d, String filename)
d
to the file filename
.
This is a convenience function that uses the
SBMLWriter.writeSBMLToFile(SBMLDocument d, String
filename)
method internally, yet does not require the caller to create
an SBMLWriter
object first.
If the given filename ends with the suffix ".gz"
(for example, "myfile.xml.gz"
), libSBML assumes the
caller wants the file to be written compressed in gzip format.
Similarly, if the given filename ends with ".zip"
or
".bz2"
, libSBML assumes the caller wants the file to
be compressed in zip or bzip2 format (respectively).
Files whose names lack these suffixes will be written uncompressed.
Special considerations for the zip format: If the given filename
ends with ".zip"
, the file placed in the zip archive
will have the suffix ".xml"
or
".sbml"
. For example, the file in the zip archive
will be named "test.xml"
if the given filename is
"test.xml.zip"
or "test.zip"
.
Similarly, the filename in the archive will be
"test.sbml"
if the given filename is
"test.sbml.zip"
.
d
- an SBMLDocument
object to be written out in XML format
filename
- a string giving the path to a file where the XML
content is to be written.
1
on success and 0
(zero) if filename
could not be
written. Some possible reasons for failure include (a) being unable to
open the file, and (b) using a filename that indicates a compressed SBML
file (i.e., a filename ending in ".zip"
or
similar) when the compression functionality has not been enabled in
the underlying copy of libSBML.
SBMLWriter.hasZlib()
,
SBMLWriter.hasBzip2()
public static String writeSBMLToString(SBMLDocument d)
d
to an in-memory string and
returns the string.
This is a convenience function that uses the
SBMLWriter.writeSBMLToString(SBMLDocument d)
method internally,
yet does not require the caller to create an SBMLWriter
object first.
d
- an SBMLDocument
object to be written out in XML format
null
if one of the underlying parser
components fail.