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

Last change on this file was 5756, checked in by olhsha@mpi.nl, 10 years ago

fixing typo in schema

File size: 14.5 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3Copyright (C) 2013 DASISH
4
5This program is free software; you can redistribute it and/or
6modify it under the terms of the GNU General Public License
7as published by the Free Software Foundation; either version 2
8of the License, or (at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18-->
19
20<xs:schema targetNamespace="http://www.dasish.eu/ns/addit"
21           xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
22           xmlns:dasish="http://www.dasish.eu/ns/addit">
23    <xs:import namespace="http://www.w3.org/XML/1998/namespace"
24               schemaLocation="http://www.w3.org/2005/08/xml.xsd"/>
25
26    <xs:complexType name="List">
27        <xs:sequence/>
28    </xs:complexType>
29   
30 
31    <xs:complexType name="ReferenceList">
32        <xs:complexContent>
33            <xs:extension base="dasish:List">
34                <xs:sequence>                   
35                    <xs:element name="href" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
36                </xs:sequence>
37            </xs:extension>
38        </xs:complexContent>
39    </xs:complexType>
40
41
42    <xs:complexType name="CachedRepresentationInfo">
43        <xs:sequence>
44            <xs:element name="mimeType" type="xs:string" minOccurs="1" maxOccurs="1"/>
45            <xs:element name="tool" type="xs:string" minOccurs="1" maxOccurs="1"/>
46            <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1"/>
47        </xs:sequence>
48        <xs:attribute name="href" type="xs:anyURI" use="required"/>
49        <xs:attribute ref="xml:id" use="required"/>
50    </xs:complexType>
51
52    <!-- used in the target -->
53    <xs:complexType name="CachedRepresentationFragment">
54        <xs:sequence>
55            <xs:element name="fragmentString" type="xs:string" minOccurs="1" maxOccurs="1"/>
56        </xs:sequence>
57        <xs:attribute name="href" type="xs:anyURI" use="required"/>
58    </xs:complexType>
59   
60    <xs:complexType name="CachedRepresentationFragmentList">
61        <xs:complexContent>
62            <xs:extension base="dasish:List">
63                <xs:sequence>
64                    <xs:element name="cached" type="dasish:CachedRepresentationFragment" minOccurs="0" maxOccurs="unbounded"/>
65                </xs:sequence>
66            </xs:extension>
67        </xs:complexContent>
68    </xs:complexType>
69   
70
71    <xs:complexType name="Target">
72        <xs:sequence>
73            <xs:element name="lastModified" type="xs:dateTime" minOccurs="1" maxOccurs="1"/>
74            <xs:element name="link" type="xs:anyURI" minOccurs="1" maxOccurs="1"/>
75            <xs:element name="version" type="xs:string" minOccurs="1" maxOccurs="1"/>
76            <xs:element name="siblingTargets" type="dasish:ReferenceList" minOccurs="1"/>
77            <xs:element name="cachedRepresentations" type="dasish:CachedRepresentationFragmentList"
78                minOccurs="1"/>
79        </xs:sequence>
80        <xs:attribute name="href" type="xs:anyURI" use="required"/>
81        <xs:attribute ref="xml:id" use="required"/>
82    </xs:complexType>
83
84
85    <xs:complexType name="TargetInfo">
86        <xs:sequence>
87            <xs:element name="link" type="xs:anyURI" minOccurs="1" maxOccurs="1"/>
88            <xs:element name="version" type="xs:string" minOccurs="1" maxOccurs="1"/>
89        </xs:sequence>       
90        <xs:attribute name="href" type="xs:anyURI" use="required"/>
91    </xs:complexType>
92
93    <xs:complexType name="TargetInfoList">
94        <xs:complexContent>
95            <xs:extension base="dasish:List">
96                <xs:sequence>
97                    <xs:element name="targetInfo" type="dasish:TargetInfo" minOccurs="0"
98                                maxOccurs="unbounded"/>
99                </xs:sequence>
100            </xs:extension>
101        </xs:complexContent>
102    </xs:complexType>
103
104
105    <xs:complexType name="Principal">
106        <xs:sequence>           
107            <xs:element name="displayName" type="xs:string" minOccurs="1" maxOccurs="1"/>
108            <xs:element name="eMail" type="xs:string" minOccurs="1" maxOccurs="1"/>   
109        </xs:sequence>
110        <xs:attribute name="href" type="xs:anyURI" use="required"/>
111        <xs:attribute ref="xml:id" use="required"/>   
112    </xs:complexType>
113
114
115    <xs:complexType name="CurrentPrincipalInfo">
116        <xs:sequence>           
117            <xs:element name="currentPrincipal" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
118        </xs:sequence>
119        <xs:attribute name="href" type="xs:anyURI" use="required"/>
120    </xs:complexType>
121
122    <xs:complexType name="CurrentPrincipalInfoList">
123        <xs:complexContent>
124            <xs:extension base="dasish:List">
125                <xs:sequence>
126                    <xs:element name="currentPrincipalInfo" type="dasish:CurrentPrincipalInfo" minOccurs="0"
127                                maxOccurs="unbounded"/>
128                </xs:sequence>
129            </xs:extension>
130        </xs:complexContent>
131    </xs:complexType>
132
133    <xs:simpleType name="Access">
134        <xs:restriction base="xs:string">
135            <xs:enumeration value="read"/>
136            <xs:enumeration value="write"/>
137            <xs:enumeration value="none"/>
138        </xs:restriction>
139    </xs:simpleType>
140
141    <xs:complexType name="Permission">
142        <xs:attribute name="principalHref" type="xs:anyURI" use="required"/>
143        <xs:attribute name="level" type="dasish:Access" use="required"/>
144    </xs:complexType>
145
146    <xs:complexType name="PermissionList">
147        <xs:complexContent>
148            <xs:extension base="dasish:List">
149                <xs:sequence>
150                    <xs:element name="permission" type="dasish:Permission"
151                                minOccurs="0" maxOccurs="unbounded"/>
152                </xs:sequence>
153                <xs:attribute name="public" type="dasish:Access" use="required"/>
154            </xs:extension>
155        </xs:complexContent>
156    </xs:complexType>
157
158
159    <xs:complexType name="Annotation">
160        <xs:sequence>           
161            <xs:element name="ownerHref" type="xs:anyURI"  minOccurs="1" maxOccurs="1"/>           
162            <xs:element name="headline" type="xs:string"  minOccurs="1" maxOccurs="1"/>
163            <xs:element name="lastModified" type="xs:dateTime"  minOccurs="1" maxOccurs="1"/>
164            <xs:element name="body" type="dasish:AnnotationBody" minOccurs="1" maxOccurs="1"/>
165            <xs:element name="targets" type="dasish:TargetInfoList" minOccurs="1" maxOccurs="1"/>
166            <xs:element name="permissions" type="dasish:PermissionList" minOccurs="1"
167                        maxOccurs="1"/>
168        </xs:sequence>
169        <xs:attribute name="href" type="xs:anyURI" use="required"/>
170        <xs:attribute ref="xml:id" use="required"/>
171    </xs:complexType>
172
173
174    <xs:complexType name="AnnotationInfo">
175        <xs:sequence>
176            <xs:element name="ownerHref" type="xs:anyURI"  minOccurs="1" maxOccurs="1"/>                 
177            <xs:element name="headline" type="xs:string"  minOccurs="1" maxOccurs="1"/>
178            <xs:element name="lastModified" type="xs:dateTime"  minOccurs="1" maxOccurs="1"/>
179            <xs:element name="targets" type="dasish:ReferenceList" minOccurs="1" maxOccurs="1"
180            />
181        </xs:sequence>
182        <xs:attribute name="href" type="xs:anyURI" use="required"/>
183    </xs:complexType>
184
185    <xs:complexType name="AnnotationInfoList">
186        <xs:complexContent>
187            <xs:extension base="dasish:List">
188                <xs:sequence>
189                    <xs:element name="annotationInfo" type="dasish:AnnotationInfo" minOccurs="0"
190                                maxOccurs="unbounded"/>
191                </xs:sequence>
192            </xs:extension>
193        </xs:complexContent>
194    </xs:complexType>
195
196    <xs:complexType name="AnnotationBody">
197        <xs:choice>
198            <xs:element name="textBody">
199                <xs:complexType>
200                    <xs:sequence>
201                        <xs:element name="mimeType" type="xs:string" minOccurs="1" maxOccurs="1"/>
202                        <xs:element name="body" type="xs:string" minOccurs="1" maxOccurs="1"/>
203                    </xs:sequence>
204                </xs:complexType>
205            </xs:element>
206            <xs:element name="xmlBody">
207                <xs:complexType>
208                    <xs:sequence>
209                        <xs:element name="mimeType" type="xs:string" minOccurs="1" maxOccurs="1"/>
210                        <xs:any minOccurs="1" maxOccurs="1" processContents="skip"/>
211                    </xs:sequence>
212                </xs:complexType>
213            </xs:element>
214        </xs:choice>
215    </xs:complexType>
216
217
218    <xs:complexType name="Notebook">
219        <xs:sequence>
220            <xs:element name="ownerRef" type="xs:anyURI"  minOccurs="1" maxOccurs="1"/>
221            <xs:element name="title" type="xs:string" minOccurs="1" maxOccurs="1"/>
222            <xs:element name="lastModified" type="xs:dateTime" minOccurs="1" maxOccurs="1"/>
223            <xs:element name="annotations" type="dasish:ReferenceList" minOccurs="1" maxOccurs="1"/>
224            <xs:element name="permissions" type="dasish:PermissionList" minOccurs="1"
225                        maxOccurs="1"/>
226        </xs:sequence>
227        <xs:attribute name="href" type="xs:anyURI" use="required"/>
228        <xs:attribute ref="xml:id" use="required"/>
229    </xs:complexType>
230
231
232    <xs:complexType name="NotebookInfo">
233        <xs:sequence>
234            <xs:element name="ownerHref" type="xs:anyURI"  minOccurs="1" maxOccurs="1"/>             
235            <xs:element name="title" type="xs:string" minOccurs="1" maxOccurs="1"/>           
236        </xs:sequence>
237        <xs:attribute name="href" type="xs:anyURI" use="required"/>
238    </xs:complexType>
239
240    <xs:complexType name="NotebookInfoList">
241        <xs:complexContent>
242            <xs:extension base="dasish:List">
243                <xs:sequence>
244                    <xs:element name="notebookInfo" type="dasish:NotebookInfo" minOccurs="0"
245                                maxOccurs="unbounded"/>
246                </xs:sequence>
247            </xs:extension>
248        </xs:complexContent>
249    </xs:complexType>
250
251    <!--- Envelopes -->
252
253    <xs:simpleType name="AnnotationActionName">
254        <xs:restriction base="xs:string">
255            <xs:enumeration value="CREATE_CACHED_REPRESENTATION"/>
256        </xs:restriction>
257    </xs:simpleType>
258
259    <xs:simpleType name="PermissionActionName">
260        <xs:restriction base="xs:string">
261            <xs:enumeration value="PROVIDE_PRINCIPAL_INFO"/>
262        </xs:restriction>
263    </xs:simpleType>
264   
265   
266
267    <xs:complexType name="Action">
268        <xs:sequence>
269            <xs:element name="object" type="xs:anyURI" minOccurs="1" maxOccurs="1"/>
270            <xs:element name="message" type="xs:string" minOccurs="0" maxOccurs="1"/>
271        </xs:sequence>
272    </xs:complexType>
273
274
275    <xs:complexType name="ActionList">
276        <xs:complexContent>
277            <xs:extension base="dasish:List">
278                <xs:sequence>
279                    <xs:element name="action" type="dasish:Action" minOccurs="0" maxOccurs="unbounded"/>
280                </xs:sequence>
281            </xs:extension>
282        </xs:complexContent>
283    </xs:complexType>
284
285    <!-- response envelope (not a resource, used for all response on POST/PUT requests) -->
286
287    <!-- "envelope"-->
288    <xs:complexType name="ResponseBody">
289        <xs:sequence>
290            <xs:choice>
291                <xs:element name="annotation" type="dasish:Annotation"/>
292                <xs:element name="permissions" type="dasish:PermissionList"/>
293                <xs:element name="notebook" type="dasish:Notebook"/>
294            </xs:choice>
295            <xs:element name="actionList" type="dasish:ActionList" minOccurs="1"
296                        maxOccurs="1"/>
297        </xs:sequence>
298    </xs:complexType>
299
300   
301    <!-- above: consistency check is left to "schematron":
302        it has to check if the list objects for CREATE_CACHED_REPRESENTATION(s) conisides with unresolved targets in the content element-annotation
303        the same for permission lists
304    -->
305
306
307    <!-- ############ ELEMENTS ################# !-->
308
309    <!-- complex types -->
310
311    <xs:element name="action" type="dasish:Action"/>
312   
313    <xs:element name="actionList" type="dasish:ActionList"/>
314
315    <xs:element name="annotation" type="dasish:Annotation"/>
316
317    <xs:element name="annotationBody" type="dasish:AnnotationBody"/>
318
319    <xs:element name="annotationInfo" type="dasish:AnnotationInfo"/>
320
321    <xs:element name="annotationInfoList" type="dasish:AnnotationInfoList"/>
322
323    <xs:element name="annotationList" type="dasish:ReferenceList"/>
324
325    <xs:element name="cachedRepresentationInfo" type="dasish:CachedRepresentationInfo"/>
326
327    <xs:element name="cachedRepresentationList" type="dasish:ReferenceList"/>
328   
329    <xs:element name="cachedRepresentationFragment" type="dasish:CachedRepresentationFragment"/>
330   
331    <xs:element name="cachedRepresentationFragmentList" type="dasish:CachedRepresentationFragmentList"/>
332
333    <xs:element name="list" type="dasish:List"/>
334
335    <xs:element name="notebook" type="dasish:Notebook"/>
336
337    <xs:element name="notebookInfo" type="dasish:NotebookInfo"/>
338
339    <xs:element name="notebookInfoList" type="dasish:NotebookInfoList"/>
340
341    <xs:element name="notebookList" type="dasish:ReferenceList"/>
342
343    <xs:element name="permissionList" type="dasish:PermissionList"/>
344
345    <xs:element name="responseBody" type="dasish:ResponseBody"/>
346
347    <xs:element name="target" type="dasish:Target"/>
348
349    <xs:element name="targetInfo" type="dasish:TargetInfo"/>
350
351    <xs:element name="targetInfoList" type="dasish:TargetInfoList"/>
352
353    <xs:element name="targetList" type="dasish:ReferenceList"/>
354
355    <xs:element name="principal" type="dasish:Principal"/>
356
357    <xs:element name="currentPrincipalInfo" type="dasish:CurrentPrincipalInfo"/>
358
359    <xs:element name="currentPrincipalInfoList" type="dasish:CurrentPrincipalInfoList"/>
360       
361    <xs:element name="principalList" type="dasish:ReferenceList"/>
362       
363    <xs:element name="referenceList" type="dasish:ReferenceList"/>
364   
365    <xs:element name="access" type="dasish:Access"/>
366
367    <!-- Simple types -->
368
369    <xs:element name="annotationActionName" type="dasish:AnnotationActionName"/>
370    <xs:element name="permission" type="dasish:Permission"/>
371    <xs:element name="permissionActionName" type="dasish:PermissionActionName"/>
372</xs:schema>
Note: See TracBrowser for help on using the repository browser.