1.3. Data representation formats in CellML¶
The following data representation formats are defined for use in this specification:
A CellML identifier:
- SHALL be a sequence of Unicode characters.
- SHALL NOT contain any characters except Basic Latin alphanumeric characters and Basic Latin underscores.
- SHALL contain at least one alphabetic character.
- SHALL NOT begin with a numeral or an underscore.
- SHALL, when comparing two identifiers, be considered identical to another identifier if and only if both identifiers have identical sequences of characters.
Names and identifiers need to be a single word, and without any special characters other than an underscore. For example, these are allowed:
myName,my_name,myName1,
… but these are not permitted:
my Namehas a space,myName!contains a special character, and1myNamestarts with a numerical character.
Note that CellML identifiers are case-sensitive, and empty strings are not allowed.
A non-negative integer string:
- SHALL be a base 10 representation of a non-negative integer.
- SHALL consist entirely of European numerals.
+ or minus - signs.An integer string:
- SHALL be a base 10 representation of an integer.
- SHALL, when the integer being represented is negative, begin with the Basic Latin hyphen-minus character U+002D as the sign indicator.
- SHALL, other than the sign indicator, consist only of European numerals.
-, but it must not begin with the plus sign, +.A basic real number string:
- SHALL be a base 10 representation of a real number.
- SHALL, when the basic real number being represented is negative, begin with the Basic Latin hyphen-minus character U+002D as the sign indicator.
- MAY contain a single decimal point separator, which SHALL be the Basic Latin full stop character U+002E.
- SHALL, other than the sign indicator and the decimal point separator, consist only of European numerals.
Note that the basic real number string is distinct from the real number string in that it does not include real numbers in scientific notation (also called scientific form, standard index form, or standard form).
For example:
"-123.4567"is a valid basic real number string,"-1.234567E03"is not (but it is a valid real number string),"+123.4567"is not valid (must not contain the plus sign+),"1234567"is valid (it’s ok to not use a decimal point.),"123,4567"is not valid (the decimal signifier must be a full-stop symbol.),"123,456.7"is not valid (you may not use a comma,or a space :code:` ` as a thousands separator),"12.34.56"is not valid (maximum of one decimal point.is permitted), and"0x123abc"is not valid (base 10 numbers only).
A real number string:
- SHALL be a base 10 representation of a real number \(r=s \times 10^e\) where \(s\) is the significand, a real number, and \(e\) is the exponent, an integer.
- The representation of the number SHALL be the representation of the significand followed immediately by the representation of the exponent.
- The significand SHALL be represented as a basic real number string.
- An exponent SHALL be represented by an exponent separator character, followed by the integer string representation of the value of the exponent. Non-negative exponents MAY begin with the Basic Latin plus sign character U+002B as the sign indicator. The exponent separator character SHALL be either the Basic Latin “E” character U+0045 or the Basic Latin “e” character U+0065.
- A real number string without an exponent SHALL be a basic real number string.
Note that the real number string is distinct from the basic real number string in that it includes numbers in scientific notation (also called scientific form, standard index form, or standard form).
Where it does not contain an exponent term, the number is interpreted as if it was a basic real number string: the exponent term is effectively zero.
For example:
"1.234E03"is a valid real number string,"+1.234E03"is not valid (must not contain the plus sign+in the significand),"1.234E+03"is valid (a plus sign+sign is permitted in the exponent),"1.234E+3.0"is not valid (the exponent must be an integer),"1.234e3"is valid (either case of E or e is permitted),"123,45E03"is not valid (the decimal signifier must be a full-stop symbol.),"123.45"is valid, and is treated as if it were a basic real number string: the exponent term is effectivly zero,"123.45E"is not valid (if the exponent is present it may not be blank),"123,456.7e89"is not valid (you may not use a thousands separator), and"0x123abc"is not valid (base 10 numbers only).