1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>6. Retrieval Facility</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="YAZ User's Guide and Reference"><link rel="up" href="tools.html" title="Chapter 9. Supporting Tools"><link rel="prev" href="marc.html" title="5. MARC"><link rel="next" href="odr.html" title="Chapter 10. The ODR Module"></head><body><link rel="stylesheet" type="text/css" href="common/style1.css"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6. Retrieval Facility</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="marc.html">Prev</a> </td><th width="60%" align="center">Chapter 9. Supporting Tools</th><td width="20%" align="right"> <a accesskey="n" href="odr.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="tools.retrieval"></a>6. Retrieval Facility</h2></div></div></div><p>
2 YAZ version 2.1.20 or later includes a Retrieval facility tool
3 which allows a SRU/Z39.50 to describe itself and perform record
4 conversions. The idea is the following:
6 </p><div class="itemizedlist"><ul type="disc"><li><p>
7 An SRU/Z39.50 client sends a retrieval request which includes
8 a combination of the following parameters: syntax (format),
9 schema (or element set name).
11 The retrieval facility is invoked with parameters in a
12 server/proxy. The retrieval facility matches the parameters a set of
13 "supported" retrieval types.
14 If there is no match, the retrieval signals an error
15 (syntax and / or schema not supported).
17 For a successful match, the backend is invoked with the same
18 or altered retrieval parameters (syntax, schema). If
19 a record is received from the backend, it is converted to the
20 frontend name / syntax.
22 The resulting record is sent back the client and tagged with
23 the frontend syntax / schema.
24 </p></li></ul></div><p>
26 The Retrieval facility is driven by an XML configuration. The
27 configuration is neither Z39.50 ZeeRex or SRU ZeeRex. But it
28 should be easy to generate both of them from the XML configuration.
29 (unfortunately the two versions
30 of ZeeRex differ substantially in this regard).
31 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="tools.retrieval.format"></a>6.1. Retrieval XML format</h3></div></div></div><p>
32 All elements should be covered by namespace
33 <code class="literal">http://indexdata.com/yaz</code> .
34 The root element node must be <code class="literal">retrievalinfo</code>.
36 The <code class="literal">retrievalinfo</code> must include one or
37 more <code class="literal">retrieval</code> elements. Each
38 <code class="literal">retrieval</code> defines specific combination of
39 syntax, name and identifier supported by this retrieval service.
41 The <code class="literal">retrieval</code> element may include any of the
43 </p><div class="variablelist"><dl><dt><span class="term"><code class="literal">syntax</code> (REQUIRED)</span></dt><dd><p>
44 Defines the record syntax. Possible values is any
45 of the names defined in YAZ' OID database or a raw
47 </p></dd><dt><span class="term"><code class="literal">name</code> (OPTIONAL)</span></dt><dd><p>
48 Defines the name of the retrieval format. This can be
49 any string. For SRU, the value, is equivalent to schema (short-hand);
50 for Z39.50 it's equivalent to simple element set name.
51 </p></dd><dt><span class="term"><code class="literal">identifier</code> (OPTIONAL)</span></dt><dd><p>
52 Defines the URI schema name of the retrieval format. This can be
53 any string. For SRU, the value, is equivalent to URI schema.
54 For Z39.50, there is no equivalent.
55 </p></dd></dl></div><p>
57 The <code class="literal">retrieval</code> may include one
58 <code class="literal">backend</code> element. If a <code class="literal">backend</code>
59 element is given, it specifies how the records are retrieved by
60 some backend and how the records are converted from the backend to
63 The attributes, <code class="literal">name</code> and <code class="literal">syntax</code>
64 may be specified for the <code class="literal">backend</code> element. These
65 semantics of these attributes is equivalent to those for the
66 <code class="literal">retrieval</code>. However, these values are passed to
69 The <code class="literal">backend</code> element may includes one or more
70 conversion instructions (as children elements). The supported
72 </p><div class="variablelist"><dl><dt><span class="term"><code class="literal">marc</code></span></dt><dd><p>
73 The <code class="literal">marc</code> element specifies a conversion
74 to - and from ISO2709 encoded MARC and
75 <a class="ulink" href="http://www.loc.gov/standards/marcxml/" target="_top"><acronym class="acronym">MARCXML</acronym></a>/MarcXchange.
76 The following attributes may be specified:
78 </p><div class="variablelist"><dl><dt><span class="term"><code class="literal">inputformat</code> (REQUIRED)</span></dt><dd><p>
79 Format of input. Supported values are
80 <code class="literal">marc</code> (for ISO2709); and <code class="literal">xml</code>
81 for MARCXML/MarcXchange.
82 </p></dd><dt><span class="term"><code class="literal">outputformat</code> (REQUIRED)</span></dt><dd><p>
83 Format of output. Supported values are
84 <code class="literal">line</code> (MARC line format);
85 <code class="literal">marcxml</code> (for MARCXML),
86 <code class="literal">marc</code> (ISO2709),
87 <code class="literal">marcxhcange</code> (for MarcXchange).
88 </p></dd><dt><span class="term"><code class="literal">inputcharset</code> (OPTIONAL)</span></dt><dd><p>
89 Encoding of input. For XML input formats, this need not
90 be given, but for ISO2709 based inputformats, this should
91 be set to the encoding used. For MARC21 records, a common
92 inputcharset value would be <code class="literal">marc-8</code>.
93 </p></dd><dt><span class="term"><code class="literal">outputcharset</code> (OPTIONAL)</span></dt><dd><p>
94 Encoding of output. If outputformat is XML based, it is
95 strongly recommened to use <code class="literal">utf-8</code>.
96 </p></dd></dl></div><p>
97 </p></dd><dt><span class="term"><code class="literal">xslt</code></span></dt><dd><p>
98 The <code class="literal">xslt</code> element specifies a conversion
99 via <acronym class="acronym">XSLT</acronym>. The following attributes may be specified:
101 </p><div class="variablelist"><dl><dt><span class="term"><code class="literal">stylesheet</code> (REQUIRED)</span></dt><dd><p>
103 </p></dd></dl></div><p>
105 </p></dd></dl></div><p>
106 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="tools.retrieval.examples"></a>6.2. Retrieval Facility Examples</h3></div></div></div><div class="example"><a name="tools.retrieval.marc21"></a><p class="title"><b>Example 9.19. MARC21 backend</b></p><div class="example-contents"><p>
107 A typical way to use the retrieval facility is to enable XML
108 for servers that only supports ISO2709 encoded MARC21 records.
109 </p><pre class="programlisting">
110 <retrievalinfo>
111 <retrieval syntax="usmarc" name="F"/>
112 <retrieval syntax="usmarc" name="B"/>
113 <retrieval syntax="xml" name="marcxml"
114 identifier="info:srw/schema/1/marcxml-v1.1">
115 <backend syntax="usmarc" name="F">
116 <marc inputformat="marc" outputformat="marcxml"
117 inputcharset="marc-8"/>
120 <retrieval syntax="xml" name="dc">
121 <backend syntax="usmarc" name="F">
122 <marc inputformat="marc" outputformat="marcxml"
123 inputcharset="marc-8"/>
124 <xslt stylesheet="MARC21slim2DC.xsl"/>
127 </retrievalinfo>
130 This means that our frontend supports:
131 </p><div class="itemizedlist"><ul type="disc"><li><p>
132 MARC21 F(ull) records.
134 MARC21 B(rief) records.
139 </p></li></ul></div><p>
140 </p></div></div><br class="example-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="tools.retrieval.api"></a>6.3. API</h3></div></div></div><p>
141 It should be easy to use the retrieval systems from applications. Refer
143 <code class="filename">yaz/retrieval.h</code> and
144 <code class="filename">yaz/record_conv.h</code>.
145 </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="marc.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="tools.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="odr.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5. MARC </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 10. The ODR Module</td></tr></table></div></body></html>