Fix documentation of of chr's equivalent directive ZEB-672
[idzebra-moved-to-github.git] / examples / oai-pmh / README
1 Example DOM XML filter configuration using XSLT stylesheets
2
3 Get some more data to play with:
4    cd data
5    fetch_OAI_data.sh
6    (stop the script when you get tired waiting ..)
7    cd ../
8
9 Checking manually the retrieval stylesheets:
10    cat data/debug-record.xml
11    xsltproc conf/oai2dc.xsl data/debug-record.xml
12    xsltproc conf/oai2zebra.xsl data/debug-record.xml
13
14 Checking manually the indexing stylesheet:
15    xsltproc conf/oai2index.xsl data/debug-record.xml
16
17 Indexing:
18    mkdir tmp
19    zebraidx -c conf/zebra.cfg init
20    zebraidx -c conf/zebra.cfg update data
21    zebraidx -c conf/zebra.cfg commit
22
23 (in case you have not installed zebra yet, use the following command:
24     ../../index/zebraidx -c conf/zebra.cfg this and that .. )
25
26 Starting the SRU/SRW/Z39.50 server in PQF mode only:
27    zebrasrv -c conf/zebra.cfg 
28
29 Or, alternatively, starting the SRU/SRW/Z39.50 server including 
30 PQF and CQL query configuration:
31    zebrasrv -f conf/yazserver.xml
32
33 Z39.50 search:
34    yaz-client localhost:9999
35    Z> format xml
36    Z> querytype prefix
37    Z> elements oai
38    Z> find the
39    Z> show 1+1
40
41 Z39.50 presents using presentation stylesheets:
42    Z> elements dc
43    Z> show 2+1
44
45    Z> elements zebra
46    Z> show 3+1
47
48 Z39.50 buildin Zebra presents (in this configuration only if 
49   started without yaz-frontendserver):
50
51    Z> elements zebra::meta
52    Z> show 4+1
53
54    Z> elements zebra::meta::sysno
55    Z> show 5+1
56
57    Z> format sutrs
58    Z> show 5+1
59    Z> format xml
60
61    Z> elements zebra::index
62    Z> show 6+1
63
64    Z> elements zebra::snippet
65    Z> show 7+1
66
67    Z> elements zebra::facet::any:w
68    Z> show 8+1
69
70    Z>  elements zebra::facet::any:w,title:w
71    Z> show 9+1
72    
73 Z39.50 searches targeted at specific indexes
74
75    Z> find @attr 1=title communication
76    Z> show 1+1
77    
78    Z> find @attr 1=author alain
79    Z> show 1+1
80
81    Z> elements zebra
82    Z> find @attr 1=oai_identifier @attr 4=3 oai:caltechcstr.library.caltech.edu:4
83    Z> show 1+1
84
85    Z> find @attr 1=oai_datestamp  @attr 4=3 2001-04-20
86    Z> show 1+1
87
88    Z> find @attr 1=oai_setspec @attr 4=3 7374617475733D756E707562
89    Z> show 1+1
90    
91    Z> find @attr 1=identifier @attr 4=3  
92                  http://resolver.caltech.edu/CaltechCSTR:1986.5228-tr-86
93    Z> show 1+1
94
95    etc, etc. 
96
97    Notice that all indexes defined by 'type="0"' in the 
98    indexing style  sheet must be searched using the '@attr 4=3' 
99    structure attribute instruction.   
100
101    Notice also that searching and scan on indexes
102    'contributor',  'language', 'rights', and 'source' 
103    fails, simply because none of the records in this example set 
104    have these fields set, and consequently, these indexes are 
105    _not_ created. 
106
107 Z39.50 searches using Bib-1
108
109 - only if bib1.att is referred to from zebra.cfg
110
111    Z> find @attr 1=4 communication
112    Z> show 1+1
113    
114    Z> find @attr 1=1003 alain
115    Z> show 1+1
116
117    Z> find @attr 1=21 all
118    Z> show 1+1
119    
120    Z> find @attr 1=1018 data
121    Z> show 1+1
122
123 Z39.50 scan:
124
125    yaz-client localhost:9999
126    Z> format xml
127    Z> querytype prefix
128    Z> scan @attr 1=oai_identifier @attr 4=3 oai
129    Z> scan @attr 1=oai_datestamp @attr 4=3 1
130    Z> scan @attr 1=oai_setspec @attr 4=3 2000
131    Z>
132    Z> scan @attr 1=title communication
133    Z> scan @attr 1=identifier @attr 4=3 a
134
135    etc, etc,
136
137
138 Z39.50 search using server-side CQL conversion:
139
140    Z> format xml
141    Z> querytype cql
142    Z> elements dc
143    Z>
144    Z> find harry 
145    Z>
146    Z> find creator = the
147    Z> find dc.creator = the
148    Z> find title = the
149    Z>
150    Z> find description < the
151    Z> find title le some
152    Z> find title ge some
153    Z> find title > some
154    Z>
155    Z> find identifier eq 
156            "http://resolver.caltech.edu/CaltechCSTR:1978.2276-tr-78"
157    Z> find relation eq something 
158    
159
160    etc, etc. Notice that  all indexes defined by 'type="0"' in the 
161    indexing style  sheet must be searched using the 'eq' 
162    relation.    
163
164    Z> find title <> and
165
166    fails as well.  ???
167
168
169 Z39.50 scan using server side CQL conversion:
170
171    Unfortunately, this will _never_ work as it is not supported by the 
172    Z39.50 standard.
173    If you want to use scan using server side CQL conversion, you need to  
174    make an SRW connection using  yaz-client, or a
175    SRU connection using REST Web Services - any browser will do.
176
177
178 SRU Explain ZeeRex response:
179
180    http://localhost:9999/
181    http://localhost:9999/?version=1.1&operation=explain
182
183
184 SRU Search Retrieve records:
185
186    http://localhost:9999/?version=1.1&operation=searchRetrieve
187                           &query=creator=adam
188
189    http://localhost:9999/?version=1.1&operation=searchRetrieve
190                          &query=date=1978-01-01
191                          &startRecord=1&maximumRecords=1&recordSchema=dc
192
193    http://localhost:9999/?version=1.1&operation=searchRetrieve
194                          &query=dc.title=the
195
196    http://localhost:9999/?version=1.1&operation=searchRetrieve
197                          &query=description=the
198
199
200    relation tests:
201
202    http://localhost:9999/?version=1.1&operation=searchRetrieve
203                       &query=title%3Cthe
204
205
206 SRU scan:
207
208    http://localhost:9999/?version=1.1&operation=scan&scanClause=title=a
209    http://localhost:9999/?version=1.1&operation=scan
210                       &scanClause=identifier%20eq%20a
211
212    Notice: you need to use the 'eq' relation for all @attr 4=3 indexes
213
214
215
216 SRW explain with CQL index points:
217
218    Z> open http://localhost:9999
219    Z> explain
220
221    Notice: when opening a connection using the 'http.//' prefix, yaz-client
222    uses SRW SOAP connections, and 'form xml' and 'querytype cql' are 
223    implicitely set.
224
225
226 SRW search using implicit server side CQL:
227
228    Z> open http://localhost:9999
229    Z> find identifier eq 
230         "http://resolver.caltech.edu/CaltechCSTR:1978.2276-tr-78"
231    Z> find description < the
232
233
234    In SRW connection mode, the follwing fails due to problem in yaz-client:
235    Z> elements dc
236    Z> s 1+1
237
238
239 SRW scan using implicit server side CQL:
240
241    yaz-client http://localhost:9999
242    Z> scan title = communication
243    Z> scan identifier eq a  
244
245    Notice: you need to use the 'eq' relation for all @attr 4=3 indexes
246
247
248
249
250 SRW search using X-PQF query
251
252 http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=fish&startRecord=1&maximumRecords=1&recordSchema=dc
253
254 http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=fish&startRecord=1&maximumRecords=1&recordSchema=zebra::data
255
256 http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=fish&startRecord=1&maximumRecords=1&recordSchema=zebra::meta
257
258 http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=fish&startRecord=1&maximumRecords=1&recordSchema=zebra::index::description
259
260 http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=fish&startRecord=1&maximumRecords=1&recordSchema=zebra::snippet
261
262 http://localhost:9999/?version=1.1&operation=searchRetrieve&x-pquery=fish&startRecord=1&maximumRecords=1&recordSchema=zebra::facet::description:w
263