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