Skip to content

Commit 3a9f801

Browse files
authored
Add SRMD validation and schema support (#1417)
1 parent 46fa40f commit 3a9f801

21 files changed

Lines changed: 1745 additions & 11 deletions

schema/ssp/SSPTraceabilityCommon.xsd

Lines changed: 896 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3+
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.0"
4+
xmlns:srmd="http://ssp-standard.org/SSPTraceability1/SimulationResourceMetaData"
5+
xmlns:stc="http://ssp-standard.org/SSPTraceability1/SSPTraceabilityCommon"
6+
xmlns:ssc="http://ssp-standard.org/SSP1/SystemStructureCommon"
7+
xmlns="http://ssp-standard.org/SSPTraceability1/SimulationResourceMetaData"
8+
targetNamespace="http://ssp-standard.org/SSPTraceability1/SimulationResourceMetaData"
9+
elementFormDefault="qualified">
10+
11+
<xs:import namespace="http://ssp-standard.org/SSP1/SystemStructureCommon" schemaLocation="SystemStructureCommon.xsd"/>
12+
<xs:import namespace="http://ssp-standard.org/SSPTraceability1/SSPTraceabilityCommon" schemaLocation="SSPTraceabilityCommon.xsd"/>
13+
14+
<xs:element name="SimulationResourceMetaData">
15+
<xs:annotation>
16+
<xs:documentation xml:lang="en">
17+
This element specifies the structure of a Simulation Resource Meta Data file.
18+
</xs:documentation>
19+
</xs:annotation>
20+
<xs:complexType>
21+
<xs:group ref="stc:GElementCommon"/>
22+
<xs:attribute name="version" use="required">
23+
<xs:annotation>
24+
<xs:documentation xml:lang="en">
25+
Version of SRMD format, 1.0.0 for this release.
26+
</xs:documentation>
27+
</xs:annotation>
28+
<xs:simpleType>
29+
<xs:restriction base="xs:normalizedString">
30+
<xs:pattern value="[0-9]+[.][0-9]+([.][0-9]+)?(-.*)?"/>
31+
</xs:restriction>
32+
</xs:simpleType>
33+
</xs:attribute>
34+
<xs:attribute name="name" type="xs:string" use="required">
35+
<xs:annotation>
36+
<xs:documentation xml:lang="en">
37+
This attribute gives the simulation resource meta data a name,
38+
which can be used for purposes of presenting the simulation resource
39+
meta data to the user.
40+
</xs:documentation>
41+
</xs:annotation>
42+
</xs:attribute>
43+
<xs:attribute name="data" type="xs:anyURI" use="optional">
44+
<xs:annotation>
45+
<xs:documentation xml:lang="en">
46+
This optional attribute gives a URI to the data item this
47+
resource meta data applies to. If this attribute is not
48+
present, then the data this resource meta data applies to
49+
is provided outside of the meta data (e.g. by embedding
50+
SRMD into the data format, or providing it as meta data in
51+
an STMD file).
52+
</xs:documentation>
53+
</xs:annotation>
54+
</xs:attribute>
55+
<xs:attribute name="checksum" type="xs:hexBinary" use="optional">
56+
<xs:annotation>
57+
<xs:documentation xml:lang="en">
58+
This attribute gives the checksum over the data item this meta data
59+
applies to. This is optional information to allow the identification
60+
of the data item and the precise algorithm
61+
specifying
62+
The checksum is calculated using the algorithm indicated by the checksumType attribute.
63+
</xs:documentation>
64+
</xs:annotation>
65+
</xs:attribute>
66+
<xs:attribute name="checksumType" type="xs:string" use="optional" default="SHA3-256">
67+
<xs:annotation>
68+
<xs:documentation xml:lang="en">
69+
This attribute gives the algorithm for the calculation of the checksum attribute. MUST be
70+
SHA3-256 for now, indicating a SHA3 256bit secure hash algorithm, as specified in FIPS 202.
71+
In the future other checksum algorithms might be supported.
72+
</xs:documentation>
73+
</xs:annotation>
74+
</xs:attribute>
75+
76+
<xs:attributeGroup ref="ssc:ABaseElement"/>
77+
<xs:attributeGroup ref="ssc:ATopLevelMetaData"/>
78+
</xs:complexType>
79+
</xs:element>
80+
</xs:schema>

schema/ssp/xlink.xsd

Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink">
3+
4+
<xs:annotation>
5+
<xs:documentation>This schema is not normative, or even definitive. The
6+
prose copy in the XLink 1.1 recommendation (http://www.w3.org/TR/xlink11/) is
7+
definitive, although it should not differ from this file, except for the
8+
absence of these two initial comments.</xs:documentation>
9+
</xs:annotation>
10+
11+
<xs:annotation>
12+
<xs:documentation>In keeping with the W3C's standard versioning
13+
policy, this schema document will persist at
14+
http://www.w3.org/XML/2008/06/xlink.xsd.
15+
At the date of issue it can also be found at
16+
http://www.w3.org/1999/xlink.xsd.
17+
The schema document at that URI may however change in the future,
18+
in order to remain compatible with the latest version of XML Schema
19+
itself, or with the XLink namespace itself. In other words, if the XML
20+
Schema or XLink namespaces change, the version of this document at
21+
http://www.w3.org/1999/xlink.xsd will change
22+
accordingly; the version at
23+
http://www.w3.org/2008/06/xlink.xsd will not change.
24+
</xs:documentation>
25+
</xs:annotation>
26+
27+
<xs:annotation>
28+
<xs:documentation>This schema document provides attribute declarations and
29+
attribute group, complex type and simple type definitions which can be used in
30+
the construction of user schemas to define the structure of particular linking
31+
constructs, e.g.
32+
<![CDATA[
33+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
34+
xmlns:xl="http://www.w3.org/1999/xlink">
35+
36+
<xs:import namespace="http://www.w3.org/1999/xlink"
37+
location="http://www.w3.org/1999/xlink.xsd">
38+
39+
<xs:element name="mySimple">
40+
<xs:complexType>
41+
...
42+
<xs:attributeGroup ref="xl:simpleAttrs"/>
43+
...
44+
</xs:complexType>
45+
</xs:element>
46+
...
47+
</xs:schema>]]></xs:documentation>
48+
</xs:annotation>
49+
50+
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
51+
52+
<xs:attribute name="type" type="xlink:typeType"/>
53+
54+
<xs:simpleType name="typeType">
55+
<xs:restriction base="xs:token">
56+
<xs:enumeration value="simple"/>
57+
<xs:enumeration value="extended"/>
58+
<xs:enumeration value="title"/>
59+
<xs:enumeration value="resource"/>
60+
<xs:enumeration value="locator"/>
61+
<xs:enumeration value="arc"/>
62+
</xs:restriction>
63+
</xs:simpleType>
64+
65+
<xs:attribute name="href" type="xlink:hrefType"/>
66+
67+
<xs:simpleType name="hrefType">
68+
<xs:restriction base="xs:anyURI"/>
69+
</xs:simpleType>
70+
71+
<xs:attribute name="role" type="xlink:roleType"/>
72+
73+
<xs:simpleType name="roleType">
74+
<xs:restriction base="xs:anyURI">
75+
<xs:minLength value="1"/>
76+
</xs:restriction>
77+
</xs:simpleType>
78+
79+
<xs:attribute name="arcrole" type="xlink:arcroleType"/>
80+
81+
<xs:simpleType name="arcroleType">
82+
<xs:restriction base="xs:anyURI">
83+
<xs:minLength value="1"/>
84+
</xs:restriction>
85+
</xs:simpleType>
86+
87+
<xs:attribute name="title" type="xlink:titleAttrType"/>
88+
89+
<xs:simpleType name="titleAttrType">
90+
<xs:restriction base="xs:string"/>
91+
</xs:simpleType>
92+
93+
<xs:attribute name="show" type="xlink:showType"/>
94+
95+
<xs:simpleType name="showType">
96+
<xs:restriction base="xs:token">
97+
<xs:enumeration value="new"/>
98+
<xs:enumeration value="replace"/>
99+
<xs:enumeration value="embed"/>
100+
<xs:enumeration value="other"/>
101+
<xs:enumeration value="none"/>
102+
</xs:restriction>
103+
</xs:simpleType>
104+
105+
<xs:attribute name="actuate" type="xlink:actuateType"/>
106+
107+
<xs:simpleType name="actuateType">
108+
<xs:restriction base="xs:token">
109+
<xs:enumeration value="onLoad"/>
110+
<xs:enumeration value="onRequest"/>
111+
<xs:enumeration value="other"/>
112+
<xs:enumeration value="none"/>
113+
</xs:restriction>
114+
</xs:simpleType>
115+
116+
<xs:attribute name="label" type="xlink:labelType"/>
117+
118+
<xs:simpleType name="labelType">
119+
<xs:restriction base="xs:NCName"/>
120+
</xs:simpleType>
121+
122+
<xs:attribute name="from" type="xlink:fromType"/>
123+
124+
<xs:simpleType name="fromType">
125+
<xs:restriction base="xs:NCName"/>
126+
</xs:simpleType>
127+
128+
<xs:attribute name="to" type="xlink:toType"/>
129+
130+
<xs:simpleType name="toType">
131+
<xs:restriction base="xs:NCName"/>
132+
</xs:simpleType>
133+
134+
<xs:attributeGroup name="simpleAttrs">
135+
<xs:attribute ref="xlink:type" fixed="simple"/>
136+
<xs:attribute ref="xlink:href"/>
137+
<xs:attribute ref="xlink:role"/>
138+
<xs:attribute ref="xlink:arcrole"/>
139+
<xs:attribute ref="xlink:title"/>
140+
<xs:attribute ref="xlink:show"/>
141+
<xs:attribute ref="xlink:actuate"/>
142+
</xs:attributeGroup>
143+
144+
<xs:group name="simpleModel">
145+
<xs:sequence>
146+
<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
147+
</xs:sequence>
148+
</xs:group>
149+
150+
<xs:complexType mixed="true" name="simple">
151+
<xs:annotation>
152+
<xs:documentation>
153+
Intended for use as the type of user-declared elements to make them
154+
simple links.
155+
</xs:documentation>
156+
</xs:annotation>
157+
<xs:group ref="xlink:simpleModel"/>
158+
<xs:attributeGroup ref="xlink:simpleAttrs"/>
159+
</xs:complexType>
160+
161+
<xs:attributeGroup name="extendedAttrs">
162+
<xs:attribute ref="xlink:type" fixed="extended" use="required"/>
163+
<xs:attribute ref="xlink:role"/>
164+
<xs:attribute ref="xlink:title"/>
165+
</xs:attributeGroup>
166+
167+
<xs:group name="extendedModel">
168+
<xs:choice>
169+
<xs:element ref="xlink:title"/>
170+
<xs:element ref="xlink:resource"/>
171+
<xs:element ref="xlink:locator"/>
172+
<xs:element ref="xlink:arc"/>
173+
</xs:choice>
174+
</xs:group>
175+
176+
<xs:complexType name="extended">
177+
<xs:annotation>
178+
<xs:documentation>
179+
Intended for use as the type of user-declared elements to make them
180+
extended links.
181+
Note that the elements referenced in the content model are all abstract.
182+
The intention is that by simply declaring elements with these as their
183+
substitutionGroup, all the right things will happen.
184+
</xs:documentation>
185+
</xs:annotation>
186+
<xs:group ref="xlink:extendedModel" minOccurs="0" maxOccurs="unbounded"/>
187+
<xs:attributeGroup ref="xlink:extendedAttrs"/>
188+
</xs:complexType>
189+
190+
<xs:element name="title" type="xlink:titleEltType" abstract="true"/>
191+
192+
<xs:attributeGroup name="titleAttrs">
193+
<xs:attribute ref="xlink:type" fixed="title" use="required"/>
194+
<xs:attribute ref="xml:lang">
195+
<xs:annotation>
196+
<xs:documentation>
197+
xml:lang is not required, but provides much of the
198+
motivation for title elements in addition to attributes, and so
199+
is provided here for convenience.
200+
</xs:documentation>
201+
</xs:annotation>
202+
</xs:attribute>
203+
</xs:attributeGroup>
204+
205+
<xs:group name="titleModel">
206+
<xs:sequence>
207+
<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
208+
</xs:sequence>
209+
</xs:group>
210+
211+
<xs:complexType mixed="true" name="titleEltType">
212+
<xs:group ref="xlink:titleModel"/>
213+
<xs:attributeGroup ref="xlink:titleAttrs"/>
214+
</xs:complexType>
215+
216+
<xs:element name="resource" type="xlink:resourceType" abstract="true"/>
217+
218+
<xs:attributeGroup name="resourceAttrs">
219+
<xs:attribute ref="xlink:type" fixed="resource" use="required"/>
220+
<xs:attribute ref="xlink:role"/>
221+
<xs:attribute ref="xlink:title"/>
222+
<xs:attribute ref="xlink:label"/>
223+
</xs:attributeGroup>
224+
225+
<xs:group name="resourceModel">
226+
<xs:sequence>
227+
<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
228+
</xs:sequence>
229+
</xs:group>
230+
231+
<xs:complexType mixed="true" name="resourceType">
232+
<xs:group ref="xlink:resourceModel"/>
233+
<xs:attributeGroup ref="xlink:resourceAttrs"/>
234+
</xs:complexType>
235+
236+
<xs:element name="locator" type="xlink:locatorType" abstract="true"/>
237+
238+
<xs:attributeGroup name="locatorAttrs">
239+
<xs:attribute ref="xlink:type" fixed="locator" use="required"/>
240+
<xs:attribute ref="xlink:href" use="required"/>
241+
<xs:attribute ref="xlink:role"/>
242+
<xs:attribute ref="xlink:title"/>
243+
<xs:attribute ref="xlink:label">
244+
<xs:annotation>
245+
<xs:documentation>
246+
label is not required, but locators have no particular
247+
XLink function if they are not labeled.
248+
</xs:documentation>
249+
</xs:annotation>
250+
</xs:attribute>
251+
</xs:attributeGroup>
252+
253+
<xs:group name="locatorModel">
254+
<xs:sequence>
255+
<xs:element ref="xlink:title" minOccurs="0" maxOccurs="unbounded"/>
256+
</xs:sequence>
257+
</xs:group>
258+
259+
<xs:complexType name="locatorType">
260+
<xs:group ref="xlink:locatorModel"/>
261+
<xs:attributeGroup ref="xlink:locatorAttrs"/>
262+
</xs:complexType>
263+
264+
<xs:element name="arc" type="xlink:arcType" abstract="true"/>
265+
266+
<xs:attributeGroup name="arcAttrs">
267+
<xs:attribute ref="xlink:type" fixed="arc" use="required"/>
268+
<xs:attribute ref="xlink:arcrole"/>
269+
<xs:attribute ref="xlink:title"/>
270+
<xs:attribute ref="xlink:show"/>
271+
<xs:attribute ref="xlink:actuate"/>
272+
<xs:attribute ref="xlink:from"/>
273+
<xs:attribute ref="xlink:to">
274+
<xs:annotation>
275+
<xs:documentation>
276+
from and to have default behavior when values are missing
277+
</xs:documentation>
278+
</xs:annotation>
279+
</xs:attribute>
280+
</xs:attributeGroup>
281+
282+
<xs:group name="arcModel">
283+
<xs:sequence>
284+
<xs:element ref="xlink:title" minOccurs="0" maxOccurs="unbounded"/>
285+
</xs:sequence>
286+
</xs:group>
287+
288+
<xs:complexType name="arcType">
289+
<xs:group ref="xlink:arcModel"/>
290+
<xs:attributeGroup ref="xlink:arcAttrs"/>
291+
</xs:complexType>
292+
293+
</xs:schema>

0 commit comments

Comments
 (0)