Record Schema Negotiation Example

Version 1.1, 12th January 2004

Introduction

This document is an example of how to create an extension to the SRW protocol. It is not part of the protocol itself, nor should it be considered 'approved' or 'endorsed' as an extension.

The purpose of the Record Schema Negotiation Extension is to allow the client to propose multiple record schemas that it will accept in response and let the server select one, rather than the client giving the server an ultimatum as to which record schema to return. Therefore this extension modifies the base semantics of the protocol, as the record schema URI in the response may not be the one in the recordSchema parameter of the request.

Extension Parameters

This is version 1.0 of the Record Schema Negotation Extension.

The extension's namespace is: http://srw.cheshire3.org/extensions/schemaNegotiation/1.0/
When used with SRU, the prefix 'c3o_rsn-' should be put before the parameter name.

The extension defines one parameter for the request: schemaNegotation.

This parameter contains a single string. The string is a space separated list of record schema URIs or short names. If this extension is supported, then the server should select one of these record schemas rather than the recordSchema request parameter. The selected record schema's URI should be in the recordSchema field of the record as usual. The server may select different schemas for records within the same response. It is recommended to include a recordSchema parameter for cases when the server does not support this extension.

In SRU, this parameter should be rendered as: x-c3o_rsn-schemaNegotation

Example

Given the request:

 <searchRetrieveRequest>
   <version>1.1</version>
   <query>dc.title any "cat dog"</query>
   <recordSchema>dc</recordSchema>
   <extraRequestData>
     <rsn:schemaNegotiation xmlns:rsn="http://srw.cheshire3.org/extensions/schemaNegotiation/1.0/">
         dc ccg marcxml
     </rsn:schemaNegotation>
   </extraRequestData>
 </searchRetrieveRequest>  

Or the equivalent request in SRU:

 http://srw.cheshire3.org/l5r?operation=searchRetrieve&version=1.1
     &query=dc.title%20any%20%3Dcat dog%3D&recordSchema=dc
     &x-c3o_rsn-schemaNegotation=dc%20ccg%20marcxml

Then the server may select any of DC, CCG or MarcXML as the record schema for any record returned in the response.