source: DASISH/t5.6/schema/trunk/annotator-schema/src/main/resources/DASISH-schema.xsd @ 4147

Last change on this file since 4147 was 4147, checked in by olhsha, 10 years ago

lastModified instead of timeStamp

File size: 12.3 KB
Line 
1<?xml version="1.1" encoding="UTF-8"?>
2<xs:schema targetNamespace="http://www.dasish.eu/ns/addit"
3    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
4    xmlns:dasish="http://www.dasish.eu/ns/addit">
5    <xs:import namespace="http://www.w3.org/XML/1998/namespace"
6        schemaLocation="http://www.w3.org/2005/08/xml.xsd"/>
7
8    <xs:complexType name="List">
9        <xs:sequence/>
10    </xs:complexType>
11
12    <xs:complexType name="ReferenceList">
13        <xs:complexContent>
14            <xs:extension base="dasish:List">
15                <xs:sequence>
16                    <xs:element name="ref" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
17                </xs:sequence>
18            </xs:extension>
19        </xs:complexContent>
20    </xs:complexType>
21
22
23    <xs:complexType name="CachedRepresentationInfo">
24        <xs:attribute name="URI" type="xs:anyURI" use="required"/>
25        <xs:attribute name="mimeType" type="xs:string" use="required"/>
26        <xs:attribute name="tool" type="xs:string" use="required"/>
27        <xs:attribute name="type" type="xs:string" use="required"/>
28    </xs:complexType>
29
30   <!-- used in the target -->
31    <xs:complexType name="CachedRepresentationFragment">
32        <xs:attribute name="ref" type="xs:anyURI" use="required"/>
33        <xs:attribute name="fragmentString" type="xs:string" use="required"/>
34    </xs:complexType>
35   
36    <xs:complexType name="CachedRepresentationFragmentList">
37        <xs:complexContent>
38            <xs:extension base="dasish:List">
39                <xs:sequence>
40                    <xs:element name="cached" type="dasish:CachedRepresentationFragment" minOccurs="0" maxOccurs="unbounded"/>
41                </xs:sequence>
42            </xs:extension>
43        </xs:complexContent>
44    </xs:complexType>
45   
46
47    <xs:complexType name="Target">
48        <xs:sequence>
49            <xs:element name="siblingTargets" type="dasish:ReferenceList" minOccurs="1"/>     
50            <xs:element name="cachedRepresentatinons" type="dasish:CachedRepresentationFragmentList" minOccurs="1"/>
51        </xs:sequence>
52        <xs:attribute name="URI" type="xs:anyURI" use="required"/>
53        <xs:attribute name="lastModified" type="xs:dateTime" use="required"/>
54        <xs:attribute name="link" type="xs:anyURI" use="required"/>
55        <xs:attribute name="version" type="xs:string" use="required"/>
56        <xs:attribute name="fragmentDescriptor" type="xs:string" use="required"/>
57    </xs:complexType>
58
59
60    <xs:complexType name="TargetInfo">
61        <xs:attribute name="ref" type="xs:anyURI" use="required"/>
62        <xs:attribute name="link" type="xs:anyURI" use="required"/>
63        <xs:attribute name="version" type="xs:string" use="required"/>
64    </xs:complexType>
65
66    <xs:complexType name="TargetInfoList">
67        <xs:complexContent>
68            <xs:extension base="dasish:List">
69                <xs:sequence>
70                    <xs:element name="targetInfo" type="dasish:TargetInfo" minOccurs="0"
71                        maxOccurs="unbounded"/>
72                </xs:sequence>
73            </xs:extension>
74        </xs:complexContent>
75    </xs:complexType>
76
77
78    <xs:complexType name="User">
79        <xs:attribute name="URI" type="xs:anyURI" use="required"/>
80        <xs:attribute name="displayName" type="xs:string" use="required"/>
81        <xs:attribute name="eMail" type="xs:string" use="required"/>
82    </xs:complexType>
83
84
85    <xs:complexType name="CurrentUserInfo">
86        <xs:attribute name="ref" type="xs:anyURI" use="required"/>
87        <xs:attribute name="currentUser" type="xs:boolean" use="required"/>
88    </xs:complexType>
89
90    <xs:complexType name="CurrentUserInfoList">
91        <xs:complexContent>
92            <xs:extension base="dasish:List">
93                <xs:sequence>
94                    <xs:element name="currentUserInfo" type="dasish:CurrentUserInfo" minOccurs="0"
95                        maxOccurs="unbounded"/>
96                </xs:sequence>
97            </xs:extension>
98        </xs:complexContent>
99    </xs:complexType>
100
101    <xs:simpleType name="Permission">
102        <xs:restriction base="xs:string">
103            <xs:enumeration value="owner"/>
104            <xs:enumeration value="reader"/>
105            <xs:enumeration value="writer"/>
106        </xs:restriction>
107    </xs:simpleType>
108
109    <xs:complexType name="UserWithPermission">
110        <xs:attribute name="ref" type="xs:anyURI" use="required"/>
111        <xs:attribute name="permission" type="dasish:Permission" use="required"/>
112    </xs:complexType>
113
114    <xs:complexType name="UserWithPermissionList">
115        <xs:complexContent>
116            <xs:extension base="dasish:List">
117                <xs:sequence>
118                    <xs:element name="userWithPermission" type="dasish:UserWithPermission"
119                        minOccurs="0" maxOccurs="unbounded"/>
120                </xs:sequence>
121            </xs:extension>
122        </xs:complexContent>
123    </xs:complexType>
124
125
126    <xs:complexType name="Annotation">
127        <xs:sequence>
128            <xs:element name="body" type="dasish:AnnotationBody" minOccurs="1" maxOccurs="1"/>
129            <xs:element name="targets" type="dasish:TargetInfoList" minOccurs="1" maxOccurs="1"/>
130            <xs:element name="permissions" type="dasish:UserWithPermissionList" minOccurs="1"
131                maxOccurs="1"/>
132        </xs:sequence>
133        <xs:attribute name="URI" type="xs:anyURI" use="required"/>
134        <xs:attribute name="lastModified" type="xs:dateTime" use="required"/>
135        <xs:attribute name="ownerRef" type="xs:anyURI" use="required"/>
136        <xs:attribute name="headline" type="xs:string" use="required"/>
137    </xs:complexType>
138
139
140    <xs:complexType name="AnnotationInfo">
141        <xs:sequence>
142            <xs:element name="targets" type="dasish:ReferenceList" minOccurs="1" maxOccurs="1"
143            />
144        </xs:sequence>
145        <xs:attribute name="ref" type="xs:anyURI" use="required"/>
146        <xs:attribute name="lastModified" type="xs:dateTime" use="required"/>
147        <xs:attribute name="ownerRef" type="xs:anyURI" use="required"/>
148        <xs:attribute name="headline" type="xs:string" use="required"/>
149    </xs:complexType>
150
151    <xs:complexType name="AnnotationInfoList">
152        <xs:complexContent>
153            <xs:extension base="dasish:List">
154                <xs:sequence>
155                    <xs:element name="annotationInfo" type="dasish:AnnotationInfo" minOccurs="0"
156                        maxOccurs="unbounded"/>
157                </xs:sequence>
158            </xs:extension>
159        </xs:complexContent>
160    </xs:complexType>
161
162    <xs:complexType name="AnnotationBody">
163        <xs:choice>
164            <xs:element name="textBody">
165                <xs:complexType>
166                    <xs:simpleContent>
167                        <xs:extension base="xs:string">
168                            <xs:attribute name="mimeType" type="xs:string"/>
169                        </xs:extension>
170                    </xs:simpleContent>
171                </xs:complexType>
172            </xs:element>
173            <xs:element name="xmlBody">
174                <xs:complexType>
175                    <xs:sequence>
176                        <xs:any minOccurs="1" maxOccurs="1" processContents="skip"/>
177                    </xs:sequence>
178                    <xs:attribute name="mimeType" type="xs:string"/>
179                </xs:complexType>
180            </xs:element>
181        </xs:choice>
182    </xs:complexType>
183
184
185    <xs:complexType name="Notebook">
186        <xs:sequence>
187            <xs:element name="annotations" type="dasish:ReferenceList" minOccurs="1" maxOccurs="1"/>
188            <xs:element name="permissions" type="dasish:UserWithPermissionList" minOccurs="1"
189                maxOccurs="1"/>
190        </xs:sequence>
191        <xs:attribute name="URI" type="xs:anyURI" use="required"/>
192        <xs:attribute name="lastModified" type="xs:dateTime" use="required"/>
193        <xs:attribute name="title" type="xs:string" use="required"/>
194    </xs:complexType>
195
196
197    <xs:complexType name="NotebookInfo">
198        <xs:attribute name="ref" type="xs:anyURI" use="required"/>
199        <xs:attribute name="title" type="xs:string" use="required"/>
200    </xs:complexType>
201
202    <xs:complexType name="NotebookInfoList">
203        <xs:complexContent>
204            <xs:extension base="dasish:List">
205                <xs:sequence>
206                    <xs:element name="notebookInfo" type="dasish:NotebookInfo" minOccurs="0"
207                        maxOccurs="unbounded"/>
208                </xs:sequence>
209            </xs:extension>
210        </xs:complexContent>
211    </xs:complexType>
212
213    <!--- Envelopes -->
214
215    <xs:simpleType name="AnnotationActionName">
216        <xs:restriction base="xs:string">
217            <xs:enumeration value="CREATE_CACHED_REPRESENTATION"/>
218        </xs:restriction>
219    </xs:simpleType>
220
221    <xs:simpleType name="PermissionActionName">
222        <xs:restriction base="xs:string">
223            <xs:enumeration value="PROVIDE_USER_INFO"/>
224        </xs:restriction>
225    </xs:simpleType>
226   
227   
228
229    <xs:complexType name="Action">
230        <xs:attribute name="object" type="xs:anyURI" use="required"/>
231        <xs:attribute name="message" type="xs:string"/>
232    </xs:complexType>
233
234
235    <xs:complexType name="ActionList">
236        <xs:complexContent>
237            <xs:extension base="dasish:List">
238                <xs:sequence>
239                    <xs:element name="action" type="dasish:Action" minOccurs="0" maxOccurs="unbounded"/>
240                </xs:sequence>
241            </xs:extension>
242        </xs:complexContent>
243    </xs:complexType>
244
245    <!-- response envelope (not a resource, used for all response on POST/PUT requests) -->
246
247    <!-- "envelope"-->
248    <xs:complexType name="ResponseBody">
249        <xs:sequence>
250        <xs:choice>
251            <xs:element name="annotation" type="dasish:Annotation"/>
252            <xs:element name="permissions" type="dasish:UserWithPermissionList"/>
253        </xs:choice>
254            <xs:element name="actionList" type="dasish:ActionList" minOccurs="1"
255                maxOccurs="1"/>
256        </xs:sequence>
257    </xs:complexType>
258
259   
260    <!-- above: consistency check is left to "schematron":
261        it has to check if the list objects for CREATE_CACHED_REPRESENTATION(s) conisides with unresolved targets in the content element-annotation
262        the same for permission lists
263    -->
264
265
266    <!-- ############ ELEMENTS ################# !-->
267
268    <!-- complex types -->
269
270    <xs:element name="action" type="dasish:Action"/>
271   
272    <xs:element name="actionList" type="dasish:ActionList"/>
273
274    <xs:element name="annotation" type="dasish:Annotation"/>
275
276    <xs:element name="annotationBody" type="dasish:AnnotationBody"/>
277
278    <xs:element name="annotationInfo" type="dasish:AnnotationInfo"/>
279
280    <xs:element name="annotationInfoList" type="dasish:AnnotationInfoList"/>
281
282    <xs:element name="annotationList" type="dasish:ReferenceList"/>
283
284    <xs:element name="cashedRepresentationInfo" type="dasish:CachedRepresentationInfo"/>
285
286    <xs:element name="cashedRepresentationList" type="dasish:ReferenceList"/>
287   
288    <xs:element name="cachedRepresentationFragment" type="dasish:CachedRepresentationFragment"/>
289   
290    <xs:element name="cachedRepresentationFragmentList" type="dasish:CachedRepresentationFragmentList"/>
291
292    <xs:element name="list" type="dasish:List"/>
293
294    <xs:element name="notebook" type="dasish:Notebook"/>
295
296    <xs:element name="notebookInfo" type="dasish:NotebookInfo"/>
297
298    <xs:element name="notebookInfoList" type="dasish:NotebookInfoList"/>
299
300    <xs:element name="notebookList" type="dasish:ReferenceList"/>
301
302    <xs:element name="permissionList" type="dasish:UserWithPermissionList"/>
303
304    <xs:element name="responseBody" type="dasish:ResponseBody"/>
305
306    <xs:element name="target" type="dasish:Target"/>
307
308    <xs:element name="targetInfo" type="dasish:TargetInfo"/>
309
310    <xs:element name="targetInfoList" type="dasish:TargetInfoList"/>
311
312    <xs:element name="targetList" type="dasish:ReferenceList"/>
313
314    <xs:element name="user" type="dasish:User"/>
315
316    <xs:element name="currentUserInfo" type="dasish:CurrentUserInfo"/>
317
318    <xs:element name="currentUserInfoList" type="dasish:CurrentUserInfoList"/>
319
320    <xs:element name="userList" type="dasish:ReferenceList"/>
321
322    <xs:element name="referenceList" type="dasish:ReferenceList"/>
323
324    <!-- Simple types -->
325
326    <xs:element name="annotationActionName" type="dasish:AnnotationActionName"/>
327    <xs:element name="permission" type="dasish:Permission"/>
328    <xs:element name="permissionActionName" type="dasish:PermissionActionName"/>
329</xs:schema>
Note: See TracBrowser for help on using the repository browser.