This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapml.xsd
407 lines (338 loc) · 11.8 KB
/
apml.xsd
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.apml.org/apml-0.6"
xmlns:apml="http://www.apml.org/apml-0.6"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<!--
The root document type - a chunk containing nodes and links.
Basic outline:
<APML>
<Head />
<Body />
</APML>
-->
<xs:element name="APML">
<xs:complexType>
<xs:sequence>
<xs:element name="Head" type="apml:HeadType"/>
<xs:element name="Body" type="apml:BodyType"/>
</xs:sequence>
<!--
Defines the specification version this APML document currently adheres to.
Currently expected to be 0.6.
-->
<xs:attribute name="version" type="xs:string" use="required"/>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
</xs:element>
<!--
The document header. Provides basic administrative data about the APML document.
Basic outline:
<Head>
<Title/>
<Generator/>
<UserEmail/>
<DateCreated/>
</Head>
-->
<xs:complexType name="HeadType">
<xs:sequence>
<xs:element name="Title" type="xs:string"/>
<xs:element name="Generator" type="xs:string"/>
<xs:element name="UserEmail" type="apml:EmailType"/>
<xs:element name="DateCreated" type="apml:ISO8601DateType"/>
</xs:sequence>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!--
The document body. Contains the actual content of the user's APML data.
Basic outline:
<Body defaultprofile="">
<Profile />
<Profile />
<Applications/>
</Body>
-->
<xs:complexType name="BodyType">
<xs:sequence>
<!-- The list of profiles -->
<xs:element name="Profile" type="apml:ProfileType" minOccurs="1" maxOccurs="unbounded"/>
<!-- Provides application data storage -->
<xs:element name="Applications" type="apml:ApplicationsBlockType" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<!--
Specifies the default profile to use when either no user selection is made, or no user selection
can be made.
-->
<xs:attribute name="defaultprofile" type="xs:string" use="required"/>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!--
Details of a profile.
Basic outline:
<Profile name="">
<ImplicitData />
<ExplicitData />
</Profile>
-->
<xs:complexType name="ProfileType">
<xs:sequence>
<!-- Provides the implicit data associated with this profile -->
<xs:element name="ImplicitData" type="apml:ImplicitBlockType"/>
<!-- Provides the explicit data associated with this profile -->
<xs:element name="ExplicitData" type="apml:ExplicitBlockType"/>
</xs:sequence>
<!-- Provides the name of the profile -->
<xs:attribute name="name" type="xs:string" use="required"/>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!--
Details of implicit data - data that is automatically gathered.
Basic outline:
<ImplicitData>
<Concepts/>
<Sources/>
</ImplicitData>
-->
<xs:complexType name="ImplicitBlockType">
<xs:sequence>
<xs:element name="Concepts" type="apml:ImplicitConceptsBlockType" minOccurs="0" maxOccurs="1"/>
<xs:element name="Sources" type="apml:ImplicitSourcesBlockType" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!--
Details of explicit data - data that the user provides.
Basic outline:
<ExplicitData>
<Concepts/>
<Sources/>
</ExplicitData>
-->
<xs:complexType name="ExplicitBlockType">
<xs:sequence>
<xs:element name="Concepts" type="apml:ExplicitConceptsBlockType" minOccurs="0" maxOccurs="1"/>
<xs:element name="Sources" type="apml:ExplicitSourcesBlockType" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!--
Details of explit concepts and their scores
Basic Outline:
<Concepts>
<Concept key="" value=""/>
</Concepts>
-->
<xs:complexType name="ExplicitConceptsBlockType">
<xs:sequence>
<xs:element name="Concept" type="apml:ExplicitNodeType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!--
Details of explicit sources and their scores
Basic Outline:
<Sources>
<Source key="" value=""/>
</Sources>
-->
<xs:complexType name="ExplicitSourcesBlockType">
<xs:sequence>
<xs:element name="Source" type="apml:ExplicitSourceType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!--
Detail of explicit source and its authors.
Basic Outline:
<Source key="" name="" value="" type="">
<Author key="" value=""/>
-->
<xs:complexType name="ExplicitSourceType">
<xs:complexContent>
<xs:extension base="apml:ExplicitNodeType">
<xs:sequence>
<xs:element name="Author" type="apml:ExplicitNodeType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<!-- The (not necessarily unique) friendly name of the source -->
<xs:attribute name="name" type="xs:string" use="required" />
<!-- The type of the source. This is specified as a mime-type -->
<xs:attribute name="type" type="apml:MimeType" use="required" />
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
Details of implicit concepts and their scores
Basic Outline:
<Concepts>
<Concept key="" value="" from="" updated=""/>
</Concepts>
-->
<xs:complexType name="ImplicitConceptsBlockType">
<xs:sequence>
<xs:element name="Concept" type="apml:ImplicitNodeType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!--
Details of implicit sources and their scores
Basic Outline:
<Sources>
<Source key="" value="" from="" updated=""/>
</Sources>
-->
<xs:complexType name="ImplicitSourcesBlockType">
<xs:sequence>
<xs:element name="Source" type="apml:ImplicitSourceType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!--
Detail of implicit source and its authors
Basic Outline:
<Source key="" name="" value="" type="">
<Author key="" value="" from="" updated=""/>
</Source>
-->
<xs:complexType name="ImplicitSourceType">
<xs:complexContent>
<xs:extension base="apml:ImplicitNodeType">
<xs:sequence>
<xs:element name="Author" type="apml:ImplicitNodeType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<!-- The (not necessarily unique) friendly name of the source -->
<xs:attribute name="name" type="xs:string" use="required" />
<!-- The type of the source. This is specified as a mime-type -->
<xs:attribute name="type" type="apml:MimeType" use="required" />
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!--
List of application specific data
Basic Outline:
<Applications>
<Application name=""/>
</Applications>
-->
<xs:complexType name="ApplicationsBlockType">
<xs:sequence>
<!-- List of application elements -->
<xs:element name="Application" type="apml:ApplicationType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!--
Storage element for application data
Basic Outline:
<Application name="">
Application Data goes here
</Application>
-->
<xs:complexType name="ApplicationType">
<xs:sequence>
<xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="skip" />
</xs:sequence>
<!-- The unique name of the application -->
<xs:attribute name="name" type="xs:string" use="required"/>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!-- -->
<!-- Base Types -->
<!-- -->
<!--
Defines an Explicit Node - a node containing data explicitly specified by a user.
-->
<xs:complexType name="ExplicitNodeType">
<!-- Provides the text or value of the node, such as a name or a term -->
<xs:attribute name="key" type="xs:string" use="required"/>
<!-- Provides the rank (or score) of the node -->
<xs:attribute name="value" type="apml:NodeValueType" use="required"/>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:complexType>
<!--
Defines an Implicit Node - a node containing data automatically/programmatically discovered
by an application
-->
<xs:complexType name="ImplicitNodeType">
<xs:complexContent>
<xs:extension base="apml:ExplicitNodeType">
<!--
Contains a unique application identifier that allows each application to determine
the nodes that they have contributed. This, however, should not be used as a filter
when reading the data.
-->
<xs:attribute name="from" type="xs:string" use="required"/>
<!--
A date indicating the last time this value was updated. Nodes older than 30 days
should be considered deprecated by other applications, and thus ignored.
This ensures that if an application that was contributing to an APML profile no longer
continues being used, it data will not result in the profile being stale.
-->
<xs:attribute name="updated" type="apml:ISO8601DateType" use="required"/>
<!-- Allow additional attributes -->
<xs:anyAttribute/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- -->
<!-- Simple Data Types -->
<!-- -->
<!--
The ISO8601-style date type. Accepted examples include:
2007-03-09T22:35:56Z
NOTE: Only a subset of ISO8601 formats are accepted. In
particular, the time zone must be "Z"
-->
<xs:simpleType name="ISO8601DateType">
<xs:restriction base="xs:dateTime">
<!-- Restricts the dateTime format to only accept GMT times -->
<xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z"/>
</xs:restriction>
</xs:simpleType>
<!--
Defines an email address. This accepts any address in the format that contains one or more
non-@ characters, then an @, then two or more dot-seperated blocks not containing @ symbols.
-->
<xs:simpleType name="EmailType">
<xs:restriction base="xs:string">
<xs:pattern value="[^@]+[@][^@]+(\.[^.]+)+" />
</xs:restriction>
</xs:simpleType>
<!--
The Node Rank Type. Defines the ways in which a rank can be specified.
Accepted examples include:
-0.5, 0, 0.5 (Bounded between -1 and 1)
-->
<xs:simpleType name="NodeValueType">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="-1"/>
<xs:maxInclusive value="1"/>
</xs:restriction>
</xs:simpleType>
<!--
Defines a mime-type. This accepts a string containing two parts divided by a '/'.
-->
<xs:simpleType name="MimeType">
<xs:restriction base="xs:string">
<xs:pattern value="[^/]+/[^/]+" />
</xs:restriction>
</xs:simpleType>
</xs:schema>