public class libsbml extends java.lang.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_CONSTRUCTOR_OTHERWISE, AST_CONSTRUCTOR_PIECE, AST_CSYMBOL_FUNCTION, 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_MAX, AST_FUNCTION_MIN, AST_FUNCTION_PIECEWISE, AST_FUNCTION_POWER, AST_FUNCTION_QUOTIENT, AST_FUNCTION_RATE_OF, AST_FUNCTION_REM, 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_IMPLIES, AST_LOGICAL_NOT, AST_LOGICAL_OR, AST_LOGICAL_XOR, AST_MINUS, AST_NAME, AST_NAME_AVOGADRO, AST_NAME_TIME, AST_ORIGINATES_IN_PACKAGE, AST_PLUS, AST_POWER, AST_QUALIFIER_BVAR, AST_QUALIFIER_DEGREE, AST_QUALIFIER_LOGBASE, 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_SEMANTICS, AST_TIMES, AST_TYPECODE_ASTNODE, AST_TYPECODE_BASE, AST_TYPECODE_CI_NUMBER, AST_TYPECODE_CN_BASE, AST_TYPECODE_CN_EXPONENTIAL, AST_TYPECODE_CN_INTEGER, AST_TYPECODE_CN_RATIONAL, AST_TYPECODE_CN_REAL, AST_TYPECODE_CONSTANT_NUMBER, AST_TYPECODE_CSYMBOL, AST_TYPECODE_CSYMBOL_AVOGADRO, AST_TYPECODE_CSYMBOL_DELAY, AST_TYPECODE_CSYMBOL_RATE_OF, AST_TYPECODE_CSYMBOL_TIME, AST_TYPECODE_FUNCTION, AST_TYPECODE_FUNCTION_BASE, AST_TYPECODE_FUNCTION_BINARY, AST_TYPECODE_FUNCTION_CI, AST_TYPECODE_FUNCTION_LAMBDA, AST_TYPECODE_FUNCTION_NARY, AST_TYPECODE_FUNCTION_PIECEWISE, AST_TYPECODE_FUNCTION_QUALIFIER, AST_TYPECODE_FUNCTION_SEMANTIC, AST_TYPECODE_FUNCTION_UNARY, AST_TYPECODE_NUMBER, AST_UNKNOWN, AvogadroNotSupported, BadCsymbolDefinitionURLValue, BadlyFormedXML, BadMathML, BadMathMLNodeType, BadProcessingInstruction, BadXMLAttribute, BadXMLAttributeValue, BadXMLComment, BadXMLDecl, BadXMLDeclLocation, BadXMLDOCTYPE, BadXMLDocumentStructure, BadXMLIDRef, BadXMLIDValue, BadXMLPrefix, BadXMLPrefixValue, BIOLOGICAL_QUALIFIER, BooleanNumericDiscrepancy, BooleanOpsNeedBooleanArgs, BothAmountAndConcentrationSet, BothStoichiometryAndMath, BQB_ENCODES, BQB_HAS_PART, BQB_HAS_PROPERTY, BQB_HAS_TAXON, 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_HAS_INSTANCE, BQM_IS, BQM_IS_DERIVED_FROM, BQM_IS_DESCRIBED_BY, BQM_IS_INSTANCE_OF, BQM_UNKNOWN, CannotConvertToL1V1, CannotVerifyUnitsObjectNoMath, CelsiusNoLongerValid, CiCannotReference0DCompartment, CircularDependencyRateOf, CircularRuleDependency, CNV_TYPE_BOOL, CNV_TYPE_DOUBLE, CNV_TYPE_INT, CNV_TYPE_SINGLE, CNV_TYPE_STRING, CompartmentNotOnL1Reaction, CompartmentOnReaction, CompartmentShouldHaveSize, CompartmentTypeNotValidAttribute, CompartmentTypeNotValidComponent, CompAttributeRequiredMissing, CompAttributeRequiredMustBeBoolean, CompAttributeRequiredMustBeTrue, CompCircularExternalModelReference, CompDeletedReplacement, CompDeletionAllowedAttributes, CompDeletionMustReferenceObject, CompDeletionMustReferOnlyOneObject, CompDeprecatedDeleteFunction, CompDeprecatedReplaceFunction, CompDeprecatedSBaseRefSpelling, CompDuplicateComponentId, CompElementNotInNs, CompEmptyLOModelDefs, CompEmptyLOReplacedElements, CompExtentConversionMustBeParameter, CompExtModDefAllowedAttributes, CompExtModDefAllowedCoreAttributes, CompExtModDefAllowedElements, CompExtModDefBad, CompExtModMd5DoesNotMatch, CompFlatModelNotValid, CompFlatteningNotImplementedNotReqd, CompFlatteningNotImplementedReqd, CompFlatteningNotRecognisedNotReqd, CompFlatteningNotRecognisedReqd, CompFlatteningWarning, CompIdRefMayReferenceUnknownPackage, CompIdRefMustReferenceObject, CompInvalidConversionFactorSyntax, CompInvalidDeletionSyntax, CompInvalidExtentConvFactorSyntax, CompInvalidIdRefSyntax, CompInvalidMD5Syntax, CompInvalidMetaIdRefSyntax, CompInvalidModelRefSyntax, CompInvalidNameSyntax, CompInvalidPortRefSyntax, CompInvalidSIdSyntax, CompInvalidSourceSyntax, CompInvalidSubmodelRefSyntax, CompInvalidTimeConvFactorSyntax, CompInvalidUnitRefSyntax, CompLineNumbersUnreliable, CompLODeletionAllowedAttributes, CompLODeletionsAllowedElements, CompLOExtModDefsAllowedAttributes, CompLOExtModelDefsAllowedElements, CompLOModelDefsAllowedAttributes, CompLOModelDefsAllowedElements, CompLOPortsAllowedAttributes, CompLOPortsAllowedElements, CompLOReplacedElementsAllowedAttribs, CompLOReplaceElementsAllowedElements, CompLOSubmodelsAllowedAttributes, CompLOSubmodelsAllowedElements, CompMetaIdRefMayReferenceUnknownPkg, CompMetaIdRefMustReferenceObject, CompModCannotCircularlyReferenceSelf, CompModelFlatteningFailed, CompModReferenceMustIdOfModel, CompModReferenceSyntax, CompMustReplaceIDs, CompMustReplaceMetaIDs, CompMustReplacePackageIDs, CompMustReplaceSameClass, CompNoEmptyListOfOnModel, CompNoModelInReference, CompNoMultipleReferences, CompNSUndeclared, CompOneListOfDeletionOnSubmodel, CompOneListOfExtModelDefinitions, CompOneListOfModelDefinitions, CompOneListOfOnModel, CompOneListOfReplacedElements, CompOneReplacedByElement, CompOneSBaseRefOnly, CompParentOfSBRefChildMustBeSubmodel, CompPortAllowedAttributes, CompPortMustReferenceObject, CompPortMustReferenceOnlyOneObject, CompPortReferencesUnique, CompPortRefMustReferencePort, CompReferenceMustBeL3, CompReplacedByAllowedAttributes, CompReplacedByMustRefObject, CompReplacedByMustRefOnlyOne, CompReplacedBySubModelRef, CompReplacedElementAllowedAttributes, CompReplacedElementConvFactorRef, CompReplacedElementDeletionRef, CompReplacedElementMustRefObject, CompReplacedElementMustRefOnlyOne, CompReplacedElementNoDelAndConvFact, CompReplacedElementSameReference, CompReplacedElementSubModelRef, CompReplacedUnitsShouldMatch, CompRequiredFalseIfAllElementsReplaced, CompRequiredTrueIfElementsRemain, CompSBaseRefMustReferenceObject, CompSBaseRefMustReferenceOnlyOneObject, CompSubmodelAllowedAttributes, CompSubmodelAllowedCoreAttributes, CompSubmodelAllowedElements, CompSubmodelCannotReferenceSelf, CompSubmodelMustReferenceModel, CompSubmodelNoEmptyLODeletions, CompTimeConversionMustBeParameter, CompUniqueModelIds, CompUniquePortIds, CompUnitRefMustReferenceUnitDef, CompUnknown, CompUnresolvedReference, ConstantNotValidAttribute, ConstantSpeciesNotValidAttribute, ConstraintContainsDOCTYPE, ConstraintContainsXMLDecl, ConstraintMathNotBoolean, ConstraintNotInXHTMLNamespace, ConstraintNotValidComponent, ConversionFactorMustConstant, ConversionFactorNotInL1, ConversionFactorOnSpecies, ConvertibleMathInitialAssignment, DanglingUnitReference, DanglingUnitSIdRef, DelayNeedsValuesFromTriggerTime, DelayUnitsNotTime, DisallowedDefinitionURLUse, DisallowedMathMLEncodingUse, DisallowedMathMLSymbol, DisallowedMathTypeAttributeUse, DisallowedMathTypeAttributeValue, DisallowedMathUnitsUse, DoubleExponentNotSupported, DuplicateAnnotationInvalidInL2v2, DuplicateAnnotationInvalidInL2v3, DuplicateAnnotationInvalidInL2v4, DuplicateAnnotationInvalidInL3v1, DuplicateAnnotationNamespaces, DuplicateComponentId, DuplicateLocalParameterId, DuplicateMetaId, DuplicateUnitDefinitionId, DuplicateXMLAttribute, EmptyListElement, EmptyListInKineticLaw, EmptyListInReaction, EmptyListOfElementNotSupported, EmptyListOfUnits, EmptyUnitListElement, EventAndAssignmentRuleForId, EventAssignCompartmentMismatch, EventAssignmentForConstantEntity, EventAssignParameterMismatch, EventAssignSpeciesMismatch, EventAssignStoichiometryMismatch, EventNotValidComponent, ExtentUnitsNotSubstance, FailedMathMLReadOfDouble, FailedMathMLReadOfExponential, FailedMathMLReadOfInteger, FailedMathMLReadOfRational, FastReactionsNotSupported, FbcActiveObjectiveRefersObjective, FbcActiveObjectiveSyntax, FbcAndAllowedCoreAttributes, FbcAndAllowedCoreElements, FbcAndTwoChildren, FbcAttributeRequiredMissing, FbcAttributeRequiredMustBeBoolean, FbcDuplicateComponentId, FbcElementNotInNs, FbcFluxBoundAllowedElements, FbcFluxBoundAllowedL3Attributes, FbcFluxBoundNameMustBeString, FbcFluxBoundOperationMustBeEnum, FbcFluxBoundReactionMustExist, FbcFluxBoundRectionMustBeSIdRef, FbcFluxBoundRequiredAttributes, FbcFluxBoundsForReactionConflict, FbcFluxBoundValueMustBeDouble, FbcFluxObjectAllowedElements, FbcFluxObjectAllowedL3Attributes, FbcFluxObjectCoefficientMustBeDouble, FbcFluxObjectCoefficientWhenStrict, FbcFluxObjectNameMustBeString, FbcFluxObjectReactionMustBeSIdRef, FbcFluxObjectReactionMustExist, FbcFluxObjectRequiredAttributes, FbcGeneProdAssocAllowedAttribs, FbcGeneProdAssocAllowedCoreAttribs, FbcGeneProdAssocAllowedCoreElements, FbcGeneProdAssocContainsOneElement, FbcGeneProdAssocIdSyntax, FbcGeneProdAssocNameMustBeString, FbcGeneProdRefAllowedAttribs, FbcGeneProdRefAllowedCoreAttribs, FbcGeneProdRefAllowedCoreElements, FbcGeneProdRefGeneProductExists, FbcGeneProdRefGeneProductSIdRef, FbcGeneProductAllowedAttributes, FbcGeneProductAllowedCoreAttributes, FbcGeneProductAllowedCoreElements, FbcGeneProductAssocSpeciesMustExist, FbcGeneProductLabelMustBeString, FbcGeneProductLabelMustBeUnique, FbcGeneProductNameMustBeString, FbcLOFluxBoundsAllowedAttributes, FbcLOFluxBoundsAllowedElements, FbcLOGeneProductsAllowedAttributes, FbcLOGeneProductsAllowedElements, FbcLOObjectivesAllowedAttributes, FbcLOObjectivesAllowedElements, FbcModelMustHaveStrict, FbcModelStrictMustBeBoolean, FbcNoEmptyListOfs, FbcNSUndeclared, FbcObjectiveAllowedElements, FbcObjectiveAllowedL3Attributes, FbcObjectiveLOFluxObjAllowedAttribs, FbcObjectiveLOFluxObjMustNotBeEmpty, FbcObjectiveLOFluxObjOnlyFluxObj, FbcObjectiveNameMustBeString, FbcObjectiveOneListOfObjectives, FbcObjectiveRequiredAttributes, FbcObjectiveTypeMustBeEnum, FbcOnlyOneEachListOf, FbcOrAllowedCoreAttributes, FbcOrAllowedCoreElements, FbcOrTwoChildren, FbcReactionAllowedAttributes, FbcReactionBoundsMustHaveValuesStrict, FbcReactionBoundsNotAssignedStrict, FbcReactionConstantBoundsStrict, FbcReactionLwrBoundNotInfStrict, FbcReactionLwrBoundRefExists, FbcReactionLwrBoundSIdRef, FbcReactionLwrLessThanUpStrict, FbcReactionMustHaveBoundsStrict, FbcReactionOnlyOneGeneProdAss, FbcReactionUpBoundNotNegInfStrict, FbcReactionUpBoundRefExists, FbcReactionUpBoundSIdRef, FbcRequiredFalse, FbcSBMLSIdSyntax, FbcSpeciesAllowedL3Attributes, FbcSpeciesChargeMustBeInteger, FbcSpeciesFormulaMustBeString, FbcSpeciesReferenceConstantStrict, FbcSpeciesRefNotAssignedStrict, FbcSpeciesRefsStoichMustBeRealStrict, FbcUnknown, 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, GROUP_KIND_CLASSIFICATION, GROUP_KIND_COLLECTION, GROUP_KIND_PARTONOMY, GROUP_KIND_UNKNOWN, GroupsAttributeRequiredMissing, GroupsAttributeRequiredMustBeBoolean, GroupsAttributeRequiredMustHaveValue, GroupsDuplicateComponentId, GroupsElementNotInNs, GroupsGroupAllowedAttributes, GroupsGroupAllowedCoreAttributes, GroupsGroupAllowedCoreElements, GroupsGroupAllowedElements, GroupsGroupEmptyLOElements, GroupsGroupKindMustBeGroupKindEnum, GroupsGroupLOMembersAllowedAttributes, GroupsGroupLOMembersAllowedCoreAttributes, GroupsGroupLOMembersAllowedCoreElements, GroupsGroupNameMustBeString, GroupsIdSyntaxRule, GroupsLOMembersConsistentReferences, GroupsLOMembersNameMustBeString, GroupsMemberAllowedAttributes, GroupsMemberAllowedCoreAttributes, GroupsMemberAllowedCoreElements, GroupsMemberIdRefMustBeSBase, GroupsMemberIdRefMustBeSId, GroupsMemberMetaIdRefMustBeID, GroupsMemberMetaIdRefMustBeSBase, GroupsMemberNameMustBeString, GroupsModelAllowedElements, GroupsModelEmptyLOElements, GroupsModelLOGroupsAllowedCoreAttributes, GroupsModelLOGroupsAllowedCoreElements, GroupsNotCircularReferences, GroupsNSUndeclared, GroupsUnknown, HasOnlySubsNoSpatialUnits, HasOnlySubstanceUnitsNotinL1, HasOnlySubsUnitsNotValidAttribute, IdCheckOFF, IdCheckON, IdNameSBaseInL3V2, IdNotValidAttribute, InconsistentArgUnits, InconsistentArgUnitsWarnings, InconsistentExponUnitsWarnings, InconsistentKineticLawUnitsL3, InconsistentPowerUnitsWarnings, IncorrectCompartmentSpatialDimensions, IncorrectOrderInConstraint, IncorrectOrderInEvent, IncorrectOrderInKineticLaw, IncorrectOrderInModel, IncorrectOrderInReaction, INFIX_SYNTAX_CURLY_BRACES, INFIX_SYNTAX_CURLY_BRACES_SEMICOLON, INFIX_SYNTAX_NAMED_SQUARE_BRACKETS, InitAssignCompartmenMismatch, InitAssignmentAndRuleForSameId, InitAssignmentCannotRef0DComp, InitAssignParameterMismatch, InitAssignSpeciesMismatch, InitAssignStoichiometryMismatch, InitialAssignNotValidComponent, InitialValueFalseEventNotSupported, InitialValueNotBoolean, INPUT_SIGN_DUAL, INPUT_SIGN_NEGATIVE, INPUT_SIGN_POSITIVE, INPUT_SIGN_UNKNOWN, INPUT_SIGN_VALUE_NOTSET, INPUT_TRANSITION_EFFECT_CONSUMPTION, INPUT_TRANSITION_EFFECT_NONE, INPUT_TRANSITION_EFFECT_UNKNOWN, 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, InvalidLocalParameterSBOTerm, InvalidMathElement, InvalidMathMLAttribute, InvalidMetaidSyntax, InvalidModelSBOTerm, InvalidModifiersList, InvalidNamespaceOnSBML, InvalidNameSyntax, InvalidNoArgsPassedToFunctionDef, InvalidNotesContent, InvalidParameterSBOTerm, InvalidParameterUnits, InvalidRateRuleVariable, InvalidReactantsProductsList, InvalidReactionSBOTerm, InvalidRuleOrdering, InvalidRuleSBOTerm, InvalidSBMLElementSBOTerm, 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_COMPARE_BUILTINS_CASE_INSENSITIVE, L3P_COMPARE_BUILTINS_CASE_SENSITIVE, L3P_EXPAND_UNARY_MINUS, L3P_MODULO_IS_PIECEWISE, L3P_MODULO_IS_REM, L3P_NO_UNITS, L3P_PARSE_L3V2_FUNCTIONS_AS_GENERIC, L3P_PARSE_L3V2_FUNCTIONS_DIRECTLY, L3P_PARSE_LOG_AS_ERROR, L3P_PARSE_LOG_AS_LN, L3P_PARSE_LOG_AS_LOG10, L3P_PARSE_UNITS, L3PackageOnLowerSBML, L3SpatialDimensionsUnset, L3SubstanceUnitsOnModel, L3TimeUnitsOnModel, L3V2FastDeprecated, L3V2SubstanceUnitsOnModel, L3VolumeUnitsOnModel, LambdaOnlyAllowedInFunctionDef, LayoutAttributeRequiredMissing, LayoutAttributeRequiredMustBeBoolean, LayoutBBoxAllowedAttributes, LayoutBBoxAllowedCoreAttributes, LayoutBBoxAllowedCoreElements, LayoutBBoxAllowedElements, LayoutBBoxConsistent3DDefinition, LayoutCBezAllowedAttributes, LayoutCBezAllowedCoreAttributes, LayoutCBezAllowedCoreElements, LayoutCBezAllowedElements, LayoutCGAllowedAttributes, LayoutCGAllowedCoreAttributes, LayoutCGAllowedCoreElements, LayoutCGAllowedElements, LayoutCGCompartmentMustRefComp, LayoutCGCompartmentSyntax, LayoutCGMetaIdRefMustBeIDREF, LayoutCGMetaIdRefMustReferenceObject, LayoutCGNoDuplicateReferences, LayoutCGOrderMustBeDouble, LayoutCurveAllowedAttributes, LayoutCurveAllowedCoreAttributes, LayoutCurveAllowedCoreElements, LayoutCurveAllowedElements, LayoutDimsAllowedAttributes, LayoutDimsAllowedCoreAttributes, LayoutDimsAllowedCoreElements, LayoutDimsAttributesMustBeDouble, LayoutDuplicateComponentId, LayoutElementNotInNs, LayoutGGAllowedAttributes, LayoutGGAllowedCoreAttributes, LayoutGGAllowedCoreElements, LayoutGGAllowedElements, LayoutGGMetaIdRefMustBeIDREF, LayoutGGMetaIdRefMustReferenceObject, LayoutGGNoDuplicateReferences, LayoutGGReferenceMustRefObject, LayoutGGReferenceSyntax, LayoutGOAllowedAttributes, LayoutGOAllowedCoreAttributes, LayoutGOAllowedCoreElements, LayoutGOAllowedElements, LayoutGOMetaIdRefMustBeIDREF, LayoutGOMetaIdRefMustReferenceObject, LayoutGOMustContainBoundingBox, LayoutLayoutAllowedAttributes, LayoutLayoutAllowedCoreAttributes, LayoutLayoutAllowedElements, LayoutLayoutMustHaveDimensions, LayoutLayoutNameMustBeString, LayoutLOAddGOAllowedAttribut, LayoutLOAddGOAllowedElements, LayoutLOCompGlyphAllowedAttributes, LayoutLOCompGlyphAllowedElements, LayoutLOCurveSegsAllowedAttributes, LayoutLOCurveSegsAllowedElements, LayoutLOCurveSegsNotEmpty, LayoutLOLayoutsAllowedAttributes, LayoutLOLayoutsAllowedElements, LayoutLOLayoutsNotEmpty, LayoutLOReferenceGlyphAllowedAttribs, LayoutLOReferenceGlyphAllowedElements, LayoutLORnGlyphAllowedAttributes, LayoutLORnGlyphAllowedElements, LayoutLOSpeciesGlyphAllowedAttributes, LayoutLOSpeciesGlyphAllowedElements, LayoutLOSpeciesRefGlyphAllowedAttribs, LayoutLOSpeciesRefGlyphAllowedElements, LayoutLOSpeciesRefGlyphNotEmpty, LayoutLOSubGlyphAllowedAttribs, LayoutLOSubGlyphAllowedElements, LayoutLOTextGlyphAllowedAttributes, LayoutLOTextGlyphAllowedElements, LayoutLSegAllowedAttributes, LayoutLSegAllowedCoreAttributes, LayoutLSegAllowedCoreElements, LayoutLSegAllowedElements, LayoutNoEmptyListOfs, LayoutNSUndeclared, LayoutOnlyOneEachListOf, LayoutOnlyOneLOLayouts, LayoutPointAllowedAttributes, LayoutPointAllowedCoreAttributes, LayoutPointAllowedCoreElements, LayoutPointAttributesMustBeDouble, LayoutREFGAllowedAttributes, LayoutREFGAllowedCoreAttributes, LayoutREFGAllowedCoreElements, LayoutREFGAllowedElements, LayoutREFGGlyphMustRefObject, LayoutREFGGlyphSyntax, LayoutREFGMetaIdRefMustBeIDREF, LayoutREFGMetaIdRefMustReferenceObject, LayoutREFGNoDuplicateReferences, LayoutREFGReferenceMustRefObject, LayoutREFGReferenceSyntax, LayoutREFGRoleSyntax, LayoutRequiredFalse, LayoutRGAllowedAttributes, LayoutRGAllowedCoreAttributes, LayoutRGAllowedCoreElements, LayoutRGAllowedElements, LayoutRGMetaIdRefMustBeIDREF, LayoutRGMetaIdRefMustReferenceObject, LayoutRGNoDuplicateReferences, LayoutRGReactionMustRefReaction, LayoutRGReactionSyntax, LayoutSGAllowedAttributes, LayoutSGAllowedCoreAttributes, LayoutSGAllowedCoreElements, LayoutSGAllowedElements, LayoutSGMetaIdRefMustBeIDREF, LayoutSGMetaIdRefMustReferenceObject, LayoutSGNoDuplicateReferences, LayoutSGSpeciesMustRefSpecies, LayoutSGSpeciesSyntax, LayoutSIdSyntax, LayoutSRGAllowedAttributes, LayoutSRGAllowedCoreAttributes, LayoutSRGAllowedCoreElements, LayoutSRGAllowedElements, LayoutSRGMetaIdRefMustBeIDREF, LayoutSRGMetaIdRefMustReferenceObject, LayoutSRGNoDuplicateReferences, LayoutSRGRoleSyntax, LayoutSRGSpeciesGlyphMustRefObject, LayoutSRGSpeciesGlyphSyntax, LayoutSRGSpeciesReferenceSyntax, LayoutSRGSpeciesRefMustRefObject, LayoutTGAllowedAttributes, LayoutTGAllowedCoreAttributes, LayoutTGAllowedCoreElements, LayoutTGAllowedElements, LayoutTGGraphicalObjectMustRefObject, LayoutTGGraphicalObjectSyntax, LayoutTGMetaIdRefMustBeIDREF, LayoutTGMetaIdRefMustReferenceObject, LayoutTGNoDuplicateReferences, LayoutTGOriginOfTextMustRefObject, LayoutTGOriginOfTextSyntax, LayoutTGTextMustBeString, LayoutUnknownError, LayoutXsiTypeAllowedLocations, LayoutXsiTypeSyntax, 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_COMPATIBILITY, 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_SBML_L3V2_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_DEPRECATED_ATTRIBUTE, 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_MISSING_METAID, LIBSBML_NAMESPACES_MISMATCH, LIBSBML_OPERATION_FAILED, LIBSBML_OPERATION_SUCCESS, LIBSBML_OVERRIDE_DISABLED, LIBSBML_OVERRIDE_DONT_LOG, LIBSBML_OVERRIDE_ERROR, LIBSBML_OVERRIDE_WARNING, 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_USE_ID_ATTRIBUTE_FUNCTION, LIBSBML_VERSION, LIBSBML_VERSION_MISMATCH, LIBSBML_VERSION_STRING, LibSBMLAdditionalCodesLowerBound, LocalParameterShadowsId, LocalParameterShadowsSpecies, MathCheckOFF, MathCheckON, MathMLElementNotSupported, MathResultMustBeNumeric, MetaIdNotValidAttribute, MissingAnnotationNamespace, MissingEventAssignment, MissingMathElementNotSupported, MissingModel, MissingOrInconsistentLevel, MissingOrInconsistentVersion, MissingParticipantsNotSupported, MissingSpeciesCompartment, MissingTriggerElementNotSupported, MissingTriggerInEvent, MissingXMLAttributeValue, MissingXMLDecl, MissingXMLElements, MissingXMLEncoding, MissingXMLRequiredAttribute, MODEL_QUALIFIER, ModelSBOBranchChangedBeyondL2v2, ModelSBOBranchChangedBeyondL2v3, ModelSBOBranchChangedInL2v4, ModelSBOBranchChangedInL3v1, MultipleAnnotations, MultipleAssignmentOrRateRules, MultipleEventAssignmentsForId, MultipleInitAssignments, MultiplierNotValidAttribute, MultSpeciesSameTypeInCompartment, NameNotValidAttribute, NeedCompartmentIfHaveSpecies, NestedAnnotationNotAllowed, 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, OUTPUT_TRANSITION_EFFECT_ASSIGNMENT_LEVEL, OUTPUT_TRANSITION_EFFECT_PRODUCTION, OUTPUT_TRANSITION_EFFECT_UNKNOWN, OverdeterCheckOFF, OverdeterCheckON, OverdeterminedSystem, PackageConversionNotSupported, PackageNSMustMatch, PackageRequiredShouldBeFalse, ParameterShouldHaveUnits, ParameterShouldHaveValue, ParameterUnits, PersistentNotBoolean, PieceNeedsBoolean, PiecewiseNeedsConsistentTypes, PracticeCheckOFF, PracticeCheckON, PriorityLostFromL3, PriorityUnitsNotDimensionless, QualAttributeRequiredMissing, QualAttributeRequiredMustBeBoolean, QualCompartmentMustReferExisting, QualConstantMustBeBool, QualConstantQSCannotBeOutput, QualDefaultTermAllowedAttributes, QualDefaultTermAllowedCoreAttributes, QualDefaultTermAllowedElements, QualDefaultTermResultMustBeInteger, QualDefaultTermResultMustBeNonNeg, QualDuplicateComponentId, QualElementNotInNs, QualEmptyLONotAllowed, QualFuncTermAllowedAttributes, QualFuncTermAllowedCoreAttributes, QualFuncTermAllowedElements, QualFuncTermOnlyOneMath, QualFuncTermResultMustBeInteger, QualFuncTermResultMustBeNonNeg, QualFunctionTermBool, QualInitalLevelNotNegative, QualInitialLevelCannotExceedMax, QualInitialLevelMustBeInt, QualInputAllowedAttributes, QualInputAllowedCoreAttributes, QualInputAllowedElements, QualInputConstantCannotBeConsumed, QualInputNameMustBeString, QualInputQSMustBeExistingQS, QualInputSignMustBeSignEnum, QualInputThreshMustBeInteger, QualInputThreshMustBeNonNegative, QualInputTransEffectMustBeInputEffect, QualLOQualSpeciesAllowedAttributes, QualLOQualSpeciesAllowedElements, QualLOTransitiondAllowedElements, QualLOTransitionsAllowedAttributes, QualMathCSymbolDisallowed, QualMaxLevelMustBeInt, QualMaxLevelNotNegative, QualNameMustBeString, QualNSUndeclared, QualOneListOfTransOrQS, QualOutputAllowedAttributes, QualOutputAllowedCoreAttributes, QualOutputAllowedElements, QualOutputConstantMustBeFalse, QualOutputLevelMustBeInteger, QualOutputLevelMustBeNonNegative, QualOutputNameMustBeString, QualOutputProductionMustHaveLevel, QualOutputQSMustBeExistingQS, QualOutputTransEffectMustBeOutput, QualQSAssignedOnlyOnce, QualQualSpeciesAllowedAttributes, QualQualSpeciesAllowedCoreAttributes, QualQualSpeciesAllowedElements, QualRequiredTrueIfTransitions, QualTransitionAllowedAttributes, QualTransitionAllowedCoreAttributes, QualTransitionAllowedElements, QualTransitionEmptyLOElements, QualTransitionLOElements, QualTransitionLOFuncTermAttributes, QualTransitionLOFuncTermElements, QualTransitionLOFuncTermExceedMax, QualTransitionLOFuncTermNegative, QualTransitionLOInputAttributes, QualTransitionLOInputElements, QualTransitionLOOutputAttributes, QualTransitionLOOutputElements, QualTransitionNameMustBeString, QualUnknown, RateOfSpeciesTargetCompartmentNot, RateOfTargetCannotBeAssigned, RateOfTargetMustBeCi, RateRuleCompartmentMismatch, RateRuleForConstantEntity, RateRuleParameterMismatch, RateRuleSpeciesMismatch, RateRuleStoichiometryMismatch, RDFAboutTagNotMetaid, RDFEmptyAboutTag, RDFMissingAboutTag, RDFNotCompleteModelHistory, RDFNotModelHistory, RecursiveCompartmentContainment, RecursiveFunctionDefinition, RepeatedRule10304, RepeatedRule20611, RequiredPackagePresent, RULE_TYPE_INVALID, RULE_TYPE_RATE, RULE_TYPE_SCALAR, RuleCannotRef0DComp, 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_AND, SBML_FBC_ASSOCIATION, SBML_FBC_FLUXBOUND, SBML_FBC_FLUXOBJECTIVE, SBML_FBC_GENEASSOCIATION, SBML_FBC_GENEPRODUCT, SBML_FBC_GENEPRODUCTASSOCIATION, SBML_FBC_GENEPRODUCTREF, SBML_FBC_OBJECTIVE, SBML_FBC_OR, SBML_FBC_V1ASSOCIATION, SBML_FUNCTION_DEFINITION, SBML_GENERIC_SBASE, SBML_GROUPS_GROUP, SBML_GROUPS_MEMBER, 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_QUAL_DEFAULT_TERM, SBML_QUAL_FUNCTION_TERM, SBML_QUAL_INPUT, SBML_QUAL_OUTPUT, SBML_QUAL_QUALITATIVE_SPECIES, SBML_QUAL_TRANSITION, SBML_RATE_RULE, SBML_REACTION, SBML_RENDER_COLORDEFINITION, SBML_RENDER_CUBICBEZIER, SBML_RENDER_CURVE, SBML_RENDER_DEFAULTS, SBML_RENDER_ELLIPSE, SBML_RENDER_GLOBALRENDERINFORMATION, SBML_RENDER_GLOBALSTYLE, SBML_RENDER_GRADIENT_STOP, SBML_RENDER_GRADIENTDEFINITION, SBML_RENDER_GROUP, SBML_RENDER_IMAGE, SBML_RENDER_LINEARGRADIENT, SBML_RENDER_LINEENDING, SBML_RENDER_LINESEGMENT, SBML_RENDER_LISTOFGLOBALSTYLES, SBML_RENDER_LISTOFLOCALSTYLES, SBML_RENDER_LOCALRENDERINFORMATION, SBML_RENDER_LOCALSTYLE, SBML_RENDER_POINT, SBML_RENDER_POLYGON, SBML_RENDER_RADIALGRADIENT, SBML_RENDER_RECTANGLE, SBML_RENDER_RELABSVECTOR, SBML_RENDER_TEXT, SBML_RENDER_TRANSFORMATION2D, 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_INVALID, SPECIES_ROLE_MODIFIER, SPECIES_ROLE_PRODUCT, SPECIES_ROLE_SIDEPRODUCT, SPECIES_ROLE_SIDESUBSTRATE, SPECIES_ROLE_SUBSTRATE, SPECIES_ROLE_UNDEFINED, SpeciesCompartmentRequiredInL1, SpeciesInvalidExtentUnits, SpeciesRefIdInMathMLNotSupported, SpeciesShouldHaveValue, SpeciesTypeNotValidAttribute, SpeciesTypeNotValidComponent, StoichiometryMathMissingMath, 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 int |
BiolQualifierType_fromString(java.lang.String s)
This method takes a string and returns a biol qualifier
representing the string.
|
static java.lang.String |
BiolQualifierType_toString(int type)
This method takes a biol qualifier type code and returns a string
representing the code.
|
static XMLNode |
deleteLayoutAnnotation(XMLNode pAnnotation)
Takes an
XMLNode and tries to find the layout annotation node and deletes it if it was found. |
static XMLNode |
deleteLayoutIdAnnotation(XMLNode pAnnotation)
Takes an
XMLNode and tries to find the layoutId annotation node and deletes it if it was found. |
static ASTBasePlugin |
DowncastASTBasePlugin(long cPtr,
boolean owner)   |
static int |
FillRule_fromString(java.lang.String name)   |
static java.lang.String |
FillRule_toString(int rule)   |
static int |
FontStyle_fromString(java.lang.String str)   |
static java.lang.String |
FontStyle_toString(int style)   |
static int |
FontWeight_fromString(java.lang.String str)   |
static java.lang.String |
FontWeight_toString(int weight)   |
static java.lang.String |
formulaToL3String(ASTNode tree)
Converts an AST to a text string representation of a formula using an
extended syntax.
|
static java.lang.String |
formulaToL3StringWithSettings(ASTNode tree,
L3ParserSettings settings)
Converts an AST to a text string representation of a formula, using
specific formatter settings.
|
static java.lang.String |
formulaToString(ASTNode tree)
Converts an AST to a text string representation of a formula using a
basic syntax derived from SBML Level 1.
|
static L3ParserSettings |
getDefaultL3ParserSettings()
Returns a copy of the default Level 3 ('L3') formula parser settings.
|
static java.lang.String |
getLastParseL3Error()
Returns the last error reported by the 'L3' mathematical formula parser.
|
static java.lang.String |
getLibSBMLDependencyVersionOf(java.lang.String option)
Returns the version string for the dependency library used.
|
static java.lang.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 java.lang.String |
getLibSBMLVersionString()
Returns the version number of this copy of libSBML as a string without
periods.
|
static int |
GroupKind_fromString(java.lang.String code)
Returns the enumeration value corresponding to the given string or
GROUP_KIND_UNKNOWN if there is no such match. |
static int |
GroupKind_isValid(int gk)
Predicate returning
1 (true) or 0 (false) depending on whether the
given enumeration value is valid. |
static int |
GroupKind_isValidString(java.lang.String code)
Predicate returning
1 (true) or 0 (false) depending on whether the
given string is a valid enumeration value. |
static java.lang.String |
GroupKind_toString(int gk)
Returns the string version of the provided enumeration value.
|
static int |
isLibSBMLCompiledWith(java.lang.String option)
Returns an indication whether libSBML has been compiled with
against a specific library.
|
static int |
ModelQualifierType_fromString(java.lang.String s)
This method takes a string and returns a model qualifier
representing the string.
|
static java.lang.String |
ModelQualifierType_toString(int type)
This method takes a model qualifier type code and returns a string
representing the code.
|
static java.lang.String |
OperationReturnValue_toString(int returnValue)
This method takes an SBML operation return value and returns a string representing
the code.
|
static ASTNode |
parseFormula(java.lang.String formula)
Parses a text string as a mathematical formula and returns an AST
representation of it.
|
static ASTNode |
parseL3Formula(java.lang.String formula)
Parses a text string as a mathematical formula and returns an AST
representation of it.
|
static ASTNode |
parseL3FormulaWithModel(java.lang.String formula,
Model model)
Parses a text string as a mathematical formula using a
Model to resolve
symbols, and returns an AST representation of the result. |
static ASTNode |
parseL3FormulaWithSettings(java.lang.String formula,
L3ParserSettings settings)
Parses a text string as a mathematical formula using specific parser
settings and returns an AST representation of the result.
|
static void |
parseLayoutAnnotation(XMLNode annotation,
ListOfLayouts layouts)
takes an annotation that has been read into the model
identifies the RDF elements
and creates a List of Layouts from the annotation
|
static XMLNode |
parseLayoutId(SimpleSpeciesReference sr)
Creates an
XMLNode that represents the layoutId annotation of the species reference from the given SpeciesReference object. |
static XMLNode |
parseLayouts(Model pModel)
|
static void |
parseSpeciesReferenceAnnotation(XMLNode annotation,
SimpleSpeciesReference sr)
takes an annotation that has been read into the species reference
identifies the id elements and set the id of the species reference
|
static ASTNode |
readMathMLFromString(java.lang.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 ASTNode |
readMathMLFromStringWithNamespaces(java.lang.String xml,
XMLNamespaces xmlns)
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(java.lang.String filename)
Reads an SBML document from the given file.
|
static SBMLDocument |
readSBMLFromFile(java.lang.String filename)
Reads an SBML document from the given file.
|
static SBMLDocument |
readSBMLFromString(java.lang.String xml)
Reads an SBML document from a text string.
|
static java.lang.String |
SBMLTypeCode_toString(int tc,
java.lang.String pkgName)
This method takes an SBML type code and returns a string representing
the code.
|
static int |
SpreadMethod_fromString(java.lang.String name)   |
static java.lang.String |
SpreadMethod_toString(int method)   |
static int |
TextAnchor_fromString(java.lang.String str)   |
static java.lang.String |
TextAnchor_toString(int anchor)   |
static int |
UnitKind_equals(int uk1,
int uk2)
Tests for logical equality between two given
UNIT_KIND_
code values. |
static int |
UnitKind_forName(java.lang.String name)
Converts a text string naming a kind of unit to its corresponding
libSBML
UNIT_KIND_ constant/enumeration value. |
static int |
UnitKind_isValidUnitKindString(java.lang.String str,
long level,
long version)
Predicate for testing whether a given string corresponds to a
predefined libSBML unit code.
|
static java.lang.String |
UnitKind_toString(int uk)
Converts a unit code to a text string equivalent.
|
static java.lang.String |
writeMathMLToString(ASTNode node)
Writes the given AST node (and its children) to a string as MathML, and
returns the string.
|
static java.lang.String |
writeMathMLWithNamespaceToString(ASTNode node,
SBMLNamespaces sbmlns)
Writes the given AST node (and its children) to a string as MathML, and
returns the string.
|
static int |
writeSBML(SBMLDocument d,
java.lang.String filename)
Writes the given SBML document
d to the file named by filename . |
static int |
writeSBMLToFile(SBMLDocument d,
java.lang.String filename)
Writes the given SBML document
d to the file filename . |
static java.lang.String |
writeSBMLToString(SBMLDocument d)
Writes the given SBML document
d to an in-memory string and returns a
pointer to it. |
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 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 ASTBasePlugin DowncastASTBasePlugin(long cPtr, boolean owner)
public static int getLibSBMLVersion()
public static java.lang.String getLibSBMLDottedVersion()
libsbml.getLibSBMLVersionString()
public static java.lang.String getLibSBMLVersionString()
libsbml.getLibSBMLDottedVersion()
public static int isLibSBMLCompiledWith(java.lang.String option)
option
- the library to test against, this can be one of
'expat', 'libxml', 'xerces-c', 'bzip2', 'zip'
libsbml.getLibSBMLDependencyVersionOf(String option)
public static java.lang.String getLibSBMLDependencyVersionOf(java.lang.String option)
option
- the library for which the version
should be retrieved, this can be one of
'expat', 'libxml', 'xerces-c', 'bzip2', 'zip'
libsbml.isLibSBMLCompiledWith(String option)
public static java.lang.String OperationReturnValue_toString(int returnValue)
returnValue
- the operation return value to convert to a string.
public static SBMLDocument readSBML(java.lang.String filename)
Reads an SBML document from the given file.
If the file named filename
does not exist or its content is not valid
SBML, one or more errors will be logged with the SBMLDocument
object
returned by this method. Callers can use the methods on SBMLDocument
such
as
,
SBMLDocument.getNumErrors()
and
to get the errors. The object returned by
is an SBMLError
object, and it has methods to get the error code,
category, and severity level of the problem, as well as a textual
description of the problem. The possible severity levels range from
informational messages to fatal errors see the documentation for
SBMLError
for more information.
If the file filename
could not be read, the file-reading error will
appear first. The error code can provide a clue about what
happened. For example, a file might be unreadable (either because it does
not actually exist or because the user does not have the necessary access
privileges to read it) or some sort of file operation error may have been
reported by the underlying operating system. Callers can check for these
situations using a program fragment such as the following:
SBMLReader
reader = newSBMLReader
()SBMLDocument
doc = reader.readSBMLFromFile(filename) if (doc.getNumErrors() > 0) { if (doc.getError(0).getErrorId() == libsbmlConstants.XMLFileUnreadable) { // Handle case of unreadable file here. } else if (doc.getError(0).getErrorId() == libsbmlConstants.XMLFileOperationError) { // Handle case of other file operation error here. } else { // Handle other error cases. } }
If the given filename ends with the suffix '.gz'
(for example,
'myfile.xml.gz'
), the file is assumed to be compressed in gzip
format and will be automatically decompressed upon reading.
Similarly, if the given filename ends with '.zip'
or '.bz2'
, the
file is assumed to be compressed in zip or bzip2 format
(respectively). Files whose names lack these suffixes will be read
uncompressed. Note that if the file is in zip format but the
archive contains more than one file, only the first file in the
archive will be read and the rest ignored.
To read a gzip/zip file, libSBML needs to be configured and linked with the zlib library at compile time. It also needs to be linked with the bzip2 library to read files in bzip2 format. (Both of these are the default configurations for libSBML.) Errors about unreadable files will be logged if a compressed filename is given and libSBML was not linked with the corresponding required library.
public static SBMLDocument readSBMLFromFile(java.lang.String filename)
Reads an SBML document from the given file.
If the file named filename
does not exist or its content is not valid
SBML, one or more errors will be logged with the SBMLDocument
object
returned by this method. Callers can use the methods on SBMLDocument
such
as
,
SBMLDocument.getNumErrors()
and
to get the errors. The object returned by
is an SBMLError
object, and it has methods to get the error code,
category, and severity level of the problem, as well as a textual
description of the problem. The possible severity levels range from
informational messages to fatal errors see the documentation for
SBMLError
for more information.
If the file filename
could not be read, the file-reading error will
appear first. The error code can provide a clue about what
happened. For example, a file might be unreadable (either because it does
not actually exist or because the user does not have the necessary access
privileges to read it) or some sort of file operation error may have been
reported by the underlying operating system. Callers can check for these
situations using a program fragment such as the following:
SBMLReader
reader = newSBMLReader
()SBMLDocument
doc = reader.readSBMLFromFile(filename) if (doc.getNumErrors() > 0) { if (doc.getError(0).getErrorId() == libsbmlConstants.XMLFileUnreadable) { // Handle case of unreadable file here. } else if (doc.getError(0).getErrorId() == libsbmlConstants.XMLFileOperationError) { // Handle case of other file operation error here. } else { // Handle other error cases. } }
If the given filename ends with the suffix '.gz'
(for example,
'myfile.xml.gz'
), the file is assumed to be compressed in gzip
format and will be automatically decompressed upon reading.
Similarly, if the given filename ends with '.zip'
or '.bz2'
, the
file is assumed to be compressed in zip or bzip2 format
(respectively). Files whose names lack these suffixes will be read
uncompressed. Note that if the file is in zip format but the
archive contains more than one file, only the first file in the
archive will be read and the rest ignored.
To read a gzip/zip file, libSBML needs to be configured and linked with the zlib library at compile time. It also needs to be linked with the bzip2 library to read files in bzip2 format. (Both of these are the default configurations for libSBML.) Errors about unreadable files will be logged if a compressed filename is given and libSBML was not linked with the corresponding required library.
filename
- the name or full pathname of the file to be read.
SBMLDocument
structure created from the SBML
content in filename
.public static SBMLDocument readSBMLFromString(java.lang.String xml)
Reads an SBML document from a text string.
This method is flexible with respect to the presence of an XML
declaration at the beginning of the string. In particular, if the
string in xml
does not begin with the XML declaration
<?xml version='1.0' encoding='UTF-8'?>then this method will automatically prepend the declaration to
xml
.
This method will log a fatal error if the content given in the parameter
xml
is not in SBML format. See the method documentation for
SBMLReader#readSBML()
for an example of code for testing the returned error code.
xml
- a string containing a full SBML model.
SBMLDocument
structure created from the SBML
content in xml
.
SBMLDocument
that uses the SBML
Level 3 Hierarchical Model Composition package (comp) the document
location cannot be set automatically. Thus, if the model contains
references to ExternalModelDefinition
objects, it will be necessary to
manually set the document URI location
(SBMLDocument#setLocationURI()
) in order to facilitate resolving these models.
public static int writeSBML(SBMLDocument d, java.lang.String filename)
d
to the file named by filename
.
This convenience function is functionally equivalent to:
SBMLWriter_writeSBML(SBMLWriter_create(), d, 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
(true) on success and 0
(false) 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 java.lang.String writeSBMLToString(SBMLDocument d)
d
to an in-memory string and returns a
pointer to it. The string is owned by the caller and should be freed
(with free()) when no longer needed. This convenience function is
functionally equivalent to:
SBMLWriter_writeSBMLToString(SBMLWriter_create(), d)
but 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.public static int writeSBMLToFile(SBMLDocument d, java.lang.String filename)
d
to the file filename
.
This convenience function is functionally equivalent to:
SBMLWriter_writeSBMLToFile(SBMLWriter_create(), d, filename)
but that 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
(true) on success and 0
(false) 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 java.lang.String SBMLTypeCode_toString(int tc, java.lang.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 0
(false)
(because each of the above is a distinct enumeration value), but
this function returns true.
uk1
- a UNIT_KIND_
value.uk2
- a second UNIT_KIND_
value to compare to uk1
.
1
(true) if uk1
is logically equivalent to
uk2
, 0
(false) otherwise.
Unit
.public static int UnitKind_forName(java.lang.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 java.lang.String UnitKind_toString(int uk)
uk
- a value from the set of UNIT_KIND_
codes
defined in the class libsbmlConstants
Unit
.
public static int UnitKind_isValidUnitKindString(java.lang.String str, long level, long version)
str
- a text string naming a base unit defined by SBML.level
- the Level of SBML.version
- the Version within the Level of SBML.
UNIT_KIND_
value, 0
(false) otherwise.
Unit
.public static java.lang.String ModelQualifierType_toString(int type)
This method takes a model qualifier type as argument
and returns a string name corresponding to that code. For example,
passing it the qualifier BQM_IS_DESCRIBED_BY
will return
the string 'isDescribedBy'
.
type
- the value to
translate. The value should be a libSBML constant whose
name begins with BQM_
, such as (for example)
BQM_IS
.
public static java.lang.String BiolQualifierType_toString(int type)
This method takes a biol qualifier type as argument
and returns a string name corresponding to that code. For example,
passing it the qualifier BQB_HAS_VERSION
will return
the string 'hasVersion'
.
type
- the value to
translate. The value should be a constant whose name
begins with BQB_
, such as (for example)
BQB_IS
.
public static int ModelQualifierType_fromString(java.lang.String s)
This method takes a string as argument and returns a model qualifier type
corresponding to that string. For example, passing it the string
'isDescribedBy'
will return the qualifier
BQM_IS_DESCRIBED_BY
.
s
- the string to translate to a libSBML constant value representing a model qualifier.
public static int BiolQualifierType_fromString(java.lang.String s)
This method takes a string as argument and returns a biol qualifier type
corresponding to that string. For example, passing it the string
'hasVersion'
will return the qualifier
BQB_HAS_VERSION
.
s
- the string to translate to a libSBML constant value representing a biological qualifier.
public static ASTNode readMathMLFromString(java.lang.String xml)
xml
- a string containing a full MathML expression.
null
is returned if the given string is null
or invalid.public static ASTNode readMathMLFromStringWithNamespaces(java.lang.String xml, XMLNamespaces xmlns)
xml
- a string containing a full MathML expression.xmlns
- an XMLNamespaces
object containing namespaces that are considered active during the
read. (For example, an SBML Level 3 package namespace.)
null
is returned if the given string is null
or invalid.public static java.lang.String writeMathMLToString(ASTNode node)
node
- the root of an AST to write out to the stream.
null
is returned if the given
argument is null.
public static java.lang.String writeMathMLWithNamespaceToString(ASTNode node, SBMLNamespaces sbmlns)
node
- the root of an AST to write out to the stream.sbmlns
- the SBML namespace to be usednull
is returned if the given
argument is null.
public static ASTNode parseFormula(java.lang.String formula)
The text-string form of mathematical formulas produced by
libsbml.formulaToString(ASTNode)
and read by
libsbml.parseFormula(String)
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
. The
following are illustrative examples of formulas expressed using this syntax:
0.10 * k4^2
(vm * s1)/(km + s1)
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 | 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.
formula
, or
null
if an error occurred in parsing the formula
libsbml.parseL3Formula(String)
,
libsbml.formulaToString(ASTNode)
,
libsbml.formulaToL3String(ASTNode)
,
libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)
,
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
,
libsbml.parseL3FormulaWithModel(String, Model)
,
L3ParserSettings
libsbml.parseL3Formula(String)
and
libsbml.formulaToL3String(ASTNode)
. The Level 1-oriented
system (i.e., what is provided by libsbml.formulaToString(String)
and libsbml.parseFormula(ASTNode)
) is provided
untouched for backwards compatibility.
, We urge developers to keep in mind that the text-string formula syntax is specific to libSBML. Neither MathML nor SBML define a text-string format for mathematical formulas. LibSBML's particular syntax should not be considered to be a canonical or standard general-purpose mathematical expression syntax. LibSBML provides methods for parsing and transforming text-string math formulas back and forth from AST structures for the convenience of calling applications, but it is important to keep the system's limitations in mind.
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 java.lang.String formulaToL3String(ASTNode tree)
The text-string form of mathematical formulas read by the function
libsbml.parseL3Formula(String)
and written by the function
libsbml.formulaToL3String(ASTNode)
uses an expanded version of
the syntax read and written by libsbml.parseFormula(String)
and libsbml.formulaToString(ASTNode)
, 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 for
libSBML users, the original libsbml.formulaToString(ASTNode)
and libsbml.parseFormula(String)
have been left untouched,
and instead, the new functionality is provided in the form of
libsbml.parseL3Formula(String)
and
libsbml.formulaToL3String(ASTNode)
.
The following lists the main differences in the formula syntax supported by
the Level 3 ('L3') versions of the formula parsers and formatters,
compared to what is supported by the Level 1-oriented
libsbml.parseFormula(String)
and
libsbml.formulaToString(ASTNode)
:
SId
in the SBML specifications). The whitespace between
number
and unit
is optional.
&&
(and), ||
(or), !
(not),
and !=
(not equals) may be used.
@%
and will
produce a <piecewise>
function in the corresponding
MathML output by default, or can produce the MathML function rem
,
depending on the L3ParserSettings
object (see
L3ParserSettings_setParseModuloL3v2() ).
arc
as a prefix or simply a
in other words, both arccsc
and acsc
are interpreted as the operator arccosecant as defined in
MathML 2.0. (Many functions in the simpler SBML Level 1
oriented parser implemented by libsbml.parseFormula(String)
are defined this way as well, but not all.)
(integer/integer)Spaces are not allowed in this construct in other words, "
(3 / 4)
" (with whitespace between the numbers and
the operator) will be parsed into the MathML <divide>
construct rather than a rational number. You can, however, assign units to a
rational number as a whole here is an example: "(3/4) ml
".
(In the case of division rather than a rational number, units are not interpreted
in this way.)
L3ParserSettings
object in conjunction with the functions
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
and
libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)
The settings available include 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.
a @% b
will either
become
piecewise(a - b*ceil(a/b), xor((a < 0), (b < 0)), a - b*floor(a/b))
or
rem(a, b)
.
The latter is simpler, but the rem
MathML is only allowed
as of SBML Level 3 Version 2.
Model
object may optionally be
provided to the parser using the variant function call
libsbml.parseL3FormulaWithModel(String, Model)
or
stored in a L3ParserSettings
object passed to the variant function
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
. When a Model
object is provided, identifiers
(values of type SId
) from that model are used in preference to
pre-defined MathML definitions for both symbols and functions.
More precisely:
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
object with the identifier
"sin
", that function will be used instead of the
predefined MathML function <sin/>
.
SBMLNamespaces
object may optionally
be provided to identify SBML Level 3 packages that extend the
syntax understood by the formula parser. When the namespaces are provided,
the parser will interpret possible additional syntax defined by the libSBML
plug-ins implementing the SBML Level 3 packages for example, it may
understand vector/array extensions introduced by the SBML Level 3
Arrays package.
These configuration settings cannot be changed directly using the basic
parser and formatter functions, but can be changed on a per-call basis
by using the alternative functions libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
and
libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)
.
Neither SBML nor the MathML standard define a 'string-form' equivalent to MathML expressions. The approach taken by libSBML is to start with the formula syntax defined by SBML Level 1 (which in fact used a custom text-string representation of formulas, and not MathML), and expand it to include the functionality described above. 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 | Preced. | Assoc. |
---|---|---|---|---|
name | symbol reference | operand | 8 | n/a |
( expression) | expression grouping | operand | 8 | n/a |
f( ...) | function call | prefix | 8 | left |
^ | power | binary | 7 | left |
-, ! | negation, Boolean 'not' | unary | 6 | right |
*, /, % | multip., div., modulo | binary | 5 | left |
+, - | addition and subtraction | binary | 4 | left |
==, <, >, <=, >=, != | Boolean comparisons | 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. | &ndash1.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. | &ndash1.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&ndash1)* ... * 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 &ndash y. | ||
divide |
x, y | x / y. |
Parsing of the various MathML functions and constants are all
case-insensitive by default: function names such as cos
,
Cos
and COS
are all parsed as the MathML cosine
operator, <cos>
. However, when a Model
object is
used in conjunction with either
libsbml.parseL3FormulaWithModel(String, Model)
or
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
, any identifiers found in that model will be
parsed in a case-sensitive way. For example, if a model contains
a Species
having the identifier Pi
, the parser will parse
"Pi
" in the input as "<ci> Pi
</ci>
" but will continue to parse the symbols
"pi
" and "PI
" as
"<pi>
".
As mentioned above, the manner in which the 'L3' versions of the formula
parser and formatter interpret the function "log
"
can be changed. To do so, callers should use the function
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
and pass it an appropriate L3ParserSettings
object. By default, unlike the SBML Level 1 parser implemented by
libsbml.parseFormula(String)
, 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, L3ParserSettings)
.
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 |
Boolean value true |
<true/> |
false |
Boolean value false |
<false/> |
pi |
Mathematical constant pi | <pi/> |
avogadro |
Value of Avogadro's constant stipulated by SBML | <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 , infinity |
Mathematical constant "infinity" | <infinity/> |
nan , notanumber |
Mathematical concept "not a number" | <notanumber/> |
Again, as mentioned above, whether the string
"avogadro
" is parsed as an AST node of type
AST_NAME_AVOGADRO
or
AST_NAME
is configurable use the version of
the parser function called libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
. This Avogadro-related
functionality is provided because SBML Level 2 models may not use
AST_NAME_AVOGADRO
AST nodes.
tree
- the AST to be converted.
tree
is a null pointer, then a null pointer is
returned.
libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)
,
libsbml.formulaToString(ASTNode)
,
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
,
libsbml.parseL3FormulaWithModel(String, Model)
,
libsbml.parseFormula(String)
,
L3ParserSettings
,
libsbml.getDefaultL3ParserSettings()
,
libsbml.getLastParseL3Error()
public static java.lang.String formulaToL3StringWithSettings(ASTNode tree, L3ParserSettings settings)
This function behaves identically to libsbml.formulaToL3String(ASTNode)
but its behavior is controlled by two fields in the
settings
object, namely:
settings
object is set to true
(the default), the function will
write out the units of any numerical ASTNodes that have them,
producing (for example) "3 mL
",
"(3/4) m
", or "5.5e-10
M
". If this is set to false
, this function
will only write out the number itself ("3
",
"(3/4)
", and "5.5e-10
",
in the previous examples).
settings
object is set to false
(the default), the
function will write out explicitly any doubly-nested unary minus
ASTNodes, producing (for example) "- -x
" or
even "- - - - -3.1
". If this is set to
true
, the function will collapse the nodes before
producing the infix form, producing "x
" and
"-3.1
" in the previous examples.
All the other settings of the L3ParserSettings
object passed in as
settings
will be ignored for the purposes of this function: the
parselog ('parse log') setting is ignored so that
"log10(x)
", "ln(x)
", and
"log(x, y)
" are always produced the
avocsymbol ('Avogadro csymbol') is irrelevant to the behavior
of this function and nothing in the Model
object set via the
model setting is used.
tree
- the AST to be converted.
settings
- the L3ParserSettings
object used to modify the behavior of
this function.
tree
is a null pointer, then a null pointer is
returned.
libsbml.formulaToL3String(ASTNode)
,
libsbml.formulaToString(ASTNode)
,
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
,
libsbml.parseL3FormulaWithModel(String, Model)
,
libsbml.parseFormula(String)
,
L3ParserSettings
,
libsbml.getDefaultL3ParserSettings()
,
libsbml.getLastParseL3Error()
public static java.lang.String formulaToString(ASTNode tree)
The text-string form of mathematical formulas produced by
libsbml.formulaToString(ASTNode)
and read by
libsbml.parseFormula(String)
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
. The
following are illustrative examples of formulas expressed using this syntax:
0.10 * k4^2
(vm * s1)/(km + s1)
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 | 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.formulaToL3String(ASTNode)
,
libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)
,
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
,
libsbml.parseL3FormulaWithModel(String, Model)
,
libsbml.parseFormula(String)
libsbml.parseL3Formula(String)
and
libsbml.formulaToL3String(ASTNode)
. The Level 1-oriented
system (i.e., what is provided by libsbml.formulaToString(String)
and libsbml.parseFormula(ASTNode)
) is provided
untouched for backwards compatibility.
, We urge developers to keep in mind that the text-string formula syntax is specific to libSBML. Neither MathML nor SBML define a text-string format for mathematical formulas. LibSBML's particular syntax should not be considered to be a canonical or standard general-purpose mathematical expression syntax. LibSBML provides methods for parsing and transforming text-string math formulas back and forth from AST structures for the convenience of calling applications, but it is important to keep the system's limitations in mind.
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(java.lang.String formula)
The text-string form of mathematical formulas read by the function
libsbml.parseL3Formula(String)
and written by the function
libsbml.formulaToL3String(ASTNode)
uses an expanded version of
the syntax read and written by libsbml.parseFormula(String)
and libsbml.formulaToString(ASTNode)
, 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 for
libSBML users, the original libsbml.formulaToString(ASTNode)
and libsbml.parseFormula(String)
have been left untouched,
and instead, the new functionality is provided in the form of
libsbml.parseL3Formula(String)
and
libsbml.formulaToL3String(ASTNode)
.
The following lists the main differences in the formula syntax supported by
the Level 3 ('L3') versions of the formula parsers and formatters,
compared to what is supported by the Level 1-oriented
libsbml.parseFormula(String)
and
libsbml.formulaToString(ASTNode)
:
SId
in the SBML specifications). The whitespace between
number
and unit
is optional.
&&
(and), ||
(or), !
(not),
and !=
(not equals) may be used.
@%
and will
produce a <piecewise>
function in the corresponding
MathML output by default, or can produce the MathML function rem
,
depending on the L3ParserSettings
object (see
L3ParserSettings_setParseModuloL3v2() ).
arc
as a prefix or simply a
in other words, both arccsc
and acsc
are interpreted as the operator arccosecant as defined in
MathML 2.0. (Many functions in the simpler SBML Level 1
oriented parser implemented by libsbml.parseFormula(String)
are defined this way as well, but not all.)
(integer/integer)Spaces are not allowed in this construct in other words, "
(3 / 4)
" (with whitespace between the numbers and
the operator) will be parsed into the MathML <divide>
construct rather than a rational number. You can, however, assign units to a
rational number as a whole here is an example: "(3/4) ml
".
(In the case of division rather than a rational number, units are not interpreted
in this way.)
L3ParserSettings
object in conjunction with the functions
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
and
libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)
The settings available include 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.
a @% b
will either
become
piecewise(a - b*ceil(a/b), xor((a < 0), (b < 0)), a - b*floor(a/b))
or
rem(a, b)
.
The latter is simpler, but the rem
MathML is only allowed
as of SBML Level 3 Version 2.
Model
object may optionally be
provided to the parser using the variant function call
libsbml.parseL3FormulaWithModel(String, Model)
or
stored in a L3ParserSettings
object passed to the variant function
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
. When a Model
object is provided, identifiers
(values of type SId
) from that model are used in preference to
pre-defined MathML definitions for both symbols and functions.
More precisely:
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
object with the identifier
"sin
", that function will be used instead of the
predefined MathML function <sin/>
.
SBMLNamespaces
object may optionally
be provided to identify SBML Level 3 packages that extend the
syntax understood by the formula parser. When the namespaces are provided,
the parser will interpret possible additional syntax defined by the libSBML
plug-ins implementing the SBML Level 3 packages for example, it may
understand vector/array extensions introduced by the SBML Level 3
Arrays package.
These configuration settings cannot be changed directly using the basic
parser and formatter functions, but can be changed on a per-call basis
by using the alternative functions libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
and
libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)
.
Neither SBML nor the MathML standard define a 'string-form' equivalent to MathML expressions. The approach taken by libSBML is to start with the formula syntax defined by SBML Level 1 (which in fact used a custom text-string representation of formulas, and not MathML), and expand it to include the functionality described above. 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 | Preced. | Assoc. |
---|---|---|---|---|
name | symbol reference | operand | 8 | n/a |
( expression) | expression grouping | operand | 8 | n/a |
f( ...) | function call | prefix | 8 | left |
^ | power | binary | 7 | left |
-, ! | negation, Boolean 'not' | unary | 6 | right |
*, /, % | multip., div., modulo | binary | 5 | left |
+, - | addition and subtraction | binary | 4 | left |
==, <, >, <=, >=, != | Boolean comparisons | 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. | &ndash1.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. | &ndash1.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&ndash1)* ... * 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 &ndash y. | ||
divide |
x, y | x / y. |
Parsing of the various MathML functions and constants are all
case-insensitive by default: function names such as cos
,
Cos
and COS
are all parsed as the MathML cosine
operator, <cos>
. However, when a Model
object is
used in conjunction with either
libsbml.parseL3FormulaWithModel(String, Model)
or
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
, any identifiers found in that model will be
parsed in a case-sensitive way. For example, if a model contains
a Species
having the identifier Pi
, the parser will parse
"Pi
" in the input as "<ci> Pi
</ci>
" but will continue to parse the symbols
"pi
" and "PI
" as
"<pi>
".
As mentioned above, the manner in which the 'L3' versions of the formula
parser and formatter interpret the function "log
"
can be changed. To do so, callers should use the function
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
and pass it an appropriate L3ParserSettings
object. By default, unlike the SBML Level 1 parser implemented by
libsbml.parseFormula(String)
, 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, L3ParserSettings)
.
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 |
Boolean value true |
<true/> |
false |
Boolean value false |
<false/> |
pi |
Mathematical constant pi | <pi/> |
avogadro |
Value of Avogadro's constant stipulated by SBML | <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 , infinity |
Mathematical constant "infinity" | <infinity/> |
nan , notanumber |
Mathematical concept "not a number" | <notanumber/> |
Again, as mentioned above, whether the string
"avogadro
" is parsed as an AST node of type
AST_NAME_AVOGADRO
or
AST_NAME
is configurable use the version of
the parser function called libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
. This Avogadro-related
functionality is provided because SBML Level 2 models may not use
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.parseL3FormulaWithSettings(String, L3ParserSettings)
,
libsbml.parseL3FormulaWithModel(String, Model)
,
libsbml.parseFormula(String)
,
libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)
,
libsbml.formulaToL3String(ASTNode)
,
libsbml.formulaToString(ASTNode)
,
L3ParserSettings
,
libsbml.getDefaultL3ParserSettings()
,
libsbml.getLastParseL3Error()
public static ASTNode parseL3FormulaWithModel(java.lang.String formula, Model model)
Model
to resolve
symbols, and returns an AST representation of the result.
This is identical to libsbml.parseL3Formula(String)
, except
that this function uses the given model in the argument model
to check
against identifiers that appear in the formula
. For more information
about the parser, please see the definition of L3ParserSettings
and
the function libsbml.parseL3Formula(String)
.
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.parseL3Formula(String)
,
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
,
libsbml.parseL3FormulaWithModel(String, Model)
,
libsbml.parseFormula(String)
,
libsbml.getLastParseL3Error()
,
L3ParserSettings
public static ASTNode parseL3FormulaWithSettings(java.lang.String formula, L3ParserSettings settings)
This is identical to libsbml.parseL3Formula(String)
, except
that this function uses the parser settings given in the argument
settings
. The settings override the default parsing behavior. The
following parsing behaviors can be configured:
Model
object may optionally be provided to use identifiers (values
of type SId
) from the model in preference to pre-defined MathML symbols
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 by the parser will
contain the construct <ci> pi </ci>
instead of
the construct <pi/>
. Another 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/>
.
log
with a single argument
("log(x)
") can be parsed as log10(x)
,
ln(x)
, or treated as an error, as desired.
- -3
") from the input and incorporate single unary
minuses into the number node, or (2) preserve all minuses in the AST node
structure, turning them into ASTNode
objects of type
AST_MINUS
.
number id
" can be
interpreted as a numerical value number
followed by units of measurement
indicated by id
, or it can be treated as a syntax error. (In
Level 3, MathML <cn>
elements can have an
attribute named units
placed in the SBML namespace, which can be used
to indicate the units to be associated with the number. The text-string
infix formula parser allows units to be placed after raw numbers they are
interpreted as unit identifiers for units defined by the SBML
specification or in the containing Model
object.)
avogadro
can be parsed either as a MathML csymbol or
as a identifier. More specifically, "avogadro
" can
be treated as an ASTNode
of type
AST_NAME_AVOGADRO
or of type
AST_NAME
.
For more details about the parser, please see the definition of
L3ParserSettings
and libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
.
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.parseL3Formula(String)
,
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
,
libsbml.parseL3FormulaWithModel(String, Model)
,
libsbml.parseFormula(String)
,
libsbml.getLastParseL3Error()
,
L3ParserSettings
public static L3ParserSettings getDefaultL3ParserSettings()
The data structure storing the settings allows callers to change the following parsing behaviors:
The text-string form of mathematical formulas read by the function
libsbml.parseL3Formula(String)
and written by the function
libsbml.formulaToL3String(ASTNode)
uses an expanded version of
the syntax read and written by libsbml.parseFormula(String)
and libsbml.formulaToString(ASTNode)
, 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 for
libSBML users, the original libsbml.formulaToString(ASTNode)
and libsbml.parseFormula(String)
have been left untouched,
and instead, the new functionality is provided in the form of
libsbml.parseL3Formula(String)
and
libsbml.formulaToL3String(ASTNode)
.
The following lists the main differences in the formula syntax supported by
the Level 3 ('L3') versions of the formula parsers and formatters,
compared to what is supported by the Level 1-oriented
libsbml.parseFormula(String)
and
libsbml.formulaToString(ASTNode)
:
SId
in the SBML specifications). The whitespace between
number
and unit
is optional.
&&
(and), ||
(or), !
(not),
and !=
(not equals) may be used.
@%
and will
produce a <piecewise>
function in the corresponding
MathML output by default, or can produce the MathML function rem
,
depending on the L3ParserSettings
object (see
L3ParserSettings_setParseModuloL3v2() ).
arc
as a prefix or simply a
in other words, both arccsc
and acsc
are interpreted as the operator arccosecant as defined in
MathML 2.0. (Many functions in the simpler SBML Level 1
oriented parser implemented by libsbml.parseFormula(String)
are defined this way as well, but not all.)
(integer/integer)Spaces are not allowed in this construct in other words, "
(3 / 4)
" (with whitespace between the numbers and
the operator) will be parsed into the MathML <divide>
construct rather than a rational number. You can, however, assign units to a
rational number as a whole here is an example: "(3/4) ml
".
(In the case of division rather than a rational number, units are not interpreted
in this way.)
L3ParserSettings
object in conjunction with the functions
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
and
libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)
The settings available include 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.
a @% b
will either
become
piecewise(a - b*ceil(a/b), xor((a < 0), (b < 0)), a - b*floor(a/b))
or
rem(a, b)
.
The latter is simpler, but the rem
MathML is only allowed
as of SBML Level 3 Version 2.
Model
object may optionally be
provided to the parser using the variant function call
libsbml.parseL3FormulaWithModel(String, Model)
or
stored in a L3ParserSettings
object passed to the variant function
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
. When a Model
object is provided, identifiers
(values of type SId
) from that model are used in preference to
pre-defined MathML definitions for both symbols and functions.
More precisely:
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
object with the identifier
"sin
", that function will be used instead of the
predefined MathML function <sin/>
.
SBMLNamespaces
object may optionally
be provided to identify SBML Level 3 packages that extend the
syntax understood by the formula parser. When the namespaces are provided,
the parser will interpret possible additional syntax defined by the libSBML
plug-ins implementing the SBML Level 3 packages for example, it may
understand vector/array extensions introduced by the SBML Level 3
Arrays package.
These configuration settings cannot be changed directly using the basic
parser and formatter functions, but can be changed on a per-call basis
by using the alternative functions libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
and
libsbml.formulaToL3StringWithSettings(ASTNode, L3ParserSettings)
.
Neither SBML nor the MathML standard define a 'string-form' equivalent to MathML expressions. The approach taken by libSBML is to start with the formula syntax defined by SBML Level 1 (which in fact used a custom text-string representation of formulas, and not MathML), and expand it to include the functionality described above. 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 | Preced. | Assoc. |
---|---|---|---|---|
name | symbol reference | operand | 8 | n/a |
( expression) | expression grouping | operand | 8 | n/a |
f( ...) | function call | prefix | 8 | left |
^ | power | binary | 7 | left |
-, ! | negation, Boolean 'not' | unary | 6 | right |
*, /, % | multip., div., modulo | binary | 5 | left |
+, - | addition and subtraction | binary | 4 | left |
==, <, >, <=, >=, != | Boolean comparisons | 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. | &ndash1.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. | &ndash1.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&ndash1)* ... * 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 &ndash y. | ||
divide |
x, y | x / y. |
Parsing of the various MathML functions and constants are all
case-insensitive by default: function names such as cos
,
Cos
and COS
are all parsed as the MathML cosine
operator, <cos>
. However, when a Model
object is
used in conjunction with either
libsbml.parseL3FormulaWithModel(String, Model)
or
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
, any identifiers found in that model will be
parsed in a case-sensitive way. For example, if a model contains
a Species
having the identifier Pi
, the parser will parse
"Pi
" in the input as "<ci> Pi
</ci>
" but will continue to parse the symbols
"pi
" and "PI
" as
"<pi>
".
As mentioned above, the manner in which the 'L3' versions of the formula
parser and formatter interpret the function "log
"
can be changed. To do so, callers should use the function
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
and pass it an appropriate L3ParserSettings
object. By default, unlike the SBML Level 1 parser implemented by
libsbml.parseFormula(String)
, 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, L3ParserSettings)
.
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 |
Boolean value true |
<true/> |
false |
Boolean value false |
<false/> |
pi |
Mathematical constant pi | <pi/> |
avogadro |
Value of Avogadro's constant stipulated by SBML | <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 , infinity |
Mathematical constant "infinity" | <infinity/> |
nan , notanumber |
Mathematical concept "not a number" | <notanumber/> |
Again, as mentioned above, whether the string
"avogadro
" is parsed as an AST node of type
AST_NAME_AVOGADRO
or
AST_NAME
is configurable use the version of
the parser function called libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
. This Avogadro-related
functionality is provided because SBML Level 2 models may not use
AST_NAME_AVOGADRO
AST nodes.
For more details about the parser, please see the definition of
L3ParserSettings
and libsbml.parseL3Formula(String)
.
public static java.lang.String getLastParseL3Error()
If the functions libsbml.parseL3Formula(String)
,
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
, or libsbml.parseL3FormulaWithModel(String, Model)
return null
, an error is set internally.
This function allows callers to retrieve information about the error.
libsbml.parseL3Formula(String)
,
libsbml.parseL3FormulaWithSettings(String, L3ParserSettings)
,
libsbml.parseL3FormulaWithModel(String, Model)
,
libsbml.getDefaultL3ParserSettings()
public static java.lang.String GroupKind_toString(int gk)
gk
- the enumeration value to convert.
null
if the value is GROUP_KIND_UNKNOWN
or
another invalid enumeration value.
The string returned by this function is a pointer to a string literal defined in the libsbml library, and may not be modified or deleted.
public static int GroupKind_fromString(java.lang.String code)
GROUP_KIND_UNKNOWN
if there is no such match.
code
- the string to convert to an enumeration value.
GROUP_KIND_UNKNOWN
if no match is found.
GROUP_KIND_CLASSIFICATION
, but 'Classification'
will return GROUP_KIND_UNKNOWN
.public static int GroupKind_isValid(int gk)
1
(true) or 0
(false) depending on whether the
given enumeration value is valid.
gk
- the enumeration value to query.
1
(true) if the value is
GROUP_KIND_CLASSIFICATION
,
GROUP_KIND_PARTONOMY
, or
GROUP_KIND_COLLECTION
0
(false) otherwise (including GROUP_KIND_UNKNOWN
).public static int GroupKind_isValidString(java.lang.String code)
1
(true) or 0
(false) depending on whether the
given string is a valid enumeration value.
code
- the string to query.
1
(true) if the string is
'classification',
'partonomy', or
'collection'
0
(false) otherwise.
1
(true), but 'Classification' will return 0
(false).public static void parseLayoutAnnotation(XMLNode annotation, ListOfLayouts layouts)
public static XMLNode deleteLayoutAnnotation(XMLNode pAnnotation)
XMLNode
and tries to find the layout annotation node and deletes it if it was found.public static XMLNode parseLayouts(Model pModel)
public static void parseSpeciesReferenceAnnotation(XMLNode annotation, SimpleSpeciesReference sr)
public static XMLNode deleteLayoutIdAnnotation(XMLNode pAnnotation)
XMLNode
and tries to find the layoutId annotation node and deletes it if it was found.public static XMLNode parseLayoutId(SimpleSpeciesReference sr)
XMLNode
that represents the layoutId annotation of the species reference from the given SpeciesReference
object.public static int FillRule_fromString(java.lang.String name)
public static java.lang.String FillRule_toString(int rule)
public static int SpreadMethod_fromString(java.lang.String name)
public static java.lang.String SpreadMethod_toString(int method)
public static int TextAnchor_fromString(java.lang.String str)
public static java.lang.String TextAnchor_toString(int anchor)
public static int FontWeight_fromString(java.lang.String str)
public static java.lang.String FontWeight_toString(int weight)
public static int FontStyle_fromString(java.lang.String str)
public static java.lang.String FontStyle_toString(int style)