Possible search syntax as promised

Simon Spero <ses@tipper.oit.unc.edu> Sun, 28 March 1993 03:31 UTC

Received: from aggie.ucdavis.edu by ucdavis.ucdavis.edu (5.61/UCD2.04) id AA17153; Sat, 27 Mar 93 19:31:25 -0800
Received: from ucdavis.ucdavis.edu by aggie.ucdavis.edu (5.61/UCD2.04) id AA22487; Sat, 27 Mar 93 19:09:51 -0800
Received: by ucdavis.ucdavis.edu (5.61/UCD2.04) id AA15971; Sat, 27 Mar 93 19:01:35 -0800
Sender: ietf-wnils-request@ucdavis.ucdavis.edu
Received: from gibbs.oit.unc.edu by ucdavis.ucdavis.edu (5.61/UCD2.04) id AA15748; Sat, 27 Mar 93 18:57:27 -0800
Received: from tipper.oit.unc.edu by gibbs.oit.unc.edu (5.64/10.1) id AA10058; Sat, 27 Mar 93 21:55:36 -0500
Received: from localhost.oit.unc.edu by tipper (4.1/SMI-4.1) id AA00741; Sat, 27 Mar 93 21:56:45 EST
Message-Id: <9303280256.AA00741@tipper>
X-Really-To: gibbs.oit.unc.edu
To: ietf-wnils@ucdavis.ucdavis.edu
Subject: Possible search syntax as promised
Date: Sat, 27 Mar 1993 21:56:45 -0500
From: Simon Spero <ses@tipper.oit.unc.edu>

Here's the attempt at mapping Z39.50 searching into text. It's 
rather incomplete at the moment, as my carpal tunnel is really playing up.
One thing that might need explanation is the attribute-value stuff.
An attribute is something that indicates how the searc term is to be applied-
e.g. which field to use, whether to truncate, etc, etc. 

Some of it might be useful for whois++, much of it won't be. 
If you do want to use any of it, Jim is forbidden to read any of it out 
in his "British" accent, which is worse than my Southern. 

If y'all can find a camera, I'll be vatting all day; otherwise, 
go out there and win one for the tipper.

Simon

An text based search syntax for Z39.50  (incomplete)
---------------------------------------

This document describes a simple representation of Z39.50 searching without
using BER. 

Searching:

Search := 
"SEARCH" [<databases>]? "\n"
      ["Reference:" <string> "\n"]? 
      ["Small-set:" <number>  ["Elements" <elements> ]? "\n"]?
      ["Medium-set:" <number> ["Elements" <elements> ]?  "\n"]?
      ["Large-set:" <number> "\n"]?
      ["Result-set:" <string> ["Replace"] "\n"]?
      ["Result-types:" <result-types> "\n"]?
      ["Attribute-set:" <string> "\n"]?
      "Query:\n"
      <query> "\n"
"END\n"

databases := <string>+  -- comma separated
elements  := <string>+  --- comma separated
result-types  := <string>+ -- comma separated

query := <result-set> | <operator-expression> | <attribute-value>+
result-set := <string>
<operator-expression> := "AND\n" <query> "END-AND\n" |
			 "OR\n"  <query> "END-OR\n" |
			 "AND-NOT\n" <query> "END-AND-NOT\n"
<attribute-value> = <string>+ ["(" <number> ")"]? ":" <string> "\n"
   -- The number is an optional byte count for the string
   
example

SEARCH unc-phone-book
	Small-set:  10 Elements ALL
	Medium-set: 20 Elements "Name,Number,Email"
	Large-set: 100
	Result-types: User-Template
	Query:
		AND
		   Name,Truncate: Simon Spero
	  	   OR
			   Department: OIT
			   Department: Office for Information Technology
		   END-OR
		END-AND
END

Results:


SEARCH-RESPONSE "\n"
	"Success  [<number>]? | "Failure" [<number> <string>]? "\n"
	-- If success, number is present-status 
	-- If failure, number is result-set status, string is error-message
	["Reference:" <string> "\n"]
	"Result-count:" <number> "\n"
	"Number-returned:" <number> "\n"
	[ <results>]?
"END-OF-RESPONSE\n"

results := <result>+

result := "RECORD " <type: string> {"(" <number> ")" | <string>}
	   <bytes>
	["\n" <string> "\n"]?
"\n"
	-- the number is a bytes count; 
	-- the string is an end of record mark

example

RESPONSE
Success
Result-count: 1
Number-returned: 1
RECORD Whois-Template END-OF-RECORD-MARK
Name: Simon E Spero
Phone: (919)-962-9107
Email: ses@tipper.oit.unc.edu
Favourite-Drink: Black and Tan
END-OF-RECORD-MARK
END-OF-RESPONSE