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

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

forgotten to commit changes in schema!!! (adding usir with permission element to make it JAXBeable

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