source: FederatedSearch/schema/Resource.xsd @ 4503

Last change on this file since 4503 was 4503, checked in by oschonef, 10 years ago
  • add vc:maxVersion attributes
  • always wrap <Collection> in <Collections>
File size: 7.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3    xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
4    xmlns:fcs="http://clarin.eu/fcs/1.0"
5    xmlns:h="http://www.w3.org/1999/xhtml"
6    xml:lang="en" vc:minVersion="1.0" vc:maxVersion="1.1"
7    targetNamespace="http://clarin.eu/fcs/1.0" elementFormDefault="qualified">
8    <xs:annotation>
9        <xs:documentation>
10            <h:p>
11                This XML schema defines the inner structure of a hit within the
12                search result in the CLARIN federated content search (CLARIN-FCS).
13            </h:p>
14            <h:p>
15                Every hit in the result set must be represented as one
16                <h:code>&lt;sru:record&gt;</h:code> element in the
17                <h:code>&lt;sru:searchRetrieveResponse;gt;</h:code> response
18                document.
19            </h:p>
20            <h:p>
21                This schema allows Endpoint to return:
22            </h:p>
23            <h:ul>
24                <h:li>metadata about the matched record, including
25                    reference to a CMDI record</h:li>
26                <h:li>separate (metadata) description of full
27                    Resource and ResourceFragment (matching part of the
28                    resource, i.e. an addressable sentence)</h:li>
29                <h:li>various views on the data delivered (HITS, text-snippet,
30                    image, individual annotation-layers, ...)</h:li>
31                <h:li>providing links (either as PID or as
32                    simple URLs) to any of: Resource, ResourceFragment,
33                    Metadata (CMDI record), Data Views</h:li>
34                <h:li>Endpoint specific extensions through an
35                    extension mechanism</h:li>
36            </h:ul>
37         </xs:documentation>
38    </xs:annotation>
39
40    <xs:element name="Resource" type="fcs:ResourceType">
41        <xs:annotation>
42            <xs:documentation>
43                <h:p>
44                    A one hit in a resource in one or more representations.
45                </h:p>
46            </xs:documentation>
47        </xs:annotation>
48    </xs:element>
49
50    <xs:complexType name="ResourceType">
51        <xs:sequence>
52            <!--
53              As long as there is no clear use-case, don't allow recursive Resources
54              <xs:element name="Resource" minOccurs="0" maxOccurs="unbounded" type="fcs:ResourceType"/>
55            -->
56            <xs:element name="DataView" type="fcs:DataViewType" minOccurs="0" maxOccurs="unbounded" />
57            <xs:element name="ResourceFragment" minOccurs="0" maxOccurs="unbounded">
58                <xs:annotation>
59                    <xs:documentation>
60                        <h:p>
61                            A one hit in a resource in one or more representations.
62                            Use this instead of a plain <h:code>&lt;Resource&gt;</h:code>, if the
63                            fragment can be addresses directly, e.g. a sentence in
64                            a corpus that can be addressed via a PID (with fragment)
65                            or a regular URI.
66                        </h:p>
67                    </xs:documentation>
68                </xs:annotation>
69                <xs:complexType>
70                    <xs:sequence>
71                        <xs:element maxOccurs="unbounded" minOccurs="0" name="DataView" type="fcs:DataViewType"/>
72                    </xs:sequence>
73                    <xs:attribute name="pid" type="fcs:PidType"/>
74                    <xs:attribute name="ref" type="fcs:ReferenceType"/>
75                </xs:complexType>
76            </xs:element>
77            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
78                <xs:annotation>
79                    <xs:documentation>
80                        <h:p>
81                            Extension point to allow Endpoints to add custom data to a resource.
82                            CLARIN-FCS clients SHOULD ignore any data they do not understand. 
83                        </h:p>
84                        <h:p>
85                            This extension mechanism can for example be used to provide hints
86                            to an (XSLT/XQuery) application that works directly on CLARIN-FCS,
87                            e.g. to allow it to generate back and forward links to
88                            navigate in the result set.
89                        </h:p>
90                    </xs:documentation>
91                </xs:annotation>
92            </xs:any>
93        </xs:sequence>
94        <xs:attribute name="pid" type="fcs:PidType"/>
95        <xs:attribute name="ref" type="fcs:ReferenceType"/>
96    </xs:complexType>
97
98    <xs:complexType name="DataViewType">
99        <xs:annotation>
100            <xs:documentation>
101                <h:p>
102                    A representation of a hit, e.g. a HITS, a Geolocation,
103                    an image, etc.
104                </h:p>
105                <h:p>
106                    A HITS Data View is mandatory for every hit in the result set.
107                </h:p>
108            </xs:documentation>
109        </xs:annotation>
110        <xs:sequence>
111            <xs:any namespace="##other" processContents="strict"/>
112        </xs:sequence>
113        <xs:attribute name="type" use="required">
114            <xs:annotation>
115                <xs:documentation>
116                    <h:p>
117                        The type of the content of the Data View as a MIME type.
118                    </h:p>
119                    <h:p>
120                        For the mandatory HITS Data View, use the MIME type
121                        <h:code>application/x-clarin-fcs-hits+xml</h:code>.
122                    </h:p>
123                </xs:documentation>
124            </xs:annotation>
125            <xs:simpleType>
126                <xs:restriction base="xs:string">
127                    <xs:pattern value="\w+/\w([\.\-]{0,1}\w)*(\+\w+){0,1}"/>
128                </xs:restriction>
129            </xs:simpleType>
130        </xs:attribute>
131        <xs:attribute name="pid" type="fcs:PidType"/>
132        <xs:attribute name="ref" type="fcs:ReferenceType"/>
133    </xs:complexType>
134
135    <xs:simpleType name="PidType">
136        <xs:annotation>
137            <xs:documentation>
138                <h:p>
139                    A persistent identifier of given entity. This attribute
140                    should be used, if a PID is available for the given entity.
141                </h:p>
142                <h:p>
143                    An Endpoint SHOULD also make the PID available tough the
144                    <h:code>&lt;sru:recordIdentifier&gt;</h:code> element of
145                    the <h:code>&lt;sru:record&gt;/</h:code> element.
146                    If more PIDs are available for one record (i.e. Resource,
147                    Metadata, the individual Data View), the Endpoint is MUST
148                    to put the "most important" (e.g. the primary) PID into the
149                    <h:code>&lt;sru:recordIdentifier&gt;</h:code> element.
150                </h:p>
151            </xs:documentation>
152        </xs:annotation>
153        <xs:restriction base="xs:anyURI"/>
154    </xs:simpleType>
155
156    <xs:simpleType name="ReferenceType">
157        <xs:annotation>
158            <xs:documentation>
159                <h:p>
160                    A regular URI for the given entity, that can be retrieved
161                    directly (via HTTP or HTTPS).
162                </h:p>
163                <h:p>
164                    This URI may include custom Endpoint specific query strings
165                    to implement features like hit highlighting.
166                </h:p>
167            </xs:documentation>
168        </xs:annotation>
169        <xs:restriction base="xs:anyURI"/>
170    </xs:simpleType>
171</xs:schema>
Note: See TracBrowser for help on using the repository browser.