source: FederatedSearch/schema/Resource.xsd

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