# yet another revision of the gopher section

Mark P. McCahill (mpm@boombox.micro.umn.edu)
Thu, 10 Mar 94 16:11:08 CST

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Mark P. McCahill: "Mark acting as Tim's proxy: the revised News section of the URL draft"
- Previous message: Tim Berners-Lee: "WWW-URI: Internet draft and Informational RFC"

    Date: Thu, 10 Mar 94 16:11:08 CST

    Message-Id: <9403102211.AA23244@boombox.micro.umn.edu>

    From: "Mark P. McCahill" <mpm@boombox.micro.umn.edu>

    To: uri@bunyip.com

    Subject: yet another revision of the gopher section

This version has a few more examples, and gets painfully explicit about
the exact format of the gopher+ string for all possible cases of gopher+
objects. I'm not sure when you'd want to have a URL that pointed to a Gopher+
item's attributes, but the syntax described here will accomodate that, and
anything else. I also fixed a couple of typos.

===================================================================
GOPHER

Gopher selector strings may contain any characters other than tab, return, or
linefeed, so it is important to encode all disallowed characters and encode any
space characters so these characters are not altered during transport of the
URL. Note that since gopher selector string are opaque and in many cases map to
native file system of the gopher server, so encoding of disallowed characters
in the selector string is to map to binary codes rather than ISO character
sets. In other words, the "%" character followed by two hexadecimal digits is
used to encode binary data. Do not interpret gopher selector strings... while
many Gopher servers map to Unix file systems, you cannot assume that "/"
characters imply a heirarchy since Gopher servers on non-Unix file systems may
use the "/" as part of a file name.
The format of a gopher URL is:

1.) A single-character field to denote the Gopher type of the resource to
which the URL refers.

2.) The gopher selector string.

Note that some gopher selector strings begin with a copy of the gopher type
character, in which case that character will occur twice consecutively. Also
note that the gopher selector string may be an empty string since this is how
gopher clients refer to the top-level directory on a gopher server.

3.) An encoded tab character (%09) to seperate the gopher selector string from
the optional search string (see 4 below).

If the URL does not refer to a Gopher+ item and if there is no gopher search
string then parts 3, 4, 5, and 6 of the URL are optional

4.) The gopher search string.

If the URL refers to a search to be submitted to a gopher search engine, the
search string is required. Otherwise this is an empty string.

5.) An encoded tab character (%09) to seperate the gopher search string from
the optional gopher+ string (see 6 below). Note that if the URL refers to a
gopher+ item and does not have a gopher search string, there will be two
encoded tab characters in a row.

6.) The Gopher+ string. Gopher+ strings consist of a one or more
characters and are used to represent information required for retrieval
of the Gopher+ item. Gopher+ items may have alternate views, arbitrary sets
of attributes, and may have electronic forms associated with them. To
accomodate the various Gopher+ objects, the Gopher+ string in the URL must
accomodate a mapping of the information a Gopher+ client sends to the server.
This makes this section a bit long since we basically cover the entire Gopher+
protocol here. Bear with me.

When a Gopher server returns a directory listing to a client, Gopher+ items
are tagged with either a "+" (denoting gopher+ items) or a "?" (denoting items
which have a +ASK form associated with them). A Gopher+ string which is only a
"+" refers to the default view (data representation) of the item. To retrieve
this item a gopher+ client should send

a_gopher_selector<tab>+<cr><lf>

to the gopher+ server.

Note that items which have a +ASK asssociated with them (ie. Gopher+ items
tagged with a "?") require the client to fetch the item's +ASK attribute to
get the form definition, and then ask the user to fill out the form and return
the user's responces along with the selector string to retrieve the item.
Gopher+ clients know how to do this but depend on the "?" tag in the gopher+
item description to know when to handle this case. The "?" is used in the
Gopher+ string to be consistent with Gopher+ protocol's use of this symbol.

To refer to the Gopher+ attributes of an item, the Gopher+ string might
consist of "!" or "$". "!" refers to the all of a gopher+ item's attributes.
"$" refers to all the item attributes for all items in a Gopher directory.
To retrieve an item or directory's attributes, a gopher client will send:

a_gopher_selector<tab>!<cr><lf>

for items or

a_gopher_selector<tab>$<cr><lf>

for directories to the gopher+ server.

To refer to specific attributes, the Gopher+ string is "!attribute_name" or
"$attribute_name". For example, to refer to the attribute containing the
abstract of an item, the Gopher+ string would be "!+ABSTRACT". To refer to
several attributes, clients send the server the attribute names seperated by
spaces so it is neccesary to seperate the attribute names with coded spaces.
To retrieve a collection of item attributes specified with a gopher+ string
of "!+ABSTRACT%20+SMELL" a gopher client would send

a_gopher_selector<tab>!+ABSTRACT +SMELL<cr><lf>

to the gopher server.

Gopher+ allows for optional alternate data representations (alternate views)
of items. To retrieve a Gopher+ alternate view, the gopher+ client sends the
appropriate view and language identifier (found in the item's +VIEW attribute).
To refer to a specific Gopher+ alternate view, the URL's Gopher+ string would
be in the form "+view_name%20language_name". For example, a gopher+ string of
"+application/postscript%20Es_ES" refers to the spanish language postscript
alternate view of a gopher+ item. To retrieve this alternate view the client
would send

a_gopher_selector<tab>+application/postscript Es_ES<cr><lf>

to the gopher server.

The gopher+ string for a URL that refers to an item referenced by an ASK form
filled out with specific values is essentially a coded version of what the
client sends to the server. The gopher+ string will be of the form
+%091%0D%0A+-1%0D%0Aask_item1_value%0D%0Aask_item2_value%0D%0A.%0D%0A

To retrieve this item, the gopher client sends:

a_gopher_selector<tab>+<tab>1<cr><lf>
+-1<cr><lf>
ask_item1_value<cr><lf>
ask_item2_value<cr><lf>
.<cr><lf>

to the gopher server.

For a really complex example, consider a URL that refers to an alternate
view of an item that is referenced with a filled-out Gopher +ASK form. The
gopher+ string will be of the form:
+view_name%20language_name%091%0D%0A+-1%0D%0Aask_item1_value%0D%0A
ask_item2_value%0D%0A.%0D%0A

To retrieve this item, the gopher client sends:

a_gopher_selector<tab>+view_name language_name<tab>1<cr><lf>
+-1<cr><lf>
ask_item1_value<cr><lf>
ask_item2_value<cr><lf>
.<cr><lf>

to the gopher server.

Summary: gopher+ string part of Gopher URL
------------------------------------------

To refer to an item which has an ASK form associated with it where the
intent is to allow the user to enter values into the form as part of the
retrieval process:

?

To refer to all or specific attributes of a gopher item:

![attribute_name][%20attribute_name][%20attribute_name]...

To refer to all or specific attributes of a gopher directory:

$[attribute_name][%20attribute_name][%20attribute_name]...

To refer to the content of a gopher+ item (including an item referred to
by specific values in a filled-out ASK form):

+[view_name[%20language_name]]
[%091%0D%0A+-1%0D%0Aask_item1_value%0D%0Aask_item2_value...%0D%0A.%0D%0A]

Overall summary and examples
----------------------------
The general format of a Gopher URL path refering to a gopher
type "T" item is:

gopher://host [port]/T[gopher_selector]%09[search_string]%09[gopher+_string]

Examples:

An example of a URL pointing to a gopher type 0 item (a document) is:

gopher://host [port]/0a_gopher_selector

An example of a URL pointing to a gopher type 7 item (a search engine)
where the string foobar is to be submitted to the search engine is:

gopher://host [port]/7a_gopher_selector%09foobar

An example of a URL pointing to a Gopher+ type 0 item (a document) is:

gopher://host [port]/0a_gopher_selector%09%09some_gplus_stuff

An example of a URL pointing to a Gopher+ type 0 (document) item's attribute
information is:

gopher://host [port]/0a_gopher_selector%09%09!

An example of a URL pointing to a Gopher+ document's spanish postscript
representation is:

gopher://host [port]/0a_gopher_selector%09%09+application/postscript%20Es_ES

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Mark P. McCahill

gopherspace engineer/University of Minnesota
mpm@boombox.micro.umn.edu
612 625 1300 (voice) 612 625 6817 (fax)

- Next message: Mark P. McCahill: "Mark acting as Tim's proxy: the revised News section of the URL draft"
- Previous message: Tim Berners-Lee: "WWW-URI: Internet draft and Informational RFC"