-
Notifications
You must be signed in to change notification settings - Fork 19
/
computer-example.xml
264 lines (263 loc) · 17.1 KB
/
computer-example.xml
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<?xml version="1.0" encoding="UTF-8"?>
<METASCHEMA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://csrc.nist.gov/ns/oscal/metaschema/1.0 ../../../../metaschema-java/core/metaschema/schema/xml/metaschema.xsd"
xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0">
<schema-name>Computer Model</schema-name>
<schema-version>0.0.5</schema-version>
<short-name>computer</short-name>
<namespace>http://example.com/ns/computer</namespace>
<json-base-uri>http://example.com/ns/computer</json-base-uri>
<define-assembly name="vendor">
<formal-name>Vendor Information</formal-name>
<description>Information about a vendor of a computer part.</description>
<define-flag name="id" required="yes">
<formal-name>Vendor Identifier</formal-name>
<description>An identifier for classifying a unique computer parts vendor.</description>
</define-flag>
<model>
<define-field name="name" min-occurs="1">
<formal-name>Vendor Name</formal-name>
<description>The registered company name of the vendor.</description>
</define-field>
<define-field name="address" min-occurs="1">
<formal-name>Vendor Address</formal-name>
<description>The physical address of an office location for the vendor.</description>
</define-field>
<define-field name="website" as-type="uri" min-occurs="1">
<formal-name>Vendor Website</formal-name>
<description>A public website made by the vendor documenting their parts as used in the computer.</description>
</define-field>
</model>
</define-assembly>
<define-field name="product-name">
<formal-name>Product Name</formal-name>
<description>The product name from the vendor of the computer part.</description>
</define-field>
<define-assembly name="computer">
<formal-name>Computer Assembly</formal-name>
<description>A container object for a computer, its parts, and its sub-parts.</description>
<root-name>computer</root-name>
<define-flag name="id" required="yes">
<formal-name>Computer Identifier</formal-name>
<description>An identifier for classifying a unique make and model of computer.</description>
</define-flag>
<model>
<define-field name="build-date" as-type="date-time-with-timezone">
<formal-name>Build Date and Time</formal-name>
<description>The date and time the computer build was completed.</description>
</define-field>
<define-assembly name="motherboard">
<formal-name>Motherboard Assembly</formal-name>
<description>A container object for a motherboard in a computer and its sub-parts.</description>
<model>
<assembly ref="vendor"/>
<define-field name="type" min-occurs="1">
<formal-name>Motherboard Type</formal-name>
<description>The type motherboard layout, <code>at</code>, <code>atx</code>, <code>mini-itx</code> or an alternative.</description>
<constraint>
<allowed-values target="." allow-other="yes">
<enum value="at">Advanced Technology Form Factor</enum>
<enum value="atx">Advanced Technology Extended Form Factor</enum>
<enum value="mini-itx">Mini Information Technology eXtended Form Factor</enum>
</allowed-values>
</constraint>
</define-field>
<define-assembly name="cpu">
<formal-name>Motherboard Central Processing Unit (CPU)</formal-name>
<description>The model number of the CPU on the motherboard of a computer.</description>
<model>
<assembly ref="vendor"/>
<field ref="product-name" min-occurs="1"/>
<field ref="cost"/>
<define-field name="architecture" min-occurs="1">
<formal-name>CPU Architecture</formal-name>
<description>The Instruction Set Architecture (ISA) of the processor, <code>x86</code>, <code>x86-64</code>, <code>arm</code>, or an alternative.</description>
<constraint>
<allowed-values target="." allow-other="yes">
<enum value="x86">x86 32-bit</enum>
<enum value="x86-64">x86 64-bit</enum>
<enum value="arm">arm</enum>
</allowed-values>
</constraint>
</define-field>
<define-field name="speed" min-occurs="1">
<formal-name>CPU Speed</formal-name>
<description>The clock speed of the CPU in megahertz or gigahertz.</description>
<constraint>
<matches target="." regex="\d+(?:\.\d+)?(?:MHz|GHz)"></matches>
</constraint>
</define-field>
<assembly ref="property"/>
<field ref="remarks" in-xml="UNWRAPPED"/>
</model>
</define-assembly>
<define-assembly name="ata-socket">
<formal-name>Motherboard Advanced Technology Attachment (ATA) Socket</formal-name>
<description>The model number of ATA socket on the motherboard of a computer. There will only be one socket on any motherboard.</description>
<model>
<assembly ref="vendor"/>
<field ref="product-name" min-occurs="1"/>
<field ref="cost"/>
<define-field name="type" min-occurs="1">
<formal-name>ATA Socket Type</formal-name>
<description>The type of ATA socket on the motherboard , <code>pata</code> (parallel ATA), <code>sata</code> (Serial ATA), or an alternative.</description>
<constraint>
<allowed-values target="." allow-other="yes">
<enum value="pata">Parallel ATA</enum>
<enum value="sata">Serial ATA</enum>
</allowed-values>
</constraint>
</define-field>
<assembly ref="property"/>
<field ref="remarks" in-xml="UNWRAPPED"/>
</model>
</define-assembly>
<define-assembly name="memory" min-occurs="1" max-occurs="unbounded">
<formal-name>Motherboard Random Access Memory (RAM) Module(s)</formal-name>
<description>Random access memory hardware installed on the motherboard of a computer.</description>
<group-as name="memory-modules" in-json="ARRAY"/>
<model>
<assembly ref="vendor"/>
<field ref="product-name" min-occurs="1"/>
<field ref="cost"/>
<define-field name="byte-size" as-type="positive-integer" min-occurs="1">
<formal-name>Memory Module Size</formal-name>
<description>Size of the memory module in binary, not SI base-10 units, meaning a kilobyte is 1024 bytes, not 1000 bytes.</description>
</define-field>
<assembly ref="property"/>
<field ref="remarks" in-xml="UNWRAPPED"/>
</model>
</define-assembly>
<define-assembly name="expansion-card" max-occurs="unbounded">
<formal-name>Motherboard Expansion Card</formal-name>
<description>The model number of an expansion card connected to the motherboard of a computer.</description>
<group-as name="expansion-cards" in-json="ARRAY"/>
<model>
<assembly ref="vendor"/>
<field ref="product-name" min-occurs="1"/>
<field ref="cost"/>
<define-field name="type" min-occurs="1">
<formal-name>Expansion Card Type</formal-name>
<description>The type of expansion card on a motherboard of a computer, such as <code>pci</code> (PCI, e.g. Peripheral Component Interconnect), <code>pcie</code> (PCI Express), or an alternative.</description>
<constraint>
<allowed-values target=".">
<enum value="pci">Peripheral Component Interconnect</enum>
<enum value="pcie">Peripheral Component Interconnect Express</enum>
</allowed-values>
</constraint>
</define-field>
<assembly ref="property"/>
<field ref="remarks" in-xml="UNWRAPPED"/>
</model>
</define-assembly>
</model>
</define-assembly>
<define-assembly name="usb-device" max-occurs="unbounded">
<formal-name>Universal Serial Bus Device</formal-name>
<description>A USB expansion device.</description>
<json-key flag-ref="uuid"/>
<group-as name="usb-devices" in-json="BY_KEY"/>
<define-flag name="uuid" as-type="uuid">
<formal-name>USB Device Universally Unique Identifier</formal-name>
<description>An identifier, based on a type 4 UUID, for the USB device.</description>
</define-flag>
<model>
<assembly ref="vendor"/>
<field ref="product-name" min-occurs="1"/>
<field ref="cost"/>
<assembly ref="property"/>
<field ref="remarks" in-xml="UNWRAPPED"/>
</model>
</define-assembly>
<assembly ref="property"/>
<field ref="remarks" in-xml="UNWRAPPED"/>
</model>
<constraint>
<is-unique target="usb-device">
<formal-name>Unique USB Device UUID</formal-name>
<description>Ensures that each USB device has a unique UUID.</description>
<key-field target="@uuid"/>
</is-unique>
<allowed-values target="(motherboard|motherboard/cpu|motherboard/memory|motherboard/expansion-card|usb-device)/prop[not(@ns) or @ns=('http://example.com/ns/computer')]/@name">
<enum value="model">CPU model</enum>
</allowed-values>
<has-cardinality level="WARNING" target="(motherboard|motherboard/cpu|motherboard/memory|motherboard/expansion-card|usb-device)/prop[not(@ns) or @ns=('http://example.com/ns/computer')]" min-occurs="1">
<remarks>
<p>Warn if a model is not provided.</p>
</remarks>
</has-cardinality>
<has-cardinality level="ERROR" target="(motherboard|motherboard/cpu|motherboard/memory|motherboard/expansion-card|usb-device)/prop[not(@ns) or @ns=('http://example.com/ns/computer')]" max-occurs="1">
<remarks>
<p>It is invalid to provide multiple models.</p>
</remarks>
</has-cardinality>
</constraint>
</define-assembly>
<define-field name="cost" as-type="decimal">
<formal-name>Part Cost</formal-name>
<description>The price paid in the specified currency.</description>
<json-value-key>price</json-value-key>
<define-flag name="currency" required="yes">
<formal-name>Currency Type</formal-name>
<description>The type of currency.</description>
</define-flag>
</define-field>
<define-field name="remarks" as-type="markup-multiline">
<formal-name>Remarks</formal-name>
<description>Additional remarks related to the containing computer component.</description>
</define-field>
<define-assembly name="property">
<formal-name>Property</formal-name>
<description>An attribute, characteristic, or quality of the containing object expressed as a namespace qualified name/value pair.</description>
<use-name>prop</use-name>
<define-flag name="name" as-type="token" required="yes">
<formal-name>Property Name</formal-name>
<description>A textual label, within a namespace, that uniquely identifies a specific attribute, characteristic, or quality of the property's containing object.</description>
</define-flag>
<define-flag name="uuid" as-type="uuid">
<formal-name>Property Universally Unique Identifier</formal-name>
<!-- identifier declaration -->
<description>A unique identifier for a property.</description>
</define-flag>
<define-flag name="ns" as-type="uri" default="http://example.com/ns/computer">
<formal-name>Property Namespace</formal-name>
<description>A namespace qualifying the property's name. This allows different organizations to associate distinct semantics with the same name.</description>
<remarks>
<p>This value must be an <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-4.3">absolute URI</a> that serves as a naming system identifier.</p>
<p>When a <code>ns</code> is not provided, its value should be assumed to be <code>http://example.com/ns/computer</code> and the name should be a name defined by this model.</p>
</remarks>
</define-flag>
<define-flag name="value" as-type="string" required="yes">
<formal-name>Property Value</formal-name>
<description>Indicates the value of the attribute, characteristic, or quality.</description>
</define-flag>
<define-flag name="class" as-type="token">
<formal-name>Property Class</formal-name>
<description>A textual label that provides a sub-type or characterization of the
property's <code>name</code>.</description>
<remarks>
<p>This can be used to further distinguish or discriminate between the semantics of multiple properties of the same object with the same <code>name</code> and <code>ns</code>, or to group properties into categories.</p>
<p>A <code>class</code> can be used in validation rules to express extra constraints over named items of a specific <code>class</code> value. It is available for grouping, but unlike <code>group</code> is not expected specifically to designate any group membership as such.</p>
</remarks>
</define-flag>
<define-flag name="group" as-type="token">
<formal-name>Property Group</formal-name>
<description>An identifier for relating distinct sets of properties.</description>
<remarks>
<p>Different sets of properties may relate to separate contexts. Declare a group on a property to associate it with one or more other properties in a given context.</p>
</remarks>
</define-flag>
<model>
<field ref="remarks"/>
</model>
<constraint>
<allowed-values target=".[not(@ns) or @ns=('http://example.com/ns/computer')]/@name">
<enum value="marking">A label or descriptor that is tied to a sensitivity or classification marking system. An optional class can be used to define the specific marking system used for the associated value.</enum>
</allowed-values>
</constraint>
<remarks>
<p>A property can be included for any purpose useful to an application or implementation. Typically, properties will be used to sort, filter, select, order, and arrange content objects, to relate objects to one another, or to associate an object to class hierarchies, taxonomies, or external authorities. Thus, the lexical composition of properties may be constrained by external processes to ensure consistency.</p>
<p>Property allows for associated remarks that describe why the specific property value was applied to the containing object, or the significance of the value in the context of the containing object.</p>
</remarks>
</define-assembly>
</METASCHEMA>