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