In sintesi: Z39.50 è un protocollo utile per l’accesso aperto a dati catalografici compresi quelli SBN. Provatelo nella maschera LOC; se trova quello che vi serve, in GNU/Linux è facile usare yaz-client digitando yaz-client opac.sbn.it:2100/nopac nel proprio terminale, ma prima di cominciare può essere opportuno scrivere charset utf8 e format unimarc.
Esempio concreto: scarico delle schede SBN per BEIC
A partire da un elenco di BID corrispondenti a opere della biblioteca digitale BEIC o BeicDL, per uno scarico di massa o dump in batch eseguo semplicemente una lista di interrogazioni chiedendo a yaz-client di scrivere ogni singola registrazione trovata in un unico file in formato MARC, del genere (se volete avere anche qualche informazioni aggiuntiva da parte):
yaz-client -f in.txt -m out.unimarc -a - | tee info.log
open tcp:opac.sbn.it:2100/nopac format unimarc charset utf8 elements f f @attr 1=1032 ITICCUANAE010355 show f @attr 1=1032 ITICCUANAE013892 show ...
Altre risorse utili
Ci sono vari altri programmi (client) Z39.50; c’è chi ha avuto successo usando MarcEdit, chi consiglia ZOOM shell (zoomsh)
Altro materiale che può essere utile:
- http://www.macs.hw.ac.uk/~hamish/3NI/topic69.html
- https://en.wikipedia.org/wiki/Contextual_Query_Language
- http://lists.indexdata.dk/pipermail/yazlist/2007-February/001933.html
Esempio funzionante di Z39.50 in OPAC SBN
$ yaz-client opac.sbn.it:2100/nopac Connecting...OK. Sent initrequest. Connection accepted by v3 target. ID : 81 Name : metavista-acs [a0a150a] [ 3ySnmVRzrro ]/GFS/YAZ Version: 1.2.0/1.43/2.0.32 Options: search present triggerResourceCtrl namedResultSets Elapsed: 0.206976 Z> find @attr 1=1032 ITICCUUM1E006894 Sent searchRequest. Received SearchResponse. Search was a success. Number of hits: 1, setno 1 records returned: 0 Elapsed: 0.155152 Z> show Sent presentRequest (1+1). Records: 1 [nopac]Record type: USmarc 02542nam a22003257ib4500 001 IT\ICCU\UM1E\006894 003 ItRI 005 20130618120932.1 008 020225s1607 it |||||| ||||| |||||c 026 $e i-am S..a orto olDo (3) 1607 (R) $d Vol.2 $2 fei 040 $b ita 041 7 $a lat $2 ISO-639-2 100 1 $a Magini, Giovanni Antonio, $d (1555-1617) $0 IT\ICCU\MILV\069558 $4 aut 245 15 $a [2]: Continuatio ephemeridum coelestium motuum Io. Antonij Magini Patauini ... Ab anno Domini 1610. vsque ad annum 1630. iuxta Copernici obseruationes accuratissimè supputatarum ... Quibus addita sunt eiusdem supplementum isagogicarum ephemeridum, ... Astrologicae circa agricolturam, & nauigatoriam obseruationes, & praecepta. De mutatione aëris libellus. 260 $a Venetijs : $b apud hæredem Damiani Zenarij, $c 1607 $e (Venetijs : $f ex officina haeredis Damiani Zenarij, $g 1606 mense Martij) 300 $a [6], 28, 149, [3] c. ; $c 4º 500 $a Marche sul front. (O856) e nel colophon (O608) 500 $a Segn.: a⁴ b², A-G⁴, ²A-T⁸(T7-T8 bianche) 500 $a Sottoscrizione e colophon rispettivamente a c. 2T6r e v 500 $a Var.B: bianca la c. 2T6. 500 $a Marca editoriale: Una salamandra coronata in mezzo alle fiamme. In una cornice figurata. Motto: Virtuti sic cedit invidia. (O856). Sul front.. $0 IT\ICCU\PUV\M000294 500 $a Marca editoriale: Una salamandra coronata in mezzo alle fiamme. In una cornice figurata. Motto: Virtuti sic cedit invidia. (O608). A c. 2T6v.. $0 IT\ICCU\PUV\M000619 502 $a Contiene le efemeridi dal 1611 al 1620; le 28 c. contengono il "Supplementum isagogicarum ephemeridum" e "De mutatione aeris" 710 2 $a Zenaro, Damiano erede $0 IT\ICCU\MILV\163239 $4 pbl 752 $d Venezia 773 0 $w IT\ICCU\UM1E\006886 $t Ephemerides coelestium motuum Io. Antonij Magini Patauini, ab anno Domini 1608. vsque ad annum 1630. secundum Copernici obseruationes accuratissimè supputatae, correctae, & auctae, ad longitudinem inclytae Venetiarum vrbis. Eiusdem tractatus duo absolutissimi, nempe Isagoge in astrologiam, & De vsu ephemeridum denuo correcti, & insigniter aucti. Atque etiam directionum eiusdem auctoris pro directionibus noua ratione, ac facili secundum rationalem modum conficiendis ... $g 2 $a Magini, Giovanni Antonio (1555-1617) $0 IT\ICCU\MILV\069558 790 1 $a Bonhombra, Lodovico $3 IT\ICCU\BVEV\092908 $z Magini, Giovanni Antonio (1555-1617) 791 2 $a Rodella, Bartolomeo $3 IT\ICCU\RMGV\010777 $z Zenaro, Damiano erede 981 1 $6 z01 $a i $b xxxe 982 1 $6 z01 $a n nextResultSetPosition = 0 Elapsed: 0.522704
Prova di funzionamento
Se falliamo, verifichiamo che funzioni il servizio usando https://www.loc.gov/z3950/test.html , che è piuttosto efficace. Un esempio di ricerca che dà esito positivo:
Caratteristiche Z39.50 di SBN
La pagina Accesso Z39.50 all’OPAC SBN descrive le coordinate essenziali per accedere ai dati dell’OPAC SBN con questo protocollo. È indispensabile ricordare di specificare il formato UNIMARC e la codifica UTF-8, che non sono la scelta predefinita di yaz-client; e in ogni caso di scrivere correttamente le interrogazioni secondo i codici supportati da SBN, non tutti standard.
Ecco le opzioni predefinite nel momento della connessione:
$ yaz-client -V YAZ version: 4.2.30 98864b44c654645bc16b2c54f822dc2e45a93031 $ yaz-client opac.sbn.it:2100/nopac Connecting...OK. Sent initrequest. Connection accepted by v3 target. ID : 81 Name : metavista-acs [a0a150a] [ 3ySnmVRzrro ]/GFS/YAZ Version: 1.2.0/1.43/2.0.32 Options: search present triggerResourceCtrl namedResultSets Elapsed: 0.218975 Z> list_all Connected to : opac.sbn.it:2100/nopac auto_reconnect : off auto_wait : on Authentication : none Bases : nopac CCL file : default.bib CQL file : /usr/local/share/yaz/etc/pqf.properties Query type : prefix (RPN sent to server) Named Result Sets : on ssub/lslb/mspn : 0/1/0 Format : usmarc Schema : not set Elements : APDU log : off Record log : off Other Info: Z>
Quelle che invece dobbiamo vedere:
Z> format unimarc Z> charset utf8 Character set negotiation : utf8 Z> elements f Z> list_all Connected to : opac.sbn.it:2100/nopac auto_reconnect : off auto_wait : on Authentication : none Neg. Character set : `utf8' Bases : nopac CCL file : default.bib CQL file : /usr/local/share/yaz/etc/pqf.properties Query type : prefix (RPN sent to server) Named Result Sets : on ssub/lslb/mspn : 0/1/0 Format : unimarc Schema : not set Elements : f APDU log : off Record log : off Other Info:
Se va storto qualcosa, è probabile ricevere messaggi di errore del tutto incomprensibili come:
Received SRW SearchRetrieve Response SRW diagnostic info:srw/diagnostic/1/2 Message: System temporarily unavailable Details: Cannot receive Search Response APDU Elapsed: 0.022744 Z> sru solr Z> find @attr 1=1032 "IT\ICCU\CFI\0393496" Connecting...OK. HTTP Error Status=404 Content type does not appear to be XML Elapsed: 0.203890 Z> sru get Z> find @attr 1=1032 "IT\ICCU\CFI\0393496" Connecting...OK. Received SRW SearchRetrieve Response SRW diagnostic info:srw/diagnostic/1/5 Message: Unsupported version Details: 1.1 Elapsed: 0.204373 Z> sru post Z> find @attr 1=1032 "IT\ICCU\CFI\0393496" HTTP Error Status=500 Content type does not appear to be XML Elapsed: 0.103094
ecc.