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