From 666316a92ba28594acd7e2611f3a05be34f14722 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 14 Nov 1996 17:11:03 +0000 Subject: [PATCH] Added Explain documentaion. --- CHANGELOG | 4 ++- Makefile.in | 6 +++- client.tcl | 14 +++++--- clientrc.tcl | 9 +++-- doc/ir-set.n | 6 +++- doc/ir-tcl.sgml | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- ir-tcl.c | 11 +++--- 7 files changed, 140 insertions(+), 16 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 65688bc..e2b0249 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -$Id: CHANGELOG,v 1.28 1996-09-03 13:52:09 adam Exp $ +$Id: CHANGELOG,v 1.29 1996-11-14 17:11:03 adam Exp $ 06/19/95 Release of ir-tcl-1.0b ------------------------------------------------------ @@ -112,3 +112,5 @@ $Id: CHANGELOG,v 1.28 1996-09-03 13:52:09 adam Exp $ 09/03/96 Bug fix: configure script could fail if yaz couldn't be located. +11/14/96 Added some Explain documentation. + diff --git a/Makefile.in b/Makefile.in index 05b4698..3d81224 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,7 +2,7 @@ # (c) Index Data 1995-1996 # See the file LICENSE for details. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.41 1996-08-20 09:33:23 adam Exp $ +# $Id: Makefile.in,v 1.42 1996-11-14 17:11:04 adam Exp $ SHELL=/bin/sh # IrTcl Version @@ -128,6 +128,10 @@ install: ir-tcl echo "Installing clientrc.tcl"; \ $(INSTALL_DATA) clientrc.tcl $(IRTCLDIR); \ fi; \ + for f in *.tcl; do \ + echo "Installing $$f"; \ + $(INSTALL_DATA) $$f $(IRTCLDIR); \ + done; \ echo "Installing LICENSE" ; \ $(INSTALL_DATA) LICENSE $(IRTCLDIR); \ echo "Installing display format scripts"; \ diff --git a/client.tcl b/client.tcl index 9a3565f..08f84a9 100644 --- a/client.tcl +++ b/client.tcl @@ -4,7 +4,10 @@ # Sebastian Hammer, Adam Dickmeiss # # $Log: client.tcl,v $ -# Revision 1.97 1996-09-13 10:54:22 adam +# Revision 1.98 1996-11-14 17:11:04 adam +# Added Explain documentaion. +# +# Revision 1.97 1996/09/13 10:54:22 adam # Started work on Explain in client. # # Revision 1.96 1996/08/09 15:30:18 adam @@ -484,7 +487,7 @@ set setMax 0 # Procedure tkerror {err} # err error message # Override the Tk error handler function. -proc tkerrorx err { +proc tkerror err { set w .tkerrorw if {[winfo exists $w]} { @@ -1938,6 +1941,7 @@ proc search-response {} { set msg [lindex $status 2] set addinfo [lindex $status 3] tkerror "NSD$code: $msg: $addinfo" + dputs "xxxxxxxxxxxxxxx" return } show-message "${setMax} hits" @@ -2869,8 +2873,10 @@ proc save-settings {} { global queryTypes global queryButtons global queryInfo - - if {![file writable "${libdir}/clientrc.tcl"]} { + + if {[file exists clientrc.tcl]} { + set f [open "clientrc.tcl" w] + } elseif {![file writable "${libdir}/clientrc.tcl"]} { set a [alert "Cannot open ${libdir}/clientrc.tcl for writing. Do you \ wish to save clientrc.tcl in the current directory instead?"] if {! $a} { diff --git a/clientrc.tcl b/clientrc.tcl index 8a490fd..e7cadb6 100644 --- a/clientrc.tcl +++ b/clientrc.tcl @@ -1,5 +1,5 @@ # Setup file -set {profile(Penn)} {{Penn State's Library} 128.118.88.200 210 {} 16384 8192 tcpip CATALOG 1 {} {} Z39 2 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}} +set {profile(Penn)} {{Penn State's Library} 128.118.88.200 210 {} 16384 8192 tcpip CATALOG 1 {} {} Z39 2 {} {} {} {} {} 847978115 {} {} {} {} {} {} {} {} {} {}} set {profile(DanBib, SR)} {{SR Target DANBIB} 0103/find2.denet.dk 4500 {} 8192 8192 mosi danbib 1 {} 1 SR 8 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}} @@ -13,7 +13,7 @@ set {profile(Default)} {{} {} {210} {} 50000 30000 tcpip {} 1 {} {} Z39 34 2 0 0 set {profile(RLG)} {{Research Libraries group} rlg.stanford.edu 210 {} 32768 32768 tcpip {DEM} 1 {} 1 Z39 5 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}} -set {profile(ztest9999)} {{YAZ server on localhost} localhost 9999 {} 50000 30000 tcpip Default {} {} {} Z39 33 2 0 0 4 842607655 842611277 842611107 {} {} {} {} {} {} {} {} {}} +set {profile(ztest9999)} {{YAZ server on localhost} localhost 9999 {} 50000 30000 tcpip Default {} {} {} Z39 33 2 0 0 4 842607655 844779204 842611107 {} {} {} {} {} {} {} {} {}} set {profile(AT&T server)} {{AT&T Z39 Server} z3950.research.att.com 210 {} 90000 90000 tcpip {explain books gils netlib ftp z39dbs ahd books books books factbook russian outside-marc} 1 {} {} Z39 21 {} {} {} {} {} 842605350 842605239 {Lucent Technologies Research Server} {} 100 600000 {} {} 0 {Salutations - this is Lucent Technologies experimental Z39.50 server. No guarentees, but free and unlimited access!} {}} @@ -25,7 +25,10 @@ set {profile(CARL)} {{CARL systems} z3950.marmot.org 210 {} 32768 32768 tcpip {A set {profile(CLSI)} {CLSI inet-gw.clsi.us.geac.com 210 {} 16384 8192 tcpip cl_default 1 {} {} Z39 13 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}} -set {profile(AULS)} {{Acadia university} auls.acadiau.ca 210 {} 16384 8192 tcpip AULS 1 {} {} Z39 14 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}} +set {profile(AULS)} {{Acadia university +} auls.acadiau.ca 210 {} 16384 8192 tcpip {AULS mad} 1 {} {} Z39 14 {} {} {} {} {} {} {} { +} { +} {} {} {} {} {} {} {}} set {profile(dranet)} {dranet dranet.dra.com 210 {} 16384 16384 tcpip drewdb 1 {} 1 Z39 15 {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}} diff --git a/doc/ir-set.n b/doc/ir-set.n index 0bf1e90..9359d7d 100644 --- a/doc/ir-set.n +++ b/doc/ir-set.n @@ -1,6 +1,6 @@ .\" Copyright (c) 1995, 1996 Index Data .\" All rights reserved. -.\" $Id: ir-set.n,v 1.2 1996-06-24 16:24:39 adam Exp $ +.\" $Id: ir-set.n,v 1.3 1996-11-14 17:11:13 adam Exp $ .TH ir-set N "24 June 1996" "IrTcl" "IR Set" .SH NAME ir-set \- IR set @@ -174,5 +174,9 @@ encoded as a single Tcl token. The \fIdata-type\fR \fBbool\fR is encoded as 0 or 1 for false and true respectively. If the \fIdata-type\fR is \fBsubtree\fR the \fIdata\fR is a sub-list. In all other cases, the \fIdata\fR is the empty string. +.TP +.BI "" zs " getExplain " position " [" pattern " " pattern " " ... "]" +The Explain record on the specified position is returned. See the +manual for a detailed explanation. .SH "SEE ALSO" .BR ir-assoc "(n)", " " ir-scan "(n)" diff --git a/doc/ir-tcl.sgml b/doc/ir-tcl.sgml index c4738e5..3608b4c 100644 --- a/doc/ir-tcl.sgml +++ b/doc/ir-tcl.sgml @@ -1,14 +1,14 @@
IrTcl User's Guide and Reference <author><htmlurl url="http://www.indexdata.dk/" name="Index Data">, <tt><htmlurl url="mailto:info@index.ping.dk" name="info@index.ping.dk"></tt> -<date>$Revision: 1.21 $ +<date>$Revision: 1.22 $ <abstract> This document describes IrTcl -- an information retrieval toolkit for Tcl and Tk that provides access to the Z39.50/SR protocol. @@ -596,6 +596,9 @@ operators. They are: Proximity operation on op1 and op2. Not implemented yet. <tag><tt>@set </tt><em>name</em></tag> Result set reference +<tag><tt>@attrset </tt><em>set</em></tag> + Whole query uses the specified attribute <em>set</em>. If this operator is + used it must be defined at the beginning of the query. </descrip> It is simple to build RPN queries in <sf/IrTcl/. Search terms @@ -627,6 +630,12 @@ term is right truncated: @attr 1=4 @and @attr 5=1 tech beta </verb></tscreen> +To search for the DatabaseInfo records from an Explain server, we +could use +<tscreen><verb> + @attrset exp1 @attr 1=1 DatabaseInfo +</verb></tscreen> + <sect1>Search <p> @@ -1055,6 +1064,99 @@ record. In <sf/IrTcl/ a SUTRS record is treated as one single string. To retrieve a SUTRS record use the <tt>getSutrs</tt> followed by an index. +<sect1>GRS-1 +<p> +To be written. + +<sect1>Explain +<p> +Explain records are retrieved like other records. The method, +<tt>getExplain</tt> is followed by an index and, and an optional +Explain record pattern. + +The returned record is a canonical representation of the Explain record. +An ASN.1 sequence is represented as a list. Each item in the list +consists of the name of the element, followed by its value if the value +is supplied. + +The optional pattern that follows the index after <tt>getExplain</tt> +consists of one or more elements, that is matched against the elements +of the actual record. + +<bf/Example/ + +One of the few targets that support explain is the ATT research server +at <tt>z3950.research.att.com</tt>. + +The targetInfo record was returned by the target and it's stored in +position 1 in the result set, <tt>z.1</tt>. To retrieve the whole +record we must use +<tscreen><verb> +z.1 getExplain 1 +</verb></tscreen> + +and we get in return + +<tscreen><verb> +{targetInfo commonInfo {name {Lucent Technologies Research Server}} +recentNews icon {namedResultSets 1} {multipleDBsearch 0} +{maxResultSets 100} {maxResultSize 600000} maxTerms timeoutInterval +{welcomeMessage {strings { {language eng} +{text +{Salutations - this is Lucent Technologies experimental Z39.50 server. +No guarentees, but free and unlimited access!}} } } } +{contactInfo {name {Robert Waldstein}} {description {strings +{ {language eng} +{text {Librarian system designer - no legal anythings}} } } } +{address {strings { {language eng} {text {Room 3D-591 +600 Mountain Ave +Murray Hill +N.J. USA 07974}} } } } {email wald@lucent.com} {phone {908 582-6171}} } +description nicknames {usageRest {strings { {language eng} +{text {None - as long as nonProfit research}} } } } paymentAddr +{hours {strings { {language eng} {text {Should never be down}} } } } +dbCombinations addresses commonAccessInfo } +</verb></tscreen> + +The <tt>targetInfo</tt> above indicates the the record is really a +<tt>targetInfo</tt> record. The <tt>commonInfo</tt>, which is optional, is +not supplied by this server. The <tt>name</tt>, however is supplied, +with the value <tt>Lucent Technologies Research Server</tt>. + +To retrieve the <tt>contactInfo</tt> from the record above we can +extract the element from the record by using Tcl's list manipulation +facilities, for example by doing +<tscreen><verb> +set ti [z.1 getExplain 1] +lindex [lindex $ti 0] 12 +</verb></tscreen> +which will return +<tscreen><verb> +contactInfo {name {Robert Waldstein}} {description {strings +{ {language eng} +{text {Librarian system designer - no legal anythings}} } +} } {address {strings { {language eng} {text {Room 3D-591 +600 Mountain Ave +Murray Hill +N.J. USA 07974}} } } } {email wald@lucent.com} {phone {908 582-6171}} +</verb></tscreen> + +We can also extract almost the same by doing +<tscreen><verb> +z.1 getExplain 1 targetInfo contactInfo +</verb></tscreen> +which will return +<tscreen><verb> +{name {Robert Waldstein}} {description {strings { {language eng} +{text {Librarian system designer - no legal anythings}} } } } +{address {strings { {language eng} {text {Room 3D-591 +600 Mountain Ave +Murray Hill +N.J. USA 07974}} } } } {email wald@lucent.com} {phone {908 582-6171}} +</verb></tscreen> + +<bf/End of example/ + <sect>Scan <p> diff --git a/ir-tcl.c b/ir-tcl.c index ad3fba6..973df4c 100644 --- a/ir-tcl.c +++ b/ir-tcl.c @@ -5,7 +5,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ir-tcl.c,v $ - * Revision 1.96 1996-10-08 13:02:50 adam + * Revision 1.97 1996-11-14 17:11:07 adam + * Added Explain documentaion. + * + * Revision 1.96 1996/10/08 13:02:50 adam * When dealing with records, odr_choice_enable_bias function is used to * prevent decoding of externals. * @@ -3453,7 +3456,7 @@ static void ir_handleDBRecord (IrTcl_Obj *p, IrTcl_RecordList *rl, switch (etype->what) { case Z_External_sutrs: - logf (LOG_LOG, "Z_External_sutrs"); + logf (LOG_DEBUG, "Z_External_sutrs"); oe->u.sutrs = rr; if ((rl->u.dbrec.buf = ir_tcl_malloc (oe->u.sutrs->len+1))) { @@ -3464,12 +3467,12 @@ static void ir_handleDBRecord (IrTcl_Obj *p, IrTcl_RecordList *rl, rl->u.dbrec.size = oe->u.sutrs->len; break; case Z_External_grs1: - logf (LOG_LOG, "Z_External_grs1"); + logf (LOG_DEBUG, "Z_External_grs1"); oe->u.grs1 = rr; ir_tcl_grs_mk (oe->u.grs1, &rl->u.dbrec.u.grs1); break; case Z_External_explainRecord: - logf (LOG_LOG, "Z_External_explainRecord"); + logf (LOG_DEBUG, "Z_External_explainRecord"); if ((rl->u.dbrec.buf = ir_tcl_malloc (rl->u.dbrec.size))) { memcpy (rl->u.dbrec.buf, oe->u.octet_aligned->buf, -- 1.7.10.4