libsbgnpy 0.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- libsbgnpy/__init__.py +16 -0
- libsbgnpy/examples/__init__.py +0 -0
- libsbgnpy/examples/extension_example.py +103 -0
- libsbgnpy/examples/info_example.py +70 -0
- libsbgnpy/examples/notes_example.py +66 -0
- libsbgnpy/examples/read_example.py +35 -0
- libsbgnpy/examples/sbgn/adh.sbgn +61 -0
- libsbgnpy/examples/sbgn/glycolysis.sbgn +375 -0
- libsbgnpy/examples/sbgn/neuronal_muscle_signalling_color.sbgn +439 -0
- libsbgnpy/examples/sbgn/notes.sbgn +13 -0
- libsbgnpy/examples/sbgn/test-output-01.sbgn +8 -0
- libsbgnpy/examples/sbgn/test-output-02.sbgn +59 -0
- libsbgnpy/examples/sbgn/test-output-03.sbgn +16 -0
- libsbgnpy/examples/write_example.py +223 -0
- libsbgnpy/libsbgn.py +4490 -0
- libsbgnpy/libsbgnSubs.py +127 -0
- libsbgnpy/libsbgnTypes.py +112 -0
- libsbgnpy/render.py +59 -0
- libsbgnpy/sbo/__init__.py +0 -0
- libsbgnpy/sbo/sbgn_sbo_mapping.txt +1304 -0
- libsbgnpy/sbo/sbo2sbgn.py +58 -0
- libsbgnpy/sbo/sbo_sbgn_map.txt +38 -0
- libsbgnpy/schema/README.md +156 -0
- libsbgnpy/schema/SBGN.xsd +1018 -0
- libsbgnpy/schema/__init__.py +0 -0
- libsbgnpy/utils.py +93 -0
- libsbgnpy/validation/__init__.py +0 -0
- libsbgnpy/validation/error-test-files/AF/af10101-fail.sbgn +34 -0
- libsbgnpy/validation/error-test-files/AF/af10101-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10102-fail-1.sbgn +17 -0
- libsbgnpy/validation/error-test-files/AF/af10102-fail-2.sbgn +17 -0
- libsbgnpy/validation/error-test-files/AF/af10102-fail-3.sbgn +17 -0
- libsbgnpy/validation/error-test-files/AF/af10102-fail-4.sbgn +17 -0
- libsbgnpy/validation/error-test-files/AF/af10102-pass.sbgn +17 -0
- libsbgnpy/validation/error-test-files/AF/af10103-fail.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10103-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10104-fail.sbgn +34 -0
- libsbgnpy/validation/error-test-files/AF/af10104-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10109-fail.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10109-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/AF/af10110-fail.sbgn +34 -0
- libsbgnpy/validation/error-test-files/AF/af10111-fail.sbgn +42 -0
- libsbgnpy/validation/error-test-files/AF/af10111-pass.sbgn +26 -0
- libsbgnpy/validation/error-test-files/AF/af10112-fail.sbgn +25 -0
- libsbgnpy/validation/error-test-files/AF/af10113-fail.sbgn +17 -0
- libsbgnpy/validation/error-test-files/ER/er10103-fail.sbgn +29 -0
- libsbgnpy/validation/error-test-files/ER/er10103-pass.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10104-fail.sbgn +31 -0
- libsbgnpy/validation/error-test-files/ER/er10104-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-1.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-2.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-3.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-4.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-5.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-fail-6.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10106-pass.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-1.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-2.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-3.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-4.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-5.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-fail-6.sbgn +25 -0
- libsbgnpy/validation/error-test-files/ER/er10107-pass.sbgn +26 -0
- libsbgnpy/validation/error-test-files/ER/er10108-fail-1.sbgn +43 -0
- libsbgnpy/validation/error-test-files/ER/er10108-fail-2.sbgn +43 -0
- libsbgnpy/validation/error-test-files/ER/er10108-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/ER/er10109-fail.sbgn +40 -0
- libsbgnpy/validation/error-test-files/ER/er10109-pass.sbgn +40 -0
- libsbgnpy/validation/error-test-files/ER/er10111-fail.sbgn +53 -0
- libsbgnpy/validation/error-test-files/ER/er10111-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/ER/er20001-fail.sbgn +55 -0
- libsbgnpy/validation/error-test-files/ER/er20001-pass.sbgn +57 -0
- libsbgnpy/validation/error-test-files/PD/pd10101-fail.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10101-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10102-fail.sbgn +55 -0
- libsbgnpy/validation/error-test-files/PD/pd10102-pass.sbgn +55 -0
- libsbgnpy/validation/error-test-files/PD/pd10103-fail.sbgn +37 -0
- libsbgnpy/validation/error-test-files/PD/pd10103-pass.sbgn +45 -0
- libsbgnpy/validation/error-test-files/PD/pd10104-fail.sbgn +55 -0
- libsbgnpy/validation/error-test-files/PD/pd10104-pass.sbgn +47 -0
- libsbgnpy/validation/error-test-files/PD/pd10105-fail.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10105-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10106-fail.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10106-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10107-fail.sbgn +37 -0
- libsbgnpy/validation/error-test-files/PD/pd10107-pass.sbgn +45 -0
- libsbgnpy/validation/error-test-files/PD/pd10108-fail.sbgn +42 -0
- libsbgnpy/validation/error-test-files/PD/pd10108-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-fail-1.sbgn +51 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-fail-2.sbgn +51 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-fail-3.sbgn +51 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-fail-4.sbgn +51 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-fail-5.sbgn +51 -0
- libsbgnpy/validation/error-test-files/PD/pd10109-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-fail-1.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-fail-2.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-fail-3.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-fail-4.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-fail-5.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10110-pass.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10111-fail-2.sbgn +72 -0
- libsbgnpy/validation/error-test-files/PD/pd10111-fail.sbgn +72 -0
- libsbgnpy/validation/error-test-files/PD/pd10111-pass.sbgn +68 -0
- libsbgnpy/validation/error-test-files/PD/pd10112-fail-1.sbgn +28 -0
- libsbgnpy/validation/error-test-files/PD/pd10112-fail-2.sbgn +28 -0
- libsbgnpy/validation/error-test-files/PD/pd10112-pass.sbgn +28 -0
- libsbgnpy/validation/error-test-files/PD/pd10124-fail.sbgn +67 -0
- libsbgnpy/validation/error-test-files/PD/pd10124-pass.sbgn +67 -0
- libsbgnpy/validation/error-test-files/PD/pd10125-fail.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10126-fail.sbgn +53 -0
- libsbgnpy/validation/error-test-files/PD/pd10126-pass.sbgn +45 -0
- libsbgnpy/validation/error-test-files/PD/pd10127-fail.sbgn +21 -0
- libsbgnpy/validation/error-test-files/PD/pd10127-pass.sbgn +17 -0
- libsbgnpy/validation/error-test-files/PD/pd10128-fail.sbgn +21 -0
- libsbgnpy/validation/error-test-files/PD/pd10128-pass.sbgn +17 -0
- libsbgnpy/validation/error-test-files/PD/pd10131-fail.sbgn +9 -0
- libsbgnpy/validation/error-test-files/PD/pd10131-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10132-fail.sbgn +10 -0
- libsbgnpy/validation/error-test-files/PD/pd10132-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10140-fail.sbgn +31 -0
- libsbgnpy/validation/error-test-files/PD/pd10140-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10141-fail.sbgn +11 -0
- libsbgnpy/validation/error-test-files/PD/pd10141-pass.sbgn +27 -0
- libsbgnpy/validation/error-test-files/PD/pd10142-fail.sbgn +35 -0
- libsbgnpy/validation/error-test-files/PD/pd10142-pass.sbgn +53 -0
- libsbgnpy/validation/error-test-files/error_notes.txt +7 -0
- libsbgnpy/validation/rules/sbgn_af.sch +275 -0
- libsbgnpy/validation/rules/sbgn_er.sch +288 -0
- libsbgnpy/validation/rules/sbgn_pd.sch +634 -0
- libsbgnpy/validation/schematron/ExtractSchFromRNG.xsl +75 -0
- libsbgnpy/validation/schematron/ExtractSchFromXSD.xsl +77 -0
- libsbgnpy/validation/schematron/iso-schematron-xslt1.zip +0 -0
- libsbgnpy/validation/schematron/iso-schematron-xslt2.zip +0 -0
- libsbgnpy/validation/schematron/iso_abstract_expand.xsl +297 -0
- libsbgnpy/validation/schematron/iso_dsdl_include.xsl +1509 -0
- libsbgnpy/validation/schematron/iso_schematron_message.xsl +55 -0
- libsbgnpy/validation/schematron/iso_schematron_skeleton_for_xslt1.xsl +1841 -0
- libsbgnpy/validation/schematron/iso_svrl_for_xslt1.xsl +604 -0
- libsbgnpy/validation/schematron/readme.txt +101 -0
- libsbgnpy/validation/schematron/schematron-skeleton-api.htm +723 -0
- libsbgnpy/validation/validator.py +141 -0
- libsbgnpy-0.3.0.dist-info/METADATA +91 -0
- libsbgnpy-0.3.0.dist-info/RECORD +145 -0
- libsbgnpy-0.3.0.dist-info/WHEEL +4 -0
- libsbgnpy-0.3.0.dist-info/licenses/LICENSE +7 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!--
|
|
3
|
+
|
|
4
|
+
Schematron validation for SBGN AF
|
|
5
|
+
|
|
6
|
+
@author Augustin Luna
|
|
7
|
+
-->
|
|
8
|
+
<iso:schema
|
|
9
|
+
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
|
|
10
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
11
|
+
defaultPhase="basic"
|
|
12
|
+
schemaVersion="0.1">
|
|
13
|
+
|
|
14
|
+
<iso:ns prefix="sbgn" uri="http://sbgn.org/libsbgn/0.2"/>
|
|
15
|
+
|
|
16
|
+
<iso:title>sbgn_af_validation</iso:title>
|
|
17
|
+
|
|
18
|
+
<iso:phase id="sanity">
|
|
19
|
+
<iso:active pattern="00000"/>
|
|
20
|
+
</iso:phase>
|
|
21
|
+
|
|
22
|
+
<iso:phase id="basic">
|
|
23
|
+
<iso:active pattern="00001"/>
|
|
24
|
+
<iso:active pattern="00002"/>
|
|
25
|
+
<iso:active pattern="af10101"/>
|
|
26
|
+
<iso:active pattern="af10102"/>
|
|
27
|
+
<iso:active pattern="af10103"/>
|
|
28
|
+
<iso:active pattern="af10104"/>
|
|
29
|
+
<iso:active pattern="af10109"/>
|
|
30
|
+
<iso:active pattern="af10110"/>
|
|
31
|
+
<iso:active pattern="af10111"/>
|
|
32
|
+
<iso:active pattern="af10112"/>
|
|
33
|
+
<iso:active pattern="af10113"/>
|
|
34
|
+
<iso:active pattern="af10114"/>
|
|
35
|
+
</iso:phase>
|
|
36
|
+
|
|
37
|
+
<iso:pattern id="00000">
|
|
38
|
+
<iso:rule context="/*">
|
|
39
|
+
<iso:assert id="00000" name="sanity-check" test="false()">This assertion should always fail.</iso:assert>
|
|
40
|
+
</iso:rule>
|
|
41
|
+
</iso:pattern>
|
|
42
|
+
|
|
43
|
+
<iso:pattern id="00001">
|
|
44
|
+
<iso:rule context="//*[@id]">
|
|
45
|
+
<iso:let name="id" value="@id"/>
|
|
46
|
+
<iso:assert
|
|
47
|
+
id="00001"
|
|
48
|
+
role="error"
|
|
49
|
+
test="count(//@id[. = current()/@id]) = 1" diagnostics="id">ID needs to be unique.</iso:assert>
|
|
50
|
+
</iso:rule>
|
|
51
|
+
</iso:pattern>
|
|
52
|
+
|
|
53
|
+
<iso:pattern id="00002">
|
|
54
|
+
<iso:rule context="sbgn:arc">
|
|
55
|
+
<iso:let name="target" value="@target"/>
|
|
56
|
+
<iso:assert
|
|
57
|
+
id="00002"
|
|
58
|
+
role="error"
|
|
59
|
+
test="//*/@id[. = $target]" diagnostics="target">An arc target should be a glyph defined in the diagram.</iso:assert>
|
|
60
|
+
</iso:rule>
|
|
61
|
+
</iso:pattern>
|
|
62
|
+
|
|
63
|
+
<iso:pattern id="af10101">
|
|
64
|
+
<iso:rule context="sbgn:arc[(@class='positive influence') or (@class='negative influence') or
|
|
65
|
+
(@class='unknown influence') or (@class='necessary stimulation')]">
|
|
66
|
+
<iso:let name="id" value="@id"/>
|
|
67
|
+
<iso:let name="source" value="@source"/>
|
|
68
|
+
<iso:let name="source-class" value="//sbgn:glyph[@id=$source]/@class"/>
|
|
69
|
+
<iso:let name="port-class" value="//sbgn:port[@id=$source]/../@class"/>
|
|
70
|
+
<iso:assert
|
|
71
|
+
id="af10101"
|
|
72
|
+
name="check-positive-influence-source-class-activity-nodes"
|
|
73
|
+
role="error"
|
|
74
|
+
see="sbgn-af-L1V1.0-3.3.1"
|
|
75
|
+
test="
|
|
76
|
+
$source-class='biological activity' or
|
|
77
|
+
$source-class='perturbation' or
|
|
78
|
+
$port-class='and' or
|
|
79
|
+
$port-class='or' or
|
|
80
|
+
$port-class='not' or
|
|
81
|
+
$port-class='delay'"
|
|
82
|
+
diagnostics="id source source-class port-class">Incorrect source reference for influence arc
|
|
83
|
+
</iso:assert>
|
|
84
|
+
</iso:rule>
|
|
85
|
+
</iso:pattern>
|
|
86
|
+
<iso:pattern id="af10102">
|
|
87
|
+
<iso:rule context="sbgn:arc[(@class='positive influence') or (@class='negative influence') or
|
|
88
|
+
(@class='unknown influence') or (@class='necessary stimulation')]">
|
|
89
|
+
<iso:let name="id" value="@id"/>
|
|
90
|
+
<iso:let name="target" value="@target"/>
|
|
91
|
+
<iso:let name="target-class" value="//sbgn:glyph[@id=$target]/@class"/>
|
|
92
|
+
<iso:let name="port-class" value="//sbgn:port[@id=$target]/../@class"/>
|
|
93
|
+
<iso:assert
|
|
94
|
+
id="af10102"
|
|
95
|
+
name="check-positive-influence-target-class"
|
|
96
|
+
role="error"
|
|
97
|
+
see="sbgn-af-L1V1.0-3.3.1"
|
|
98
|
+
test="
|
|
99
|
+
$target-class='biological activity' or
|
|
100
|
+
$target-class='phenotype'"
|
|
101
|
+
diagnostics="id target target-class port-class">Incorrect target reference for influence arc
|
|
102
|
+
</iso:assert>
|
|
103
|
+
</iso:rule>
|
|
104
|
+
</iso:pattern>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
<iso:pattern id="af10103">
|
|
108
|
+
<iso:rule context="sbgn:arc">
|
|
109
|
+
<iso:let name="id" value="@id"/>
|
|
110
|
+
<iso:let name="class" value="@class"/>
|
|
111
|
+
<iso:assert
|
|
112
|
+
id="af10103"
|
|
113
|
+
name="check-arc-class"
|
|
114
|
+
role="error"
|
|
115
|
+
see="sbgn-af-L1V1..."
|
|
116
|
+
test="
|
|
117
|
+
$class='logic arc' or
|
|
118
|
+
$class='equivalence arc' or
|
|
119
|
+
$class='positive influence' or
|
|
120
|
+
$class='negative influence' or
|
|
121
|
+
$class='necessary stimulation' or
|
|
122
|
+
$class='unknown influence'
|
|
123
|
+
"
|
|
124
|
+
diagnostics="id class">This arc class is not allowed in Activity Flow
|
|
125
|
+
</iso:assert>
|
|
126
|
+
</iso:rule>
|
|
127
|
+
</iso:pattern>
|
|
128
|
+
|
|
129
|
+
<iso:pattern id="af10104">
|
|
130
|
+
<iso:rule context="sbgn:glyph">
|
|
131
|
+
<iso:let name="id" value="@id"/>
|
|
132
|
+
<iso:let name="class" value="@class"/>
|
|
133
|
+
<iso:assert
|
|
134
|
+
id="af10104"
|
|
135
|
+
name="check-glyph-class"
|
|
136
|
+
role="error"
|
|
137
|
+
see="sbgn-af-L1V1..."
|
|
138
|
+
test="
|
|
139
|
+
$class='biological activity' or
|
|
140
|
+
$class='and' or
|
|
141
|
+
$class='or' or
|
|
142
|
+
$class='not' or
|
|
143
|
+
$class='delay' or
|
|
144
|
+
$class='tag' or
|
|
145
|
+
$class='submap' or
|
|
146
|
+
$class='terminal' or
|
|
147
|
+
$class='unit of information' or
|
|
148
|
+
$class='compartment' or
|
|
149
|
+
$class='perturbation' or
|
|
150
|
+
$class='phenotype'
|
|
151
|
+
"
|
|
152
|
+
diagnostics="id class">This glyph class is not allowed in Activity Flow
|
|
153
|
+
</iso:assert>
|
|
154
|
+
</iso:rule>
|
|
155
|
+
</iso:pattern>
|
|
156
|
+
|
|
157
|
+
<iso:pattern id="af10109">
|
|
158
|
+
<iso:rule context="sbgn:arc[@class='logic arc']">
|
|
159
|
+
<iso:let name="id" value="@id"/>
|
|
160
|
+
<iso:let name="source" value="@source"/>
|
|
161
|
+
<iso:let name="source-class" value="//sbgn:glyph[@id=$source]/@class"/>
|
|
162
|
+
<iso:assert
|
|
163
|
+
id="af10109"
|
|
164
|
+
name="check-logic-arc-source-class"
|
|
165
|
+
role="error"
|
|
166
|
+
see="sbgn-af-L1V1.0-3.3.1"
|
|
167
|
+
test="
|
|
168
|
+
$source-class='biological activity'"
|
|
169
|
+
diagnostics="id source source-class">Incorrect source reference for arc with class "logic arc"
|
|
170
|
+
</iso:assert>
|
|
171
|
+
</iso:rule>
|
|
172
|
+
</iso:pattern>
|
|
173
|
+
|
|
174
|
+
<iso:pattern id="af10110">
|
|
175
|
+
<iso:rule context="sbgn:arc[@class='logic arc']">
|
|
176
|
+
<iso:let name="id" value="@id"/>
|
|
177
|
+
<iso:let name="target" value="@target"/>
|
|
178
|
+
<iso:let name="target-class" value="//sbgn:glyph[@id=$target]/@class"/>
|
|
179
|
+
<iso:let name="port-class" value="//sbgn:port[@id=$target]/../@class"/>
|
|
180
|
+
<iso:assert
|
|
181
|
+
id="af10110"
|
|
182
|
+
name="check-logic-arc-target-class"
|
|
183
|
+
role="error"
|
|
184
|
+
see="sbgn-af-L1V1.0-3.3.1"
|
|
185
|
+
test="
|
|
186
|
+
$port-class='and' or
|
|
187
|
+
$port-class='or' or
|
|
188
|
+
$port-class='not' or
|
|
189
|
+
$port-class='delay'"
|
|
190
|
+
diagnostics="id target target-class port-class">Incorrect target reference for arc with class "logic arc"
|
|
191
|
+
</iso:assert>
|
|
192
|
+
</iso:rule>
|
|
193
|
+
</iso:pattern>
|
|
194
|
+
<!-- Limited Number Rules -->
|
|
195
|
+
|
|
196
|
+
<iso:pattern id="af10111">
|
|
197
|
+
<iso:rule context="sbgn:glyph[@class='not']">
|
|
198
|
+
<iso:let name="id" value="@id"/>
|
|
199
|
+
<iso:let name="port-id" value="./sbgn:port/@id"/>
|
|
200
|
+
<iso:let name="count" value="count(//sbgn:arc[(./@class = 'logic arc') and (./@target = current()/sbgn:port/@id)])"/>
|
|
201
|
+
<iso:assert
|
|
202
|
+
id="af10111"
|
|
203
|
+
name="check-logic_arc-not-target-count-equals-1"
|
|
204
|
+
role="error"
|
|
205
|
+
see="sbgn-pd-L1V1.3-3.4.1"
|
|
206
|
+
test="$count = 1"
|
|
207
|
+
diagnostics="id port-id count">'not' glyph can only be connected to one logic arc glyph.
|
|
208
|
+
</iso:assert>
|
|
209
|
+
</iso:rule>
|
|
210
|
+
</iso:pattern>
|
|
211
|
+
|
|
212
|
+
<iso:pattern id="af10112">
|
|
213
|
+
<iso:rule context="sbgn:arc[@class='equivalence arc']">
|
|
214
|
+
<iso:let name="id" value="@id"/>
|
|
215
|
+
<iso:let name="source" value="@source"/>
|
|
216
|
+
<iso:let name="source-class" value="//sbgn:glyph[@id=$source]/@class"/>
|
|
217
|
+
<iso:assert
|
|
218
|
+
id="af10112"
|
|
219
|
+
name="check-equivalence-arc-source-class"
|
|
220
|
+
role="error"
|
|
221
|
+
see="sbgn-af-L1V1.0-3.3.1"
|
|
222
|
+
test="
|
|
223
|
+
$source-class='biological activity' or
|
|
224
|
+
$source-class='compartment'"
|
|
225
|
+
diagnostics="id source source-class">Incorrect source reference for arc with class "equivalence arc"
|
|
226
|
+
</iso:assert>
|
|
227
|
+
</iso:rule>
|
|
228
|
+
</iso:pattern>
|
|
229
|
+
<iso:pattern id="af10113">
|
|
230
|
+
<iso:rule context="sbgn:arc[@class='equivalence arc']">
|
|
231
|
+
<iso:let name="id" value="@id"/>
|
|
232
|
+
<iso:let name="target" value="@target"/>
|
|
233
|
+
<iso:let name="target-class" value="//sbgn:glyph[@id=$target]/@class"/>
|
|
234
|
+
<iso:assert
|
|
235
|
+
id="af10113"
|
|
236
|
+
name="check-equivalence-arc-target-class"
|
|
237
|
+
role="error"
|
|
238
|
+
see="sbgn-af-L1V1.0-3.3.1"
|
|
239
|
+
test="
|
|
240
|
+
$target-class='tag' or
|
|
241
|
+
$target-class='submap' or
|
|
242
|
+
$target-class='terminal'"
|
|
243
|
+
diagnostics="id target target-class">Incorrect target reference for arc with class "equivalence arc"
|
|
244
|
+
</iso:assert>
|
|
245
|
+
</iso:rule>
|
|
246
|
+
</iso:pattern>
|
|
247
|
+
|
|
248
|
+
<iso:pattern id="af10114">
|
|
249
|
+
<iso:rule context="sbgn:map/sbgn:glyph[(@class='biological activity')]">
|
|
250
|
+
<iso:let name="id" value="@id"/>
|
|
251
|
+
<iso:let name="compartment-count" value="count(//sbgn:glyph[@class='compartment'])"/>
|
|
252
|
+
<iso:assert
|
|
253
|
+
id="af10114"
|
|
254
|
+
name="check-compartment-ref"
|
|
255
|
+
role="error"
|
|
256
|
+
test="
|
|
257
|
+
(($compartment-count = 0) and not (@compartmentRef)) or (($compartment-count > 0) and @compartmentRef)"
|
|
258
|
+
diagnostics="id">If there are compartments defined, top-level glyphs must have a compartmentRef"
|
|
259
|
+
</iso:assert>
|
|
260
|
+
</iso:rule>
|
|
261
|
+
</iso:pattern>
|
|
262
|
+
|
|
263
|
+
<iso:diagnostics>
|
|
264
|
+
<iso:diagnostic id="id"><iso:value-of select="$id"/></iso:diagnostic>
|
|
265
|
+
<iso:diagnostic id="port-id"><iso:value-of select="$port-id"/></iso:diagnostic>
|
|
266
|
+
<iso:diagnostic id="target"><iso:value-of select="$target"/></iso:diagnostic>
|
|
267
|
+
<iso:diagnostic id="source"><iso:value-of select="$source"/></iso:diagnostic>
|
|
268
|
+
<iso:diagnostic id="class"><iso:value-of select="$class"/></iso:diagnostic>
|
|
269
|
+
<iso:diagnostic id="source-class"><iso:value-of select="$source-class"/></iso:diagnostic>
|
|
270
|
+
<iso:diagnostic id="target-class"><iso:value-of select="$target-class"/></iso:diagnostic>
|
|
271
|
+
<iso:diagnostic id="port-class"><iso:value-of select="$port-class"/></iso:diagnostic>
|
|
272
|
+
<iso:diagnostic id="arc-count"><iso:value-of select="$arc-count"/></iso:diagnostic>
|
|
273
|
+
<iso:diagnostic id="count"><iso:value-of select="$count"/></iso:diagnostic>
|
|
274
|
+
</iso:diagnostics>
|
|
275
|
+
</iso:schema>
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!--
|
|
3
|
+
|
|
4
|
+
Schematron validation for SBGN ER
|
|
5
|
+
|
|
6
|
+
@author Martijn van Iersel, Augustin Luna
|
|
7
|
+
-->
|
|
8
|
+
<iso:schema
|
|
9
|
+
xmlns:iso="http://purl.oclc.org/dsdl/schematron"
|
|
10
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
11
|
+
defaultPhase="basic"
|
|
12
|
+
schemaVersion="0.2">
|
|
13
|
+
|
|
14
|
+
<iso:ns prefix="sbgn" uri="http://sbgn.org/libsbgn/0.2"/>
|
|
15
|
+
|
|
16
|
+
<iso:title>sbgn_er_validation</iso:title>
|
|
17
|
+
|
|
18
|
+
<!--TODO: Syntax rule: state-variable/assignment -->
|
|
19
|
+
|
|
20
|
+
<iso:phase id="sanity">
|
|
21
|
+
<iso:active pattern="00000"/>
|
|
22
|
+
</iso:phase>
|
|
23
|
+
|
|
24
|
+
<iso:phase id="basic">
|
|
25
|
+
<iso:active pattern="00001"/>
|
|
26
|
+
<iso:active pattern="00002"/>
|
|
27
|
+
<iso:active pattern="er20001"/>
|
|
28
|
+
<iso:active pattern="er10101"/>
|
|
29
|
+
<iso:active pattern="er10102"/>
|
|
30
|
+
<iso:active pattern="er10103"/>
|
|
31
|
+
<iso:active pattern="er10104"/>
|
|
32
|
+
<iso:active pattern="er10105"/>
|
|
33
|
+
<iso:active pattern="er10106"/>
|
|
34
|
+
<iso:active pattern="er10107"/>
|
|
35
|
+
<iso:active pattern="er10108"/>
|
|
36
|
+
<iso:active pattern="er10109"/>
|
|
37
|
+
<iso:active pattern="er10111"/>
|
|
38
|
+
</iso:phase>
|
|
39
|
+
|
|
40
|
+
<iso:pattern id="00000">
|
|
41
|
+
<iso:rule context="/*">
|
|
42
|
+
<iso:assert
|
|
43
|
+
id="00000"
|
|
44
|
+
name="sanity-check"
|
|
45
|
+
test="false()">This assertion should always fail.</iso:assert>
|
|
46
|
+
</iso:rule>
|
|
47
|
+
</iso:pattern>
|
|
48
|
+
|
|
49
|
+
<iso:pattern id="00001">
|
|
50
|
+
<iso:rule context="//*[@id]">
|
|
51
|
+
<iso:let name="id" value="@id"/>
|
|
52
|
+
<iso:assert
|
|
53
|
+
id="00001"
|
|
54
|
+
role="error"
|
|
55
|
+
test="count(//@id[. = current()/@id]) = 1" diagnostics="id">ID needs to be unique.</iso:assert>
|
|
56
|
+
</iso:rule>
|
|
57
|
+
</iso:pattern>
|
|
58
|
+
|
|
59
|
+
<iso:pattern id="00002">
|
|
60
|
+
<iso:rule context="sbgn:arc">
|
|
61
|
+
<iso:let name="target" value="@target"/>
|
|
62
|
+
<iso:assert
|
|
63
|
+
id="00002"
|
|
64
|
+
role="error"
|
|
65
|
+
test="//*/@id[. = $target]">An arc target should be a glyph defined in the diagram.</iso:assert>
|
|
66
|
+
</iso:rule>
|
|
67
|
+
</iso:pattern>
|
|
68
|
+
|
|
69
|
+
<iso:pattern id="er20001">
|
|
70
|
+
<iso:rule context="sbgn:glyph[@class='interaction']">
|
|
71
|
+
<iso:let name="id" value="@id"/>
|
|
72
|
+
<iso:let name="parent-tag-name" value="../local-name()"/>
|
|
73
|
+
<iso:assert
|
|
74
|
+
id="er20001"
|
|
75
|
+
name="check-arcgroup"
|
|
76
|
+
role="error"
|
|
77
|
+
test="$parent-tag-name='arcgroup'" diagnostics="id">Parent of glyph with type interaction must be arcgroup.
|
|
78
|
+
</iso:assert>
|
|
79
|
+
</iso:rule>
|
|
80
|
+
</iso:pattern>
|
|
81
|
+
|
|
82
|
+
<!-- START: Syntax Rules -->
|
|
83
|
+
<iso:pattern id="er10101">
|
|
84
|
+
<iso:rule context="sbgn:arc[@class='assignment']">
|
|
85
|
+
<iso:let name="source" value="@source"/>
|
|
86
|
+
<iso:let name="class" value="//sbgn:glyph[@id=$source]/@class"/>
|
|
87
|
+
<!-- FIX: state variable I(1)O(1) -->
|
|
88
|
+
<iso:assert
|
|
89
|
+
id="er10101"
|
|
90
|
+
name="check-assignment-source-class"
|
|
91
|
+
role="error"
|
|
92
|
+
see="sbgn-er-L1V1.2-3.3.1"
|
|
93
|
+
test="
|
|
94
|
+
$class='variable value' or
|
|
95
|
+
$class='implicit xor'"
|
|
96
|
+
diagnostics="source class">Incorrect source reference for arc with class "assignment"
|
|
97
|
+
</iso:assert>
|
|
98
|
+
</iso:rule>
|
|
99
|
+
</iso:pattern>
|
|
100
|
+
<iso:pattern id="er10102">
|
|
101
|
+
<iso:rule context="sbgn:arc[@class='assignment']">
|
|
102
|
+
<iso:let name="id" value="@id"/>
|
|
103
|
+
<iso:let name="target" value="@target"/>
|
|
104
|
+
<iso:let name="target-class" value="//sbgn:glyph[@id=$target]/@class"/>
|
|
105
|
+
<iso:assert
|
|
106
|
+
id="er10102"
|
|
107
|
+
name="check-assignment-target-class"
|
|
108
|
+
role="error"
|
|
109
|
+
see="sbgn-er-L1V1.2-3.3.1"
|
|
110
|
+
test="
|
|
111
|
+
$target-class='state variable' or
|
|
112
|
+
$target-class='existence' or
|
|
113
|
+
$target-class='location' or
|
|
114
|
+
$target-class='implicit xor'"
|
|
115
|
+
diagnostics="id target target-class">Incorrect target reference for arc with class "assignment"
|
|
116
|
+
</iso:assert>
|
|
117
|
+
</iso:rule>
|
|
118
|
+
</iso:pattern>
|
|
119
|
+
|
|
120
|
+
<iso:pattern id="er10103">
|
|
121
|
+
<iso:rule context="sbgn:arc[@class='interaction']">
|
|
122
|
+
<iso:let name="id" value="@id"/>
|
|
123
|
+
<iso:let name="source" value="@source"/>
|
|
124
|
+
<iso:let name="class" value="//sbgn:glyph[@id=$source]/@class"/>
|
|
125
|
+
<iso:assert
|
|
126
|
+
id="er10103"
|
|
127
|
+
name="check-interaction-source-class"
|
|
128
|
+
role="error"
|
|
129
|
+
see="sbgn-er-L1V1.2-3.3.1"
|
|
130
|
+
test="
|
|
131
|
+
$class='entity' or
|
|
132
|
+
$class='outcome' or
|
|
133
|
+
$class='unit of information' or
|
|
134
|
+
$class='interaction'"
|
|
135
|
+
diagnostics="id source class">Incorrect source reference for arc with class "interaction"
|
|
136
|
+
</iso:assert>
|
|
137
|
+
</iso:rule>
|
|
138
|
+
</iso:pattern>
|
|
139
|
+
<iso:pattern id="er10104">
|
|
140
|
+
<iso:rule context="sbgn:arc[@class='interaction']">
|
|
141
|
+
<iso:let name="id" value="@id"/>
|
|
142
|
+
<iso:let name="target" value="@target"/>
|
|
143
|
+
<iso:let name="target-class" value="//sbgn:glyph[@id=$target]/@class"/>
|
|
144
|
+
<iso:assert
|
|
145
|
+
id="er10104"
|
|
146
|
+
name="check-interaction-target-class"
|
|
147
|
+
role="error"
|
|
148
|
+
see="sbgn-er-L1V1.2-3.3.1"
|
|
149
|
+
test="
|
|
150
|
+
$target-class='entity' or
|
|
151
|
+
$target-class='outcome' or
|
|
152
|
+
$target-class='unit of information'"
|
|
153
|
+
diagnostics="id target target-class">Incorrect target reference for arc with class "interaction"
|
|
154
|
+
</iso:assert>
|
|
155
|
+
</iso:rule>
|
|
156
|
+
</iso:pattern>
|
|
157
|
+
<iso:pattern id="er10105">
|
|
158
|
+
<!-- Number Limited Rules -->
|
|
159
|
+
<iso:rule context="sbgn:glyph[@class='outcome']">
|
|
160
|
+
<iso:let name="id" value="@id"/>
|
|
161
|
+
<iso:let name="port-id" value="./sbgn:port/@id"/>
|
|
162
|
+
<iso:let name="source-count" value="count(//sbgn:arc[(./@class = 'interaction') and (./@source = current()/sbgn:port/@id)])"/>
|
|
163
|
+
<iso:let name="target-count" value="count(//sbgn:arc[(./@class = 'interaction') and (./@target = current()/sbgn:port/@id)])"/>
|
|
164
|
+
<iso:assert
|
|
165
|
+
id="er10105"
|
|
166
|
+
name="check-interaction-outcome-source_target-count-equals-1"
|
|
167
|
+
role="error"
|
|
168
|
+
see="sbgn-pd-L1V1.3-3.4.1"
|
|
169
|
+
test="($source-count <= 1) and ($target-count <= 1)"
|
|
170
|
+
diagnostics="id port-id source-count target-count">The 'outcome' glyph can only be connected to one interaction glyph at the input or output.
|
|
171
|
+
</iso:assert>
|
|
172
|
+
</iso:rule>
|
|
173
|
+
</iso:pattern>
|
|
174
|
+
|
|
175
|
+
<iso:pattern id="er10106">
|
|
176
|
+
<iso:rule context="sbgn:arc[(@class='modulation') or (@class='stimulation') or (@class='inhibition') or (@class='necessary stimulation') or (@class='absolute inhibition') or (@class='absolute stimulation')]">
|
|
177
|
+
<iso:let name="id" value="@id"/>
|
|
178
|
+
<iso:let name="source" value="@source"/>
|
|
179
|
+
<iso:let name="port-class" value="//sbgn:port[@id=$source]/../@class"/>
|
|
180
|
+
<iso:let name="class" value="//sbgn:glyph[@id=$source]/@class"/>
|
|
181
|
+
<iso:assert
|
|
182
|
+
id="er10106"
|
|
183
|
+
name="check-influence-source-class"
|
|
184
|
+
role="error"
|
|
185
|
+
see="sbgn-er-L1V1.2-3.3.1"
|
|
186
|
+
test="
|
|
187
|
+
$class='entity' or
|
|
188
|
+
$class='outcome' or
|
|
189
|
+
$port-class='and' or
|
|
190
|
+
$port-class='or' or
|
|
191
|
+
$port-class='not' or
|
|
192
|
+
$port-class='delay' or
|
|
193
|
+
$class='perturbing agent'"
|
|
194
|
+
diagnostics="id source port-class class">Incorrect source reference for influence arc
|
|
195
|
+
</iso:assert>
|
|
196
|
+
</iso:rule>
|
|
197
|
+
</iso:pattern>
|
|
198
|
+
<iso:pattern id="er10107">
|
|
199
|
+
<iso:rule context="sbgn:arc[(@class='modulation') or (@class='stimulation') or (@class='inhibition') or (@class='necessary stimulation') or (@class='absolute inhibition') or (@class='absolute stimulation')]">
|
|
200
|
+
<iso:let name="id" value="@id"/>
|
|
201
|
+
<iso:let name="target" value="@target"/>
|
|
202
|
+
<iso:let name="class" value="//sbgn:glyph[@id=$target]/@class"/>
|
|
203
|
+
<iso:let name="port-class" value="//sbgn:port[@id=$target]/../@class"/>
|
|
204
|
+
<iso:assert
|
|
205
|
+
id="er10107"
|
|
206
|
+
name="check-influence-target-class"
|
|
207
|
+
role="error"
|
|
208
|
+
see="sbgn-er-L1V1.2-3.3.1"
|
|
209
|
+
test="
|
|
210
|
+
$port-class='modulation' or
|
|
211
|
+
$port-class='stimulation' or
|
|
212
|
+
$port-class='inhibition' or
|
|
213
|
+
$port-class='necessary stimulation' or
|
|
214
|
+
$port-class='absolute stimulation' or
|
|
215
|
+
$port-class='assignment' or
|
|
216
|
+
$port-class='interaction' or
|
|
217
|
+
$class='phenotype'"
|
|
218
|
+
diagnostics="id target port-class class">Incorrect target reference for influence arc
|
|
219
|
+
</iso:assert>
|
|
220
|
+
</iso:rule>
|
|
221
|
+
</iso:pattern>
|
|
222
|
+
|
|
223
|
+
<iso:pattern id="er10108">
|
|
224
|
+
<!-- Number Limited Rules -->
|
|
225
|
+
<iso:rule context="sbgn:glyph[(@class='outcome') or (@class='and') or (@class='or') or (@class='not') or (@class='delay')]">
|
|
226
|
+
<iso:let name="id" value="@id"/>
|
|
227
|
+
<iso:let name="port-id" value="./sbgn:port/@id"/>
|
|
228
|
+
<iso:let name="source-count" value="count(//sbgn:arc[./@source = current()/sbgn:port/@id])"/>
|
|
229
|
+
<iso:assert
|
|
230
|
+
id="er10108"
|
|
231
|
+
name="check-modulation-outcome_and_or_not_delay-source-count-equals-1"
|
|
232
|
+
role="error"
|
|
233
|
+
see="sbgn-pd-L1V1.3-3.4.1"
|
|
234
|
+
test="$source-count <= 1"
|
|
235
|
+
diagnostics="id port-id source-count">The 'outcome', 'and', 'or', 'not', and 'delay' glyphs can only be connected to one arc at the input.
|
|
236
|
+
</iso:assert>
|
|
237
|
+
</iso:rule>
|
|
238
|
+
</iso:pattern>
|
|
239
|
+
|
|
240
|
+
<iso:pattern id="er10109">
|
|
241
|
+
<iso:rule context="sbgn:arc[@class='logic arc']">
|
|
242
|
+
<iso:let name="id" value="@id"/>
|
|
243
|
+
<iso:let name="target" value="@target"/>
|
|
244
|
+
<iso:let name="port-class" value="//sbgn:port[@id=$target]/../@class"/>
|
|
245
|
+
<iso:assert
|
|
246
|
+
id="er10109"
|
|
247
|
+
name="check-logic-arc-target-class"
|
|
248
|
+
role="error"
|
|
249
|
+
see="sbgn-er-L1V1.2-3.3.1"
|
|
250
|
+
test="
|
|
251
|
+
$port-class='and' or
|
|
252
|
+
$port-class='or' or
|
|
253
|
+
$port-class='not' or
|
|
254
|
+
$port-class='delay'"
|
|
255
|
+
diagnostics="id target port-class">Incorrect target reference for arc with class "logic arc"
|
|
256
|
+
</iso:assert>
|
|
257
|
+
</iso:rule>
|
|
258
|
+
</iso:pattern>
|
|
259
|
+
<iso:pattern id="er10111">
|
|
260
|
+
<iso:rule context="sbgn:glyph[(@class='not') or (@class='delay')]">
|
|
261
|
+
<iso:let name="id" value="@id"/>
|
|
262
|
+
<iso:let name="port-id" value="./sbgn:port/@id"/>
|
|
263
|
+
<iso:let name="target-count" value="count(//sbgn:arc[(./@class = 'logic arc') and (./@target = current()/sbgn:port/@id)])"/>
|
|
264
|
+
<iso:assert
|
|
265
|
+
id="er10111"
|
|
266
|
+
name="check-logic_arc-not_delay-target-count-equals-1"
|
|
267
|
+
role="error"
|
|
268
|
+
see="sbgn-pd-L1V1.3-3.4.1"
|
|
269
|
+
test="$target-count <= 1"
|
|
270
|
+
diagnostics="id port-id target-count">The 'not', and 'delay' glyphs can only be connected to one logic arc glyph at the output.
|
|
271
|
+
</iso:assert>
|
|
272
|
+
</iso:rule>
|
|
273
|
+
</iso:pattern>
|
|
274
|
+
<!-- END: Syntax Rules -->
|
|
275
|
+
|
|
276
|
+
<iso:diagnostics>
|
|
277
|
+
<iso:diagnostic id="id"><iso:value-of select="$id"/></iso:diagnostic>
|
|
278
|
+
<iso:diagnostic id="parent"><iso:value-of select="$parent"/></iso:diagnostic>
|
|
279
|
+
<iso:diagnostic id="source"><iso:value-of select="$source"/></iso:diagnostic>
|
|
280
|
+
<iso:diagnostic id="class"><iso:value-of select="$class"/></iso:diagnostic>
|
|
281
|
+
<iso:diagnostic id="source-count"><iso:value-of select="$source-count"/></iso:diagnostic>
|
|
282
|
+
<iso:diagnostic id="target-count"><iso:value-of select="$target-count"/></iso:diagnostic>
|
|
283
|
+
<iso:diagnostic id="target"><iso:value-of select="$target"/></iso:diagnostic>
|
|
284
|
+
<iso:diagnostic id="target-class"><iso:value-of select="$target-class"/></iso:diagnostic>
|
|
285
|
+
<iso:diagnostic id="port-id"><iso:value-of select="$port-id"/></iso:diagnostic>
|
|
286
|
+
<iso:diagnostic id="port-class"><iso:value-of select="$port-class"/></iso:diagnostic>
|
|
287
|
+
</iso:diagnostics>
|
|
288
|
+
</iso:schema>
|