-
Notifications
You must be signed in to change notification settings - Fork 5
/
apdx-validation.tex
186 lines (145 loc) · 8.62 KB
/
apdx-validation.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
% -*- TeX-master: "main"; fill-column: 72 -*-
\section{Validation of SBML documents}
\label{apdx-validation}
\subsection{Validation and consistency rules}
\label{validation-rules}
This section summarizes all the conditions that must (or in some cases,
at least \emph{should}) be true of an SBML Level~1 Version~1 model that
uses the \TestTSBXMLLibraryPackage. We use the same conventions as are
used in the SBML Level~1 Version~1 Core specification document. In
particular, there are different degrees of rule strictness. Formally,
the differences are expressed in the statement of a rule: either a rule
states that a condition \emph{must} be true, or a rule states that it
\emph{should} be true. Rules of the former kind are strict SBML
validation rules---a model encoded in SBML must conform to all of them
in order to be considered valid. Rules of the latter kind are
consistency rules. To help highlight these differences, we use the
following three symbols next to the rule numbers:
\begin{description}
\item[\hspace*{6.5pt}\vSymbol\vsp] A \vSymbolName indicates a
\emph{requirement} for SBML conformance. If a model does not follow this
rule, it does not conform to the \TestTSBXMLLibraryPackage
specification. (Mnemonic intention behind the choice of symbol: ``This
must be checked.'')
\item[\hspace*{6.5pt}\cSymbol\csp] A \cSymbolName indicates a
\emph{recommendation} for model consistency. If a model does not follow
this rule, it is not considered strictly invalid as far as the
\TestTSBXMLLibraryPackage specification is concerned; however, it
indicates that the model contains a physical or conceptual
inconsistency. (Mnemonic intention behind the choice of symbol: ``This
is a cause for warning.'')
\item[\hspace*{6.5pt}\mSymbol\msp] A \mSymbolName indicates a strong
recommendation for good modeling practice. This rule is not strictly a
matter of SBML encoding, but the recommendation comes from logical
reasoning. As in the previous case, if a model does not follow this
rule, it is not strictly considered an invalid SBML encoding. (Mnemonic
intention behind the choice of symbol: ``You're a star if you heed
this.'')
\end{description}
The validation rules listed in the following subsections are all stated
or implied in the rest of this specification document. They are
enumerated here for convenience. Unless explicitly stated, all
validation rules concern objects and attributes specifically defined in
the \TestTSBXMLLibraryPackage package.
For \notice convenience and brevity, we use the shorthand
``\token{:\-x}'' to stand for an attribute or element name \token{x} in
the namespace for the \TestTSBXMLLibraryPackage package, using the
namespace prefix \token{}. In reality, the prefix string may be
different from the literal ``\token{}'' used here (and indeed, it can be
any valid XML namespace prefix that the modeler or software chooses). We
use ``\token{:\-x}'' because it is shorter than to write a full
explanation everywhere we refer to an attribute or element in the
\TestTSBXMLLibraryPackage namespace.
\subsubsection*{General rules about this package}
\validRule{tsb-10101}{To conform to the \TestTSBXMLLibrary specification
for TSB Level~1 Version~1, an TSB document must declare
\uri{http://testsbxml.org/l1v1} as the XMLNamespace to use for elements
of this package. (Reference: TSB Level~1 Specification for Test TSB XML
Library, Version~1 \sec{xml-namespace}.)}
\validRule{tsb-10102}{Wherever they appear in a TSB document, elements
and attributes from the \TestTSBXMLLibrary must use the
\uri{http://testsbxml.org/l1v1} namespace, declaring so either
explicitly or implicitly. (Reference: TSB Level~1 Specification for Test
TSB XML Library, Version~1 \sec{xml-namespace}.)}
\subsubsection*{General rules about identifiers}
\validRule{tsb-10201}{The value of a \token{metaid} must conform to the
syntax of the XML Type ID (Reference: metaid)}
\subsubsection*{General rules for \TestAnnotation elements}
\validRule{tsb-10301}{Every top-level XML element within an
\TestAnnotation object must have an XML namespace declared. (Reference:
TSB Level~1 Specification for Test TSB XML Library, Version~1
\sec{annotation-use}.)}
\validRule{tsb-10302}{A given XML namespace cannot be the namespace of
more than one top-levelelement within a given \TestAnnotation object.
(Reference: TSB Level~1 Specification for Test TSB XML Library,
Version~1 \sec{annotation-use}.)}
\validRule{tsb-10303}{A given TSB element may contain at most one
\TestAnnotation subobject. (Reference: TSB Level~1 Specification for
Test TSB XML Library, Version~1 \sec{annotation-use}.)}
\subsubsection*{General rules for \notes elements}
\validRule{tsb-10401}{The contents of a \Notes object must be explicitly
placed in the XHTML XML namespace. (Reference: TSB Level~1 Specification
for Test TSB XML Library, Version~1 \sec{notes}.)}
\validRule{tsb-10402}{The contents of a \Notes object must not contain
an XML declaration, \ie a string of the form \val{<?xml version="1.0"
encoding="UTF-8"?>} or similar. (Reference: TSB Level~1 Specification
for Test TSB XML Library, Version~1 \sec{notes}.)}
\validRule{tsb-10403}{The content of a \Notes object must not contain an
XML DOCTYPE declaration, \ie a string beginning with the characters
\val{<!DOCTYPE}. (Reference: TSB Level~1 Specification for Test TSB XML
Library, Version~1 \sec{notes}.)}
\validRule{tsb-10404}{A given TSB element may contain at most one \Notes
subobject. (Reference: TSB Level~1 Specification for Test TSB XML
Library, Version~1 \sec{notes}.)}
\subsubsection*{Rules for \class{TSBDocument} object}
\validRule{tsb-20101}{A \TSBDocument object must have the required
attributes \token{tsb:\-level} and \token{tsb:\-version}, and may have
the optional attribute \token{tsb:\-metaid}. No other attributes from
the TSB Level~1 Version~1 namespaces are permitted on a \TSBDocument
object. (Reference: TSB Level~1 Specification for Test TSB XML Library,
Version~1, \sec{tsbdocument-class}.)}
\validRule{tsb-20102}{Apart from the general \Notes and \TestAnnotation
subobjects permitted on all TSB components, A \TSBDocument object may
contain one and only one instance of the \ListOfComments element. No
other objects from the TSB Level~1 Version~1 namespaces are permitted on
a \TSBDocument object. (Reference: TSB Level~1 Specification for Test
TSB XML Library, Version~1, \sec{tsbdocument-class}.)}
\validRule{tsb-20103}{The attribute \token{level} on a \TSBDocument must
have a value of data type \token{integer}, and must be non negative.
(Reference: TSB Level~1 Specification for Test TSB XML Library,
Version~1, \sec{tsbdocument-class}.)}
\validRule{tsb-20104}{The attribute \token{version} on a \TSBDocument
must have a value of data type \token{integer}, and must be non
negative. (Reference: TSB Level~1 Specification for Test TSB XML
Library, Version~1, \sec{tsbdocument-class}.)}
\subsubsection*{Rules for \class{ListOfComments} object}
\validRule{tsb-20201}{Apart from the general \notes and \TestAnnotation
subobjects permitted on all TSB objects, a \ListOfComments container
object may only contain \Comment objects. (Reference: TSB Level~1
Specification for Test TSB XML Library, Version~1,
\sec{listofcomments-class}.)}
\validRule{tsb-20202}{A \ListOfComments object may have the optional
attribute \token{metaid}. No other attributes from the TSB Level~1
Version~1 namespaces are permitted on a \ListOfComments object.
(Reference: TSB Level~1 Specification for Test TSB XML Library,
Version~1, \sec{listofcomments-class}.)}
\subsubsection*{Rules for \class{Comment} object}
\validRule{tsb-20301}{A \Comment object must have the required
attributes \token{tsb:\-contributor} and \token{tsb:\-number}, and may
have the optional attributes \token{tsb:\-point} and
\token{tsb:\-metaid}. No other attributes from the TSB Level~1 Version~1
namespaces are permitted on a \Comment object. (Reference: TSB Level~1
Specification for Test TSB XML Library, Version~1,
\sec{comment-class}.)}
\validRule{tsb-20302}{The attribute \token{contributor} on a \Comment
must have a value of data type \token{string}. (Reference: TSB Level~1
Specification for Test TSB XML Library, Version~1,
\sec{comment-class}.)}
\validRule{tsb-20303}{The attribute \token{number} on a \Comment must
have a value of data type \token{double}. (Reference: TSB Level~1
Specification for Test TSB XML Library, Version~1,
\sec{comment-class}.)}
\validRule{tsb-20304}{The attribute \token{point} on a \Comment must
have a value of data type \token{string}. (Reference: TSB Level~1
Specification for Test TSB XML Library, Version~1,
\sec{comment-class}.)}