SRW Service Description

Version 1.1, 12th January 2004

Introduction

This document describes the operations defined in SRW. There are three operations available in version 1.1:

More information about the exact semantics of each parameter is available through the links from their descriptions.

The namespace for SRW xml is: http://www.loc.gov/zing/srw/
Note well that diagnostics and XCQL have their own namespaces, and hence these must be given if present in a response.

Example SRW and SRU messages are available. See the SRU page for more information about the differences between SRU and SRW.

searchRetrieve Operation

The basic request by which the client can search for and retrieve records, either from existing result sets or new ones.

searchRetrieveRequest

NameTypeRequiredDescription
versionxsd:stringMandatoryThe highest version of the protocol which the client can support for the response.
queryxsd:stringMandatoryContains a query expressed in CQL to be processed by the server.
startRecordxsd:integerOptionalThe position within the sequence of matched records of the first record to be returned. The first position in the sequence is 1. The value supplied must be greater than 0. Default value if not supplied is 1.
maximumRecordsxsd:integerOptionalThe number of records requested to be returned. The value must be 0 or greater. Default value if not supplied is determined by the server. The server may return less than this amount of records, for example if there are fewer matching records than requested.
recordPackingxsd:stringOptionalA string to determine how the record should be escaped in the response. Defined values are 'string' and 'xml'. The default for SRU is 'xml', the default for SRW is 'string'.
recordSchemaxsd:stringOptionalThe schema in which any records should be returned. The value is the URI identifer for the schema or the short name for it published by the server. The default value if not supplied is determined by the server
recordXPathxsd:stringOptionalAn XPath expression, relative to the recordSchema supplied, to be applied to the records before returning them. If not supplied, the complete record should be returned.
resultSetTTLxsd:integerOptionalThe number of seconds for which the client requests that any result set created should be maintained. The server may not agree to fulfil this request, and may return a different number of seconds that the result set will be maintained for. If not supplied then the server will determine the default value.
sortKeysxsd:stringOptionalContains a sequence of sort keys to be applied to the results, if any. The keys are expressed in the simple string format for sort in SRW.
stylesheetxsd:anyURIOptionalA string giving the URL to return as an xml stylesheet in the response. This parameter is recommended for use with SRU, but may be included in an SRW request.
extraRequestDataxmlFragmentOptionalThis parameter contains XML data to provide additional, profile specific information along with the request.

searchRetrieveResponse

NameTypeRequiredDescription
versionxsd:stringMandatoryThe version of the response. This must be less than or equal to the version requested by the client.
numberOfRecordsxsd:integerMandatoryThe number of records matched by the query. If the query fails this will be 0.
resultSetIdxsd:stringOptionalThe identifier for a result set that was created through the execution of the query.
resultSetIdleTimexsd:integerOptionalThe number of seconds in which the created result set will be deleted. The result set may become unavailable before this.
recordssequence of recordsOptionalA sequence of records matched by the query, or surrogate diagnostics.
nextRecordPositionxsd:integerOptionalThe next position within the result set after the final record returned. If there are no remaining records, this field should be omitted. Recommended for use with SRU, but may be returned in SRW.
diagnosticssequence of diagnosticsOptionalA sequence of non surrogate diagnostics generated during execution.
extraResponseDataxmlFragmentOptionalAdditional, profile specific information provided by the server along with the response.
echoedSearchRetrieveRequestechoedSearchRetrieveRequestOptionalThe request parameters echoed back to the client in a simple XML form. Recommended for use with SRU, but may be returned in SRW.

scan Operation

The operation used to browse indexes in the database.

scanRequest Parameters

NameTypeRequiredDescription
versionxsd:stringMandatoryThe highest version of the protocol which the client can support for the response.
scanClausexsd:stringMandatoryA CQL search clause which determines the index, term format and start position for the scan.
responsePositionxsd:integerOptionalThe position of the term in the response. The range of valid integers is 0 to the number of terms requested plus 1, inclusive. The default value is 1, if not specified.
maximumTermsxsd:integerOptionalThe number of terms requested to be returned. All positive integers are valid for this parameter. If not specified, the default is server determined.
stylesheetxsd:anyURIOptionalThe URL of a stylesheet to include in the response. This parameter is recommended for use with SRU, but may be included in SRW.
extraRequestDataxmlFragmentOptionalThis parameter contains XML data to provide additional, profile specific information along with the request.

scanResponse Parameters

NameTypeRequiredDescription
versionxsd:stringMandatoryThe version of the response. This must be less than or equal to the version requested by the client.
termssequence of termOptionalA sequence of terms which match the request.
diagnosticssequence of diagnosticOptionalA sequence of non surrogate diagnostics generated during execution.
extraResponseDataxmlFragmentOptionalAdditional, profile specific information provided by the server along with the response.
echoedScanRequestechoedScanRequestOptionalThe request parameters echoed back to the client in a simple XML form. Recommended for use with SRU, but may be returned in SRW.

explain Operation

The explain operation is used to retrieve a record describing the capabilities of the server.

explainRequest Parameters

NameTypeRequiredDescription
versionxsd:stringMandatoryThe highest version of the protocol which the client can support for the response.
recordPackingxsd:stringOptionalThis may be used to determine how the explain record should be escaped, and has the same possible values as the searchRetrieveRequest parameter of the same name, with the same defaults.
stylesheetxsd:anyURIOptionalThe URL of a stylesheet to include in the response. This parameter is recommended for use with SRU, but may be included in SRW.
extraRequestDataxmlFragmentOptionalThis parameter contains XML data to provide additional, profile specific information along with the request.

explainResponse Parameters

NameTypeRequiredDescription
versionxsd:stringMandatoryThe version of the response. This must be less than or equal to the version requested by the client.
recordrecordMandatoryA record containing a ZeeRex document describing the server, or a diagnostic.
diagnosticssequence of diagnosticOptionalA sequence of non surrogate diagnostics generated during execution.
extraResponseDataxmlFragmentOptionalAdditional, profile specific information provided by the server along with the response.
echoedExplainRequestechoedScanRequestOptionalThe request parameters echoed back to the client in a simple XML form. Recommended for use with SRU, but may be returned in SRW.

This operation is also available by HTTP GET at the base URL for the database with no parameters given for both SRW and SRU. In this case, the response will be in the SRU style without the SOAP envelope, and follow the SRU default of unescaped XML for the record. The server will determine the version of the response and any stylesheet.