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

Last change on this file since 4722 was 4722, checked in by olhsha@mpi.nl, 11 years ago

removing owner as a possible value for permissions in schema.

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