Skip to content

Commit 8c450e4

Browse files
committed
feat(cellml): add validation for cellML 1.1
1 parent 9355bad commit 8c450e4

34 files changed

Lines changed: 4027 additions & 17 deletions

biosimulators_utils/model_lang/cellml/cellml_1_1.xsd

Lines changed: 407 additions & 0 deletions
Large diffs are not rendered by default.

biosimulators_utils/model_lang/cellml/cellml_1_1_original.xsd

Lines changed: 409 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<xs:schema
4+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
5+
xmlns="http://www.w3.org/1998/Math/MathML"
6+
xmlns:xlink="http://www.w3.org/1999/xlink"
7+
targetNamespace="http://www.w3.org/1998/Math/MathML"
8+
elementFormDefault="qualified"
9+
>
10+
11+
<xs:annotation>
12+
<xs:documentation>
13+
This is the common attributes module for MathML.
14+
Author: St&#233;phane Dalmas, INRIA.
15+
</xs:documentation>
16+
</xs:annotation>
17+
18+
19+
<xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink-href.xsd"/>
20+
<xs:import/> <!-- import any foreign namespace -->
21+
22+
23+
<!-- The type of "class" is from the XHTML modularization with Schema
24+
document -->
25+
<xs:attributeGroup name="Common.attrib">
26+
<xs:attribute name="class" type="xs:NMTOKENS"/>
27+
<xs:attribute name="style" type="xs:string"/>
28+
<xs:attribute name="xref" type="xs:IDREF"/>
29+
<xs:attribute name="id" type="xs:ID"/>
30+
<xs:attribute ref="xlink:href"/>
31+
<!-- allow attributes from foreign namespaces, and don't check them -->
32+
<xs:anyAttribute namespace="##other" processContents="skip"/>
33+
</xs:attributeGroup>
34+
35+
</xs:schema>
36+
<!--
37+
Copyright &#251; 2002 World Wide Web Consortium, (Massachusetts Institute
38+
of Technology, Institut National de Recherche en Informatique et en
39+
Automatique, Keio University). All Rights Reserved. See
40+
http://www.w3.org/Consortium/Legal/.
41+
-->
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<xs:schema
4+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
5+
xmlns="http://www.w3.org/1998/Math/MathML"
6+
targetNamespace="http://www.w3.org/1998/Math/MathML"
7+
elementFormDefault="qualified"
8+
>
9+
10+
<xs:annotation>
11+
<xs:documentation>
12+
This is an XML Schema module defining the "math" element of MathML.
13+
Author: St&#233;phane Dalmas, INRIA.
14+
</xs:documentation>
15+
</xs:annotation>
16+
17+
<!-- The four groups that govern a lot of things -->
18+
19+
<!-- currently very lax. Should be tightened from Chapter 5 -->
20+
21+
<xs:group name="Presentation-expr.class">
22+
<xs:choice>
23+
<xs:group ref="PresExpr.class"/>
24+
<xs:group ref="ContExpr.class"/>
25+
</xs:choice>
26+
</xs:group>
27+
28+
<xs:group name="Content-expr.class">
29+
<xs:choice>
30+
<xs:group ref="ContExpr.class"/>
31+
<xs:group ref="PresExpr.class"/>
32+
</xs:choice>
33+
</xs:group>
34+
35+
<xs:group name="PresExpr.class">
36+
<xs:choice>
37+
<xs:group ref="Presentation-token.class"/>
38+
<xs:group ref="Presentation-layout.class"/>
39+
<xs:group ref="Presentation-script.class"/>
40+
<xs:group ref="Presentation-table.class"/>
41+
<xs:element ref="mspace"/>
42+
<xs:element ref="maction"/>
43+
<xs:element ref="merror"/>
44+
<xs:element ref="mstyle"/>
45+
</xs:choice>
46+
</xs:group>
47+
48+
<xs:group name="ContExpr.class">
49+
<xs:choice>
50+
<xs:group ref="Content-tokens.class"/>
51+
<xs:group ref="Content-arith.class"/>
52+
<xs:group ref="Content-functions.class"/>
53+
<xs:group ref="Content-logic.class"/>
54+
<xs:group ref="Content-constants.class"/>
55+
<xs:group ref="Content-sets.class"/>
56+
<xs:group ref="Content-relations.class"/>
57+
<xs:group ref="Content-elementary-functions.class"/>
58+
<xs:group ref="Content-calculus.class"/>
59+
<xs:group ref="Content-linear-algebra.class"/>
60+
<xs:group ref="Content-vector-calculus.class"/>
61+
<xs:group ref="Content-statistics.class"/>
62+
<xs:group ref="Content-constructs.class"/>
63+
<xs:element ref="semantics"/>
64+
</xs:choice>
65+
</xs:group>
66+
67+
<!-- "math" -->
68+
69+
<xs:attributeGroup name="Browser-interface.attrib">
70+
<xs:attribute name="baseline" type="xs:string"/>
71+
<xs:attribute name="overflow" default="scroll">
72+
<xs:simpleType>
73+
<xs:restriction base="xs:string">
74+
<xs:enumeration value="scroll"/>
75+
<xs:enumeration value="elide"/>
76+
<xs:enumeration value="truncate"/>
77+
<xs:enumeration value="scale"/>
78+
</xs:restriction>
79+
</xs:simpleType>
80+
</xs:attribute>
81+
<xs:attribute name="altimg" type="xs:anyURI"/>
82+
<xs:attribute name="alttext" type="xs:string"/>
83+
<xs:attribute name="type" type="xs:string"/>
84+
<xs:attribute name="name" type="xs:string"/>
85+
<xs:attribute name="height" type="xs:string"/>
86+
<xs:attribute name="width" type="xs:string"/>
87+
</xs:attributeGroup>
88+
89+
<xs:attributeGroup name="math.attlist">
90+
<xs:attributeGroup ref="Browser-interface.attrib"/>
91+
<xs:attribute name="macros" type="xs:string"/>
92+
<!-- deprecated
93+
<xs:attribute name="mode" type="xs:string"/>
94+
-->
95+
<xs:attribute name="display" default="inline">
96+
<xs:simpleType>
97+
<xs:restriction base="xs:string">
98+
<xs:enumeration value="block"/>
99+
<xs:enumeration value="inline"/>
100+
</xs:restriction>
101+
</xs:simpleType>
102+
</xs:attribute>
103+
<xs:attributeGroup ref="Common.attrib"/>
104+
</xs:attributeGroup>
105+
106+
<xs:group name="math.content">
107+
<xs:choice>
108+
<!-- *** This region was not commented out in the original W3C version,
109+
but has been commented out as the mathml:math element in
110+
CellML does not allow presentation MathML elements.
111+
<xs:group ref="PresExpr.class"/>
112+
*** End of region commented out for CellML *** -->
113+
<xs:group ref="ContExpr.class"/>
114+
</xs:choice>
115+
</xs:group>
116+
117+
<xs:complexType name="math.type">
118+
<xs:group ref="math.content" minOccurs="0" maxOccurs="unbounded"/>
119+
<xs:attributeGroup ref="math.attlist"/>
120+
</xs:complexType>
121+
122+
<xs:element name="math" type="math.type"/>
123+
124+
</xs:schema>
125+
<!--
126+
Copyright &#251; 2002 World Wide Web Consortium, (Massachusetts Institute
127+
of Technology, Institut National de Recherche en Informatique et en
128+
Automatique, Keio University). All Rights Reserved. See
129+
http://www.w3.org/Consortium/Legal/.
130+
-->
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<schema targetNamespace="http://www.w3.org/1999/xlink"
2+
xmlns:xlink="http://www.w3.org/1999/xlink"
3+
xmlns="http://www.w3.org/2001/XMLSchema">
4+
<annotation>
5+
<documentation xml:lang="en">
6+
This schema provides the XLink href attribute for use in the MathML2
7+
schema. Written by Max Froumentin, W3C.
8+
</documentation>
9+
</annotation>
10+
11+
<attribute name="href" type="anyURI"/>
12+
</schema>
13+
14+
15+
<!--
16+
Copyright &#251; 2002 World Wide Web Consortium, (Massachusetts Institute
17+
of Technology, Institut National de Recherche en Informatique et en
18+
Automatique, Keio University). All Rights Reserved. See
19+
http://www.w3.org/Consortium/Legal/.
20+
-->
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<xs:schema
4+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
5+
xmlns="http://www.w3.org/1998/Math/MathML"
6+
targetNamespace="http://www.w3.org/1998/Math/MathML"
7+
elementFormDefault="qualified"
8+
>
9+
10+
<xs:annotation>
11+
<xs:documentation>
12+
This is an XML Schema module for the "arithmetic" operators of content
13+
MathML.
14+
Author: St&#233;phane Dalmas, INRIA.
15+
</xs:documentation>
16+
</xs:annotation>
17+
18+
<!-- a common type for all this -->
19+
20+
<xs:complexType name="Arith.type">
21+
<xs:attributeGroup ref="Definition.attrib"/>
22+
<xs:attributeGroup ref="Common.attrib"/>
23+
</xs:complexType>
24+
25+
<!-- The elements -->
26+
27+
<xs:element name="abs" type="Arith.type"/>
28+
<xs:element name="conjugate" type="Arith.type"/>
29+
<xs:element name="arg" type="Arith.type"/>
30+
<xs:element name="real" type="Arith.type"/>
31+
<xs:element name="imaginary" type="Arith.type"/>
32+
33+
<xs:element name="floor" type="Arith.type"/>
34+
<xs:element name="ceiling" type="Arith.type"/>
35+
36+
<xs:element name="power" type="Arith.type"/>
37+
<xs:element name="root" type="Arith.type"/>
38+
39+
<xs:element name="minus" type="Arith.type"/>
40+
<xs:element name="plus" type="Arith.type"/>
41+
<xs:element name="sum" type="Arith.type"/>
42+
<xs:element name="times" type="Arith.type"/>
43+
<xs:element name="product" type="Arith.type"/>
44+
45+
<xs:element name="max" type="Arith.type"/>
46+
<xs:element name="min" type="Arith.type"/>
47+
48+
<xs:element name="factorial" type="Arith.type"/>
49+
<xs:element name="quotient" type="Arith.type"/>
50+
<xs:element name="divide" type="Arith.type"/>
51+
<xs:element name="rem" type="Arith.type"/>
52+
<xs:element name="gcd" type="Arith.type"/>
53+
<xs:element name="lcm" type="Arith.type"/>
54+
55+
<!-- And the group of everything -->
56+
57+
<xs:group name="Content-arith.class">
58+
<xs:choice>
59+
<xs:element ref="abs"/>
60+
<xs:element ref="conjugate"/>
61+
<xs:element ref="factorial"/>
62+
<xs:element ref="arg"/>
63+
<xs:element ref="real"/>
64+
<xs:element ref="imaginary"/>
65+
<xs:element ref="floor"/>
66+
<xs:element ref="ceiling"/>
67+
<xs:element ref="quotient"/>
68+
<xs:element ref="divide"/>
69+
<xs:element ref="rem"/>
70+
<xs:element ref="minus"/>
71+
<xs:element ref="plus"/>
72+
<xs:element ref="times"/>
73+
<xs:element ref="power"/>
74+
<xs:element ref="root"/>
75+
<xs:element ref="max"/>
76+
<xs:element ref="min"/>
77+
<xs:element ref="gcd"/>
78+
<xs:element ref="lcm"/>
79+
<xs:element ref="sum"/>
80+
<xs:element ref="product"/>
81+
</xs:choice>
82+
</xs:group>
83+
84+
</xs:schema>
85+
<!--
86+
Copyright &#251; 2002 World Wide Web Consortium, (Massachusetts Institute
87+
of Technology, Institut National de Recherche en Informatique et en
88+
Automatique, Keio University). All Rights Reserved. See
89+
http://www.w3.org/Consortium/Legal/.
90+
-->

0 commit comments

Comments
 (0)