Changeset 2428 for FederatedSearch


Ignore:
Timestamp:
12/14/12 14:52:22 (11 years ago)
Author:
oschonef
Message:
  • change @typo for DataView? to be a MIME type
  • re-factor XML schema
  • update documentation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • FederatedSearch/Resource.xsd

    r1930 r2428  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fcs="http://clarin.eu/fcs/1.0"
    3     targetNamespace="http://clarin.eu/fcs/1.0" elementFormDefault="qualified">
     2<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
     3    xmlns:fcs="http://clarin.eu/fcs/1.0" xmlns="http://www.w3.org/1999/xhtml"
     4    targetNamespace="http://clarin.eu/fcs/1.0" elementFormDefault="qualified" xml:lang="en">
    45    <xs:annotation>
    5         <xs:documentation>This schema shall define the generic inner structure
    6             of one record within the (federated) CLARIN content search.
    7             This means it would validate the xml-fragment inside sru:record/sru:recordData
    8             and would be referenced in sru:record/sru:recordSchema
    9             of the sru:searchRetrieveResponse.
    10            
    11             It shall allow:
    12             a) any metadata about the matched record, including reference to a CMD-record
    13             b) separate (metadata) description of full Resource and ResourceFragment (matching part of the resource)
    14             c) providing metadata AND content
    15             d) various views on the data delivered (text-snippet, image, individual annotation-layers, ...)
    16             e) providing links (either as PID or as simple URLs) to any of:
    17                Resource, ResourceFragment, Metadata (CMD-record), DataViews           
     6        <xs:documentation>
     7            <p>
     8                This XML schema defined the inner structure of a hit within the
     9                search result in the CLARIN federated content search.
     10            </p>
     11            <p>
     12                Every hit in the result set must be represented at one
     13                &lt;sru:record&gt; in the &lt;sru:searchRetrieveResponse;gt;.
     14            </p>
     15            <p>
     16                It allows endpoint to return:
     17            </p>
     18            <ul>
     19                <li>metadata about the matched record, including
     20                    reference to a CMDI record</li>
     21                <li>separate (metadata) description of full
     22                    Resource and ResourceFragment (matching part of the
     23                    resource, i.e. an addressable sentence)</li>
     24                <li>providing metadata and content</li>
     25                <li>various views on the data delivered (KWIC, text-snippet,
     26                    image, individual annotation-layers, ...)</li>
     27                <li>providing links (either as PID or as simple URLs) to any of:
     28                    Resource, ResourceFragment, Metadata (CMDI record), DataViews</li>
     29            </ul>
    1830         </xs:documentation>
    1931    </xs:annotation>
    2032
    21     <xs:element name="Resource" type="fcs:ResourceType"/>
     33    <xs:element name="Resource" type="fcs:ResourceType">
     34        <xs:annotation>
     35            <xs:documentation>
     36                A one hit in a resource in one or more representations.
     37            </xs:documentation>
     38        </xs:annotation>
     39    </xs:element>
    2240
    2341    <xs:complexType name="ResourceType">
    2442        <xs:sequence>
    25             <xs:element maxOccurs="unbounded" minOccurs="0" name="Resource" type="fcs:ResourceType"/>
    26             <xs:element maxOccurs="unbounded" minOccurs="0" name="DataView" type="fcs:DataViewType"/>
    27             <xs:element maxOccurs="unbounded" minOccurs="0" name="ResourceFragment" type="fcs:ResourceFragmentType"/>
     43            <xs:element name="Resource" minOccurs="0" maxOccurs="unbounded" type="fcs:ResourceType"/>
     44            <xs:element name="DataView" minOccurs="0" maxOccurs="unbounded" type="fcs:DataViewType"/>
     45            <xs:element name="ResourceFragment" minOccurs="0" maxOccurs="unbounded">
     46                <xs:annotation>
     47                    <xs:documentation>
     48                        <p>
     49                            A one hit in a resource in one or more representations.
     50                            Use this instead of a plain &lt;Resource&gt;, if the
     51                            fragment can be addresses directly, e.g. a sentence in
     52                            a corpus that can be addressed via a PID (with fragment)
     53                            and/or a unique URI.
     54                        </p>
     55                    </xs:documentation>
     56                </xs:annotation>
     57                <xs:complexType>
     58                    <xs:sequence>
     59                        <xs:element maxOccurs="unbounded" minOccurs="0" name="DataView" type="fcs:DataViewType"/>
     60                    </xs:sequence>
     61                    <xs:attribute name="pid" type="fcs:PidType"/>
     62                    <xs:attribute name="ref" type="fcs:ReferenceType"/>
     63                </xs:complexType>
     64            </xs:element>
    2865        </xs:sequence>
    29         <xs:attribute name="pid" type="fcs:pidType" use="optional"/>
    30         <xs:attribute name="ref" type="fcs:refType" use="optional"/>
    31     </xs:complexType>
    32 
    33 
    34     <xs:complexType name="ResourceFragmentType">
    35         <xs:sequence>
    36             <xs:element maxOccurs="unbounded" minOccurs="0" name="DataView" type="fcs:DataViewType"/>
    37         </xs:sequence>
    38         <xs:attribute name="pid" type="fcs:pidType" use="optional"/>
    39         <xs:attribute name="ref" type="fcs:refType" use="optional"/>
     66        <xs:attribute name="pid" type="fcs:PidType"/>
     67        <xs:attribute name="ref" type="fcs:ReferenceType"/>
    4068    </xs:complexType>
    4169
     
    4371        <xs:annotation>
    4472            <xs:documentation>
    45                 The content expressed in XML that complies with another XML Schema (namespace=#other).
     73                <p>
     74                    A representation of a hit, e.g. a KWIC, a geo location, an image, etc.
     75                </p>
     76                <p>
     77                    A KWIC DataView is mandatory.
     78                </p>
    4679            </xs:documentation>
    4780        </xs:annotation>
     
    4982            <xs:any namespace="##other" processContents="strict"/>
    5083        </xs:sequence>
    51         <xs:attribute name="type" type="fcs:DataViewTypeType"/>
    52         <xs:attribute name="pid" type="fcs:pidType"/>
    53         <xs:attribute name="ref" type="fcs:refType"/>
     84        <xs:attribute name="type" use="required">
     85            <xs:annotation>
     86                <xs:documentation>
     87                    <p>
     88                        The type of the content of the DataView as a MIME type.
     89                        For the mandatory KWIC view, use "application/x-clarin-fcs-kwic+xml".
     90                    </p>
     91                </xs:documentation>
     92            </xs:annotation>
     93            <xs:simpleType>
     94                <xs:restriction base="xs:string">
     95                    <xs:pattern value="\w+/\w([\.\-]{0,1}\w)*(\+\w+){0,1}"/>
     96                </xs:restriction>
     97            </xs:simpleType>
     98        </xs:attribute>
     99        <xs:attribute name="pid" type="fcs:PidType"/>
     100        <xs:attribute name="ref" type="fcs:ReferenceType"/>
    54101    </xs:complexType>
    55102
    56     <xs:simpleType name="DataViewTypeType">
     103    <xs:simpleType name="PidType">
    57104        <xs:annotation>
    58105            <xs:documentation>
    59                 This is obviously not exhaustive. Could this be a superset of of MIME-type?
     106                <p>
     107                    A persistent identifier of given entity. This attribute
     108                    should be used, if a PID is available for the given entity.
     109                </p>
     110                <p>
     111                    An FCS endpoint should also &lt;sru:record&gt;/&lt;sru:recordIdentifier&gt; element.
     112                    If more PIDs are available for one record (i.e. Resource,
     113                    Metadata, DataView), the endpoint is supposed to put the
     114                    "most important" (e.g. the primary) PID into &lt;sru:recordIdentifier&gt;
     115                </p>
    60116            </xs:documentation>
    61         </xs:annotation>
    62         <xs:restriction base="xs:string">
    63             <xs:enumeration value="kwic"/>
    64             <xs:enumeration value="fulltext"/>
    65             <xs:enumeration value="image"/>
    66         </xs:restriction>
    67     </xs:simpleType>
    68 
    69     <xs:simpleType name="pidType">
    70         <xs:annotation>
    71             <xs:documentation>a persistent! identifier of given entity. This should be really only used, when a PID is available. Provider should also fill the sru:record/sru:recordIdentifier-element. If there are more PIDs in one record (for Resource, Metadata, DataView), provider selects the "most important"/primary PID to put into sru:recordIdentifier</xs:documentation>
    72117        </xs:annotation>
    73118        <xs:restriction base="xs:anyURI"/>
    74119    </xs:simpleType>
    75120
    76     <xs:simpleType name="refType">
     121    <xs:simpleType name="ReferenceType">
    77122        <xs:annotation>
    78             <xs:documentation>a URL to given entity, that can be invoked directly (via HTTP)</xs:documentation>
     123            <xs:documentation>
     124                <p>
     125                    A URI for the given entity, that can be retrieved directly
     126                    (via HTTP or HTTPS).
     127                </p>
     128            </xs:documentation>
    79129        </xs:annotation>
    80130        <xs:restriction base="xs:anyURI"/>
    81131    </xs:simpleType>
    82 
    83132</xs:schema>
Note: See TracChangeset for help on using the changeset viewer.