Version 1.1, 12th January 2004
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.
The basic request by which the client can search for and retrieve records, either from existing result sets or new ones.
| Name | Type | Required | Description |
|---|---|---|---|
| version | xsd:string | Mandatory | The highest version of the protocol which the client can support for the response. |
| query | xsd:string | Mandatory | Contains a query expressed in CQL to be processed by the server. |
| startRecord | xsd:integer | Optional | The 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. |
| maximumRecords | xsd:integer | Optional | The 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. |
| recordPacking | xsd:string | Optional | A 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'. |
| recordSchema | xsd:string | Optional | The 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 |
| recordXPath | xsd:string | Optional | An 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. |
| resultSetTTL | xsd:integer | Optional | The 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. |
| sortKeys | xsd:string | Optional | Contains 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. |
| stylesheet | xsd:anyURI | Optional | A 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. |
| extraRequestData | xmlFragment | Optional | This parameter contains XML data to provide additional, profile specific information along with the request. |
| Name | Type | Required | Description |
|---|---|---|---|
| version | xsd:string | Mandatory | The version of the response. This must be less than or equal to the version requested by the client. |
| numberOfRecords | xsd:integer | Mandatory | The number of records matched by the query. If the query fails this will be 0. |
| resultSetId | xsd:string | Optional | The identifier for a result set that was created through the execution of the query. |
| resultSetIdleTime | xsd:integer | Optional | The number of seconds in which the created result set will be deleted. The result set may become unavailable before this. |
| records | sequence of records | Optional | A sequence of records matched by the query, or surrogate diagnostics. |
| nextRecordPosition | xsd:integer | Optional | The 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. |
| diagnostics | sequence of diagnostics | Optional | A sequence of non surrogate diagnostics generated during execution. |
| extraResponseData | xmlFragment | Optional | Additional, profile specific information provided by the server along with the response. |
| echoedSearchRetrieveRequest | echoedSearchRetrieveRequest | Optional | The request parameters echoed back to the client in a simple XML form. Recommended for use with SRU, but may be returned in SRW. |
| Name | Type | Required | Description |
|---|---|---|---|
| version | xsd:string | Mandatory | The highest version of the protocol which the client can support for the response. |
| scanClause | xsd:string | Mandatory | A CQL search clause which determines the index, term format and start position for the scan. |
| responsePosition | xsd:integer | Optional | The 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. |
| maximumTerms | xsd:integer | Optional | The number of terms requested to be returned. All positive integers are valid for this parameter. If not specified, the default is server determined. |
| stylesheet | xsd:anyURI | Optional | The URL of a stylesheet to include in the response. This parameter is recommended for use with SRU, but may be included in SRW. |
| extraRequestData | xmlFragment | Optional | This parameter contains XML data to provide additional, profile specific information along with the request. |
| Name | Type | Required | Description |
|---|---|---|---|
| version | xsd:string | Mandatory | The version of the response. This must be less than or equal to the version requested by the client. |
| terms | sequence of term | Optional | A sequence of terms which match the request. |
| diagnostics | sequence of diagnostic | Optional | A sequence of non surrogate diagnostics generated during execution. |
| extraResponseData | xmlFragment | Optional | Additional, profile specific information provided by the server along with the response. |
| echoedScanRequest | echoedScanRequest | Optional | The request parameters echoed back to the client in a simple XML form. Recommended for use with SRU, but may be returned in SRW. |
| Name | Type | Required | Description |
|---|---|---|---|
| version | xsd:string | Mandatory | The highest version of the protocol which the client can support for the response. |
| recordPacking | xsd:string | Optional | This 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. |
| stylesheet | xsd:anyURI | Optional | The URL of a stylesheet to include in the response. This parameter is recommended for use with SRU, but may be included in SRW. |
| extraRequestData | xmlFragment | Optional | This parameter contains XML data to provide additional, profile specific information along with the request. |
| Name | Type | Required | Description |
|---|---|---|---|
| version | xsd:string | Mandatory | The version of the response. This must be less than or equal to the version requested by the client. |
| record | record | Mandatory | A record containing a ZeeRex document describing the server, or a diagnostic. |
| diagnostics | sequence of diagnostic | Optional | A sequence of non surrogate diagnostics generated during execution. |
| extraResponseData | xmlFragment | Optional | Additional, profile specific information provided by the server along with the response. |
| echoedExplainRequest | echoedScanRequest | Optional | The 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.