home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / rfc / 3 / rfc2259.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  57.1 KB  |  1,684 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                         J. Elliott
  8. Request for Comments: 2259                      Epic Systems Corporation
  9. Category: Informational                                       J. Ordille
  10.                                           Bell Labs, Lucent Technologies
  11.                                                             January 1998
  12.  
  13.  
  14.                 Simple Nomenclator Query Protocol (SNQP)
  15.  
  16.  
  17. Status of this Memo
  18.  
  19.    This memo provides information for the Internet community.  It does
  20.    not specify an Internet standard of any kind.  Distribution of this
  21.    memo is unlimited.
  22.  
  23. Copyright Notice
  24.  
  25.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  26.  
  27. Abstract
  28.  
  29.    The Simple Nomenclator Query Protocol (SNQP) allows a client to
  30.    communicate with a descriptive name service or other relational-style
  31.    query service.  The protocol is useful to services that search many
  32.    data repositories for query responses.  Clients can pose queries on
  33.    relations, list descriptions of relations, and obtain advice on
  34.    reducing the search time and cost of their queries.  Clients are
  35.    informed of the age of information in caches, and may request more
  36.    recent information.  SNQP provides support for graphical user
  37.    interfaces.  It also supports different types of comparison
  38.    operators, so services can use SNQP with a variety of back-end
  39.    servers, e.g. relational database servers, CCSO servers, and servers
  40.    providing relational views of X.500.
  41.  
  42.    SNQP is an ASCII protocol in the request-reply style of SMTP.  It was
  43.    specifically designed for use with the Nomenclator name and
  44.    information service, and has been useful elsewhere.
  45.  
  46. 1. Introduction
  47.  
  48.    The Simple Nomenclator Query Protocol (SNQP) is a protocol for
  49.    querying servers that search collections of data repositories.  Users
  50.    retrieve information from an SNQP server by describing attributes of
  51.    the information.  SNQP servers contact one or many data repositories
  52.    to retrieve the response to a user query.  If the data repositories
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Elliott & Ordille            Informational                      [Page 1]
  59.  
  60. RFC 2259                          SNQP                      January 1998
  61.  
  62.  
  63.    differ in protocol or data format, it is responsibility of the SNQP
  64.    server to translate protocols and data formats to provide one,
  65.    integrated answer to the user's query.
  66.  
  67.    SNQP servers share the protocol needs of centralized data
  68.    repositories that answer queries with locally stored data.  SNQP
  69.    servers also require specialized protocol features due to their
  70.    distributed search characteristics.
  71.  
  72.    In highly distributed environments, it is unreasonable to expect all
  73.    data repositories that need to be searched to be available when
  74.    queries are posed.  SNQP servers require facilities for returning
  75.    partial results in the presence of communications errors with data
  76.    repositories.   The partial results must indicate how to resubmit the
  77.    query only to those data repositories that are unavailable.
  78.  
  79.    In addition, users may pose queries without realizing the cost of the
  80.    search for query responses.  SNQP provides facilities for informing
  81.    users of query costs and advising them on limiting that cost.  Costs
  82.    and advice are returned before queries are executed.
  83.  
  84.    Finally, SNQP servers may cache data and meta-data to speed query
  85.    responses.  Servers can inform users of the t-bound for their query
  86.    response.   A t-bound is the time after which changes may have
  87.    occurred to the data that are not reflected in the query response
  88.    [6,2].  A t-bound is the time of the oldest cache entry used to
  89.    calculate the response.  Users can request that query responses are
  90.    more current then a particular t-bound.  Making such a request
  91.    flushes older items from the cache.
  92.  
  93.    SNQP provides support for graphical user interfaces.  It also
  94.    supports different types of comparison operators, so SNQP servers can
  95.    query a variety of back-end data repositories, e.g. relational
  96.    databases, CCSO servers [3], and servers providing relational views
  97.    of X.500 [10].
  98.  
  99.    SNQP is a connection-oriented protocol.  A client initiates a query
  100.    session with an SNQP server by making a TCP connection to a well-
  101.    known port.  The client then executes a series of SNQP commands.
  102.    These commands are listed briefly in Table 1.  Section 2 provides
  103.    some typical scenarios for using these commands, and Section 3
  104.    describes the commands fully.  The server replies to each command
  105.    using the theory of reply codes described for the Simple Mail
  106.    Transfer Protocol (SMTP) [9]. The theory of reply codes and the
  107.    defined reply codes are described in Section 4.
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Elliott & Ordille            Informational                      [Page 2]
  115.  
  116. RFC 2259                          SNQP                      January 1998
  117.  
  118.  
  119.    ---------------------------------------------------------------------
  120.       Command       Description
  121.    ---------------------------------------------------------------------
  122.       advice        Provide advice on query costs without executing
  123.                     query.
  124.       attributes    List the attributes for a relation.
  125.       compare       Set type of comparison operation.
  126.       help          Explain the SNQP commands.
  127.       imagui        Format replies for a graphical user interface.
  128.       next          Stop processing current query, continue with next
  129.                     query in block.
  130.       noadvice      Provide responses to queries.  Do not advise
  131.                     on costs.
  132.       noimagui      Format replies for people.
  133.       query         Submit a block of one or more SQL query statements.
  134.       relations     List the relations available through the SNQP
  135.                     server.
  136.       stop          End processing of current query, and cancel any
  137.                     queries remaining in block.
  138.       quit          Terminate the query session.
  139.  
  140.  
  141.                          Table 1: SNQP Commands
  142.  
  143.    ---------------------------------------------------------------------
  144.  
  145.    SNQP queries are posed in SQL, a standard relational database query
  146.    language [4,12].  Information that is obtained through SNQP servers
  147.    is organized by type into database relations.  SQL queries may often
  148.    have more functionality then a server supports or an application
  149.    demands.  Moreover, advice on query costs, some types of comparison
  150.    operations or t-bounds may not be supported by a particular server.
  151.    SNQP defines a minimal subset of functionality for a working SNQP
  152.    protocol.  Functionality beyond this subset is optional.  Servers
  153.    that do not support optional functionality must return replies that
  154.    indicate this to the user.  The required and optional features of
  155.    SNQP are summarized in Section 5.
  156.  
  157.    SNQP was specifically designed for use with the Nomenclator name and
  158.    information service [8,7,5].  Nomenclator produces query responses by
  159.    integrating information from data repositories with different
  160.    protocols and data formats.  It constrains the searches for query
  161.    responses through a variety of distributed indexing techniques.  SNQP
  162.    has also been found useful elsewhere, even as a query language for a
  163.    single data repository.
  164.  
  165.    SNQP is defined for US-ASCII only, and use with other character sets
  166.    will require further work.
  167.  
  168.  
  169.  
  170. Elliott & Ordille            Informational                      [Page 3]
  171.  
  172. RFC 2259                          SNQP                      January 1998
  173.  
  174.  
  175.    Section 6 concludes this document with a description of security
  176.    considerations.
  177.  
  178. 2. Scenarios
  179.  
  180.    This section illustrates the basic SNQP commands by presenting
  181.    several client scenarios.  The scenarios include a new user, a user
  182.    who prefers CCSO style comparisons and more current responses, a
  183.    graphical user interface program, a user with a change of mind, and a
  184.    user worried about costs.  Although SNQP will work for a human client
  185.    on a bare connection (like one provided by telnet), it also works for
  186.    client programs.  Several of these programs have been written and
  187.    provide enhanced interfaces.
  188.  
  189. 2.1 New User
  190.  
  191.    A new SNQP user will first make a tcp connection to an SNQP server.
  192.    For purposes of illustration, we will assume that the user makes the
  193.    connection with the Unix telnet command, and that the server is
  194.    located at nomen.research.bell-labs.com on port 4224. The user enters
  195.    a relation command to discover what relations are available, and an
  196.    attributes command to discover the attributes for a particular
  197.    relation.  The user eventually asks for people with a given name of
  198.    "J*" and a surname of "Ordille" who work for "Lucent Tech*". The
  199.    response is current through June 11, 1996 at 11 p.m. EDT.  Figure 1a
  200.    and Figure 1b provide this scenario.
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Elliott & Ordille            Informational                      [Page 4]
  227.  
  228. RFC 2259                          SNQP                      January 1998
  229.  
  230.  
  231.    ---------------------------------------------------------------------
  232.  
  233.       > telnet nomen.research.bell-labs.com 4224
  234.       Trying 135.104.70.9...
  235.       Connected to nomen.research.bell-labs.com.
  236.       Escape character is '^]'.
  237.       220 nomen.research.bell-labs.com Nomenclator Query Service ready
  238.  
  239.       relations
  240.       211-There is 1 relation defined:
  241.       211 People
  242.  
  243.       attributes People
  244.       212-There are 20 attributes in relation "People":
  245.       212-Given_Name
  246.       212-Middle_Name
  247.       212-Surname
  248.       212-Name_Suffix
  249.       212-Title
  250.       212-Organization
  251.       212-Division
  252.       212-Department
  253.       212-Building
  254.       212-Street
  255.       212-City
  256.       212-State_or_Province
  257.       212-Postal_Code
  258.       212-Country
  259.       212-Phone
  260.       212-Fax
  261.       212-Email
  262.       212-MHSmail
  263.       212-Last_Modified
  264.       212 Source
  265.  
  266.  
  267.                        Figure 1a: New User Queries Server
  268.  
  269.    ---------------------------------------------------------------------
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Elliott & Ordille            Informational                      [Page 5]
  283.  
  284. RFC 2259                          SNQP                      January 1998
  285.  
  286.  
  287.    ---------------------------------------------------------------------
  288.  
  289.       query
  290.       350 Send the query text, end with .
  291.  
  292.       select * from People where
  293.              given_name = "J*" and surname = "Ordille" and
  294.              organization = "Lucent Tech*";
  295.       .
  296.       351 Partial response follows, ended with .
  297.  
  298.       Given_Name: Joann
  299.       Middle_Name: J.
  300.       Surname: Ordille
  301.       Title: MTS
  302.       Organization: Lucent Technologies
  303.       Division: Bell Laboratories
  304.       Department: Computing Sciences Research Center
  305.       Building: 2C-301
  306.       Street: 700 Mountain Avenue
  307.       City: Murray Hill
  308.       State_or_Province: New Jersey
  309.       Postal_Code: 07974
  310.       Country: United States
  311.       Phone: +1 908 582 7114
  312.       Email: joann@bell-labs.com
  313.       Source: nomen://bell-labs.com:17036/email=joann@bell-labs.com
  314.  
  315.       .
  316.       250 All queries processed.  Current through 11-Jun-1996 23:00 EDT.
  317.  
  318.       quit
  319.       221 nomen.research.bell-labs.com closing transmission channel
  320.  
  321.       Connection closed by foreign host.
  322.  
  323.  
  324.                       Figure 1b: New User Queries Server
  325.                                  (continued)
  326.  
  327.    ---------------------------------------------------------------------
  328.  
  329. 2.2 User with CCSO and Currentness Preferences
  330.  
  331.    A user who is accustomed to CCSO name servers prefers CCSO word-based
  332.    matching within attribute strings.  Each word in the query string for
  333.    an attribute must appear in some order in the response string.  The
  334.    wildcard "*" matches any substring within a word.  The default
  335.  
  336.  
  337.  
  338. Elliott & Ordille            Informational                      [Page 6]
  339.  
  340. RFC 2259                          SNQP                      January 1998
  341.  
  342.  
  343.    matching, illustrated in Figure 1b, is exact matching of a query
  344.    string.  The query string may include "*" wildcards which match any
  345.    substring within the response string.  Both types of matching are
  346.    case insensitive.
  347.  
  348.    In Figure 2, the CCSO-style user connects to the SNQP server, enables
  349.    csso matching, and requests some information about Ordille who works
  350.    in research at a lab division of some company.  The request asks for
  351.    information that is more current than June 11, 1996 at 11 p.m. if it
  352.    is available.
  353.  
  354.    ---------------------------------------------------------------------
  355.  
  356.       compare ccso
  357.       213 Performing ccso equality comparisons
  358.  
  359.       query 11-Jun-1996 23:00
  360.       350 Send the query text, end with .
  361.  
  362.       select given_name, surname, organization, division, department,
  363.              email from People
  364.              where surname = "Ordille" and department = "research"
  365.              and division = "lab*";
  366.       .
  367.  
  368.       351 Partial response follows, ended with .
  369.  
  370.       Given_Name: Joann
  371.       Surname: Ordille
  372.       Organization: Lucent Technologies
  373.       Division: Bell Laboratories
  374.       Department: Computing Sciences Research Center
  375.       Email: joann@bell-labs.com
  376.  
  377.       .
  378.       250 All queries processed.  Current through 12-Jun-1996 22:35 EDT.
  379.  
  380.              Figure 2: User with CCSO Preferences Queries Server
  381.  
  382.    ---------------------------------------------------------------------
  383.  
  384. 2.3 Graphical User Interface Program
  385.  
  386.    A user designs a Windows program as a front end to the SNQP server.
  387.    In Figure 3, the program requests replies formatted for a graphical
  388.    user interface program.  The program submits two SQL queries, and
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Elliott & Ordille            Informational                      [Page 7]
  395.  
  396. RFC 2259                          SNQP                      January 1998
  397.  
  398.  
  399.    receives detailed responses that indicate the type and position of
  400.    errors.  The error messages are discussed in more detail in Section
  401.    3.
  402.  
  403.    ---------------------------------------------------------------------
  404.  
  405.       imagui
  406.       214 GUI responses enabled
  407.  
  408.       query
  409.       350 Send the query text, end with .
  410.  
  411.       select * from Peple where name = "Elliott";
  412.       .
  413.       735 00000001a000015 e Unknown relation, "Peple"
  414.  
  415.       735 00000001a000027 e Attribute "name" not found in any relation used.
  416.  
  417.  
  418.       250 All queries processed.  Current through 12-Jun-1996 22:35 EDT.
  419.  
  420.       query
  421.       350 Send the query text, end with .
  422.  
  423.       select * from People wher surname = "Elliott";
  424.       .
  425.       730 00000001a000022 e syntax error
  426.  
  427.       730 00000001a000027 e syntax error
  428.  
  429.       730 00000001a000037 e syntax error
  430.  
  431.       730 00000001a000039 e syntax error
  432.  
  433.  
  434.       250 All queries processed
  435.  
  436.        Figure 3: Graphical User Interface Program Queries Server
  437.  
  438.    ---------------------------------------------------------------------
  439.  
  440. 2.4 User Changes Mind
  441.  
  442.    An exuberant user decides to search everywhere for family members,
  443.    then look up a friend who works at Epic Systems, and finally search
  444.    everywhere for an old school friend.  Once the query set starts, the
  445.    user realizes the folly of searching everywhere, stops the first
  446.  
  447.  
  448.  
  449.  
  450. Elliott & Ordille            Informational                      [Page 8]
  451.  
  452. RFC 2259                          SNQP                      January 1998
  453.  
  454.  
  455.    query, executes the second query and then stops executing the query
  456.    block.  This scenario is illustrated in Figure 4.  The t-bound is
  457.    represented by <time> in this scenario due to space restrictions.
  458.  
  459.    ---------------------------------------------------------------------
  460.  
  461.       query
  462.       350 Send the query text, end with .
  463.  
  464.       select * from people where surname = "Smith";
  465.       select given_name, surname, email from people
  466.              where surname = "Elliott"
  467.              and organization = "Epic Systems*";
  468.       select * from people where surname = "Brown";
  469.       .
  470.       next
  471.  
  472.       352 Starting next query.  Any pending responses discarded.
  473.  
  474.       351 Partial response follows, ended with .
  475.  
  476.       Given_Name: Jim
  477.       Surname: Elliott
  478.       Email: jim@apocalypse.com
  479.  
  480.       .
  481.       352 Beginning next query.  Previous current through <time>.
  482.  
  483.       stop
  484.  
  485.       251 All pending queries and responses discarded
  486.  
  487.  
  488.           Figure 4: User Changes Mind About Submitted Queries
  489.  
  490.    ---------------------------------------------------------------------
  491.  
  492. 2.5 User Worries About Costs
  493.  
  494.    In Figure 5a, the exuberant user decides to apply more caution, and
  495.    asks for advice on searching for a friend named "Susan Brown".  The
  496.    user can not recall the name of the organization where Susan works,
  497.    but remembers that the state name begins with "I".  The advice
  498.    response lists the locations of the data repositories that will be
  499.    contacted. These locations can be supplied to the SNQP server using
  500.    the "source" attribute.  Each location is followed by a blank and a
  501.    descriptive phrase for the data repository. Continuing in Figure 5b,
  502.    the SNQP server also supplies a list of attributes that may constrain
  503.  
  504.  
  505.  
  506. Elliott & Ordille            Informational                      [Page 9]
  507.  
  508. RFC 2259                          SNQP                      January 1998
  509.  
  510.  
  511.    the query further.  The user recognizes the name Northeastern, and
  512.    submits the query directly to that location.  The user could also
  513.    have added "organization = "Northeastern*"" to the original query.
  514.    Other advice options are described in Section 3.
  515.  
  516.    ---------------------------------------------------------------------
  517.  
  518.       advice
  519.       214 Basic advice enabled.  Query responses disabled.
  520.  
  521.       query
  522.       350 Send the query text, end with .
  523.  
  524.       select * from people where surname = "Brown" and
  525.                                  given_name = "Susan" and
  526.                                  state_or_province = "I*";
  527.       .
  528.  
  529.       354 The query will contact 8 data repositories, ended with .
  530.       ccso://ns.dacc.cc.il.us:105/* Danville Area Community College
  531.       ccso://ns.eiu.bgu.edu:105/* Eastern Illinois University
  532.       ccso://ns.ilstu.edu:105/* Illinois State University
  533.       ccso://ns.imsa.edu:105/* Illinois Math and Science Academy
  534.       ccso://ns.ne.edu:105/* Northeastern Illinois University
  535.       ccso://ns.uiuc.edu:105/* University of Illinois at Urbana-Champaign
  536.       ccso://ns.iup.edu:105/* Indiana University of Pennsylvania
  537.       ccso://ph.indstate.edu:105/* Indiana State University
  538.       .
  539.  
  540.  
  541.           Figure 5a: User Asks About Costs Before Executing Query
  542.  
  543.    ---------------------------------------------------------------------
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562. Elliott & Ordille            Informational                     [Page 10]
  563.  
  564. RFC 2259                          SNQP                      January 1998
  565.  
  566.  
  567.    ---------------------------------------------------------------------
  568.  
  569.       355 There are 8 attributes that may constrain the query, ended with .
  570.       Organization
  571.       Department
  572.       Email
  573.       State_or_Province
  574.       Country
  575.       Postal_Code
  576.       Phone
  577.       Source
  578.       .
  579.  
  580.       250 All queries processed.  Current through 12-Jun-1996 22:35 EDT.
  581.  
  582.       noadvice
  583.       214 Query responses returned.  Advice disabled.
  584.  
  585.       query
  586.       350 Send the query text, end with .
  587.  
  588.       select * from people where surname = "Brown" and
  589.                               given_name = "Susan" and
  590.                                  state_or_province = "I*" and
  591.                                  source ="ccso://ns.neiu.bgu.edu:105/*";
  592.       .
  593.  
  594.       351 Partial response follows, ended with .
  595.  
  596.       Given_Name: Susan
  597.       Middle_Name: W.
  598.       Surname: Brown
  599.       Organization: Northeastern Illinois University
  600.       Email: sw-brown@ne.edu
  601.       Source: ccso://ne.edu:105/alias=SW-Brown
  602.  
  603.       .
  604.       250 All queries processed.  Current through 12-Jun-1996 22:35 EDT.
  605.  
  606.           Figure 5b: User Asks About Costs Before Executing Query
  607.  
  608.    ---------------------------------------------------------------------
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618. Elliott & Ordille            Informational                     [Page 11]
  619.  
  620. RFC 2259                          SNQP                      January 1998
  621.  
  622.  
  623. 3. Commands
  624.  
  625.    SNQP commands are case insensitive and terminated with a newline <LF>
  626.    or carriage return <CR>.  In the following descriptions, SNQP
  627.    commands are in upper case and SNQP replies are in mixed case.  Items
  628.    in a command list are separated by blanks.
  629.  
  630.    Most SNQP replies are short.  They have a rely code (see Section 4),
  631.    followed by a continuation character and reply text.  If the
  632.    continuation character is blank, the reply is complete.  If the
  633.    continuation character is a dash ("-"), the reply continues on the
  634.    next line.  Text within the reply can vary, but the reply code
  635.    remains the same.  A two line reply example is given below:
  636.  
  637.    ---------------------------------------------------------------------
  638.  
  639.       nnn-Message1
  640.       nnn Message2
  641.  
  642.    ---------------------------------------------------------------------
  643.  
  644.    In some cases commands or replies may be long, so these
  645.    commands/replies use the '.'-terminated block structure that is used
  646.    for message bodies in SMTP. Blocks are comprised of lines of text
  647.    that constitute the command/reply.  Blocks are terminated with a
  648.    period on a line by itself.
  649.  
  650.    SNQP generally ignores blank lines in both directions, except that
  651.    blanks lines separate tuples within query response blocks.
  652.  
  653.    Whenever a time is listed in a command or response, it has the
  654.    format:
  655.  
  656.    ---------------------------------------------------------------------
  657.  
  658.    DD-MMM-YYYY HH:MM ZZZ
  659.  
  660.    ---------------------------------------------------------------------
  661.  
  662.    where DD is the day, MMM are the first three characters of the month,
  663.    YYYY is the year, HH the hours on a 24 hour clock, MM the minutes,
  664.    and ZZZ the commonly used US timezone abbreviations.  If time zone is
  665.    unspecified in a command, the timezone of the SNQP server is assumed.
  666.  
  667.    SNQP servers support a source attribute in every relation.  In
  668.    queries, the source attribute directs the SNQP server to a particular
  669.    data repository.  In query responses, the source attribute indicates
  670.    the origin of the information in a tuple.  In advice and error
  671.  
  672.  
  673.  
  674. Elliott & Ordille            Informational                     [Page 12]
  675.  
  676. RFC 2259                          SNQP                      January 1998
  677.  
  678.  
  679.    messages, the source attribute is provided so the client can contact
  680.    the source in later queries.  The source attribute has two possible
  681.    forms:
  682.  
  683.    ---------------------------------------------------------------------
  684.  
  685.    <protocol>://<domain-name>:<port>
  686.  
  687.    <protocol>://<domain-name>:<port>/<tuple-id>
  688.  
  689.    ---------------------------------------------------------------------
  690.  
  691.    <protocol> identifies the protocol used to contact the data
  692.    repository. The data repository can be (was) contacted at <domain-
  693.    name> and <port>.  When present, <tuple-id> identifies a specific
  694.    entry in the data repository.  It is missing when the data repository
  695.    does not have an attribute that uniquely identifies its entries.
  696.    Although the source string is similar to a URL, the protocols listed
  697.    may or may not be supported by World-Wide Web browsers.  An effort
  698.    should be made to keep the protocol identifiers consistent with
  699.    accepted standards, but in the end they are specific to SNQP servers.
  700.  
  701.    When a connection is established with an SNQP server, the server
  702.    returns the following greeting where <domain-name> is the domain name
  703.    of the server host, e.g.  nomen.research.bell-labs.com,  and
  704.    <service-name> is the name of the service, e.g. Nomenclator:
  705.  
  706.    ---------------------------------------------------------------------
  707.  
  708.       220 <domain-name> <snqp-service-name> Query Service ready
  709.  
  710.    ---------------------------------------------------------------------
  711.  
  712.    The following sections describe each command in detail.  The commands
  713.    are ordered alphabetically.  Typical reply messages are explained
  714.    with each command.  Exceptional error conditions, for example system
  715.    errors or rejection of connections due to load, may sometimes occur.
  716.    These error replies are documented in Section 4.
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. Elliott & Ordille            Informational                     [Page 13]
  731.  
  732. RFC 2259                          SNQP                      January 1998
  733.  
  734.  
  735. 3.1 Advice
  736.  
  737.    ---------------------------------------------------------------------
  738.  
  739.       ADVICE
  740.       214 Basic advice enabled. Query responses disabled.
  741.       514 Advice not available
  742.  
  743.       ADVICE <RELATION> <ATTRIBUTE>
  744.       214 Advice enabled for "<attribute>" in "<relation>"
  745.       553 Unknown relation
  746.       554 Unknown attribute
  747.       514 Advice not available for "<attribute>"
  748.  
  749.    ---------------------------------------------------------------------
  750.  
  751.    In all cases, advice disables query searches. When queries are
  752.    submitted, advice is returned about the cost of the query or ways of
  753.    constraining the query further.  There are two forms of the advice
  754.    command.
  755.  
  756.    The first form of command does not include an attribute name.  When
  757.    an SQL query is processed, the SNQP server returns a list of data
  758.    repositories that it will contact.  It also returns a list of
  759.    attributes that may constrain the query further.  The specific values
  760.    of the attributes will determine whether the query is constrained
  761.    further.  If advice is not available from the server, an error is
  762.    returned.
  763.  
  764.    The second form of advice includes the name of a relation and the
  765.    name of an attribute in that relation.  SQL queries return a list of
  766.    possible values for the attribute.  The list may be complete, or may
  767.    only include values that are known to constrain the search.  This
  768.    distinction is described further in the query command.  If advice is
  769.    not available on the attribute or the relation or attribute is
  770.    unknown, an error is returned.  When advice is not available on an
  771.    attribute, basic advice and advice on other attributes may be
  772.    available.
  773.  
  774.    Basic advice and advice for one or more attributes can be enabled
  775.    simultaneously. They are not mutually exclusive.
  776.  
  777.    The advice command is useful to application programs which present
  778.    lists of alternatives to the user.  A query-form program can enable
  779.    advice for an attribute, submit an empty query, and obtain the list
  780.    of options for the attribute.  The list will indicate whether it is a
  781.    full list of all values for the attribute, or a constraint list of
  782.  
  783.  
  784.  
  785.  
  786. Elliott & Ordille            Informational                     [Page 14]
  787.  
  788. RFC 2259                          SNQP                      January 1998
  789.  
  790.  
  791.    only those values known to constrain queries.  The program can use
  792.    full lists to create a selection menu on its query form.  A program
  793.    can also enable basic advice, submit the query, and then ask the user
  794.    to select the data repositories to search from the resulting list.
  795.  
  796. 3.2 Attributes
  797.  
  798.    ---------------------------------------------------------------------
  799.  
  800.       ATTRIBUTES <RELATION> <TIME>
  801.       212-There are <n> attributes in relation "<RELATION>":
  802.       212-<Attribute-name>
  803.       212-<Attribute-name>
  804.       212 Current through <TIME>
  805.  
  806.       553 Unknown relation.  Current through <TIME>.
  807.       556 T-bounds not supported
  808.  
  809.    ---------------------------------------------------------------------
  810.  
  811.    The attributes command lists the attributes defined for the given
  812.    relation.  Since characteristics of relations may be defined outside
  813.    the SNQP server and cached there, the user may ask for an answer that
  814.    is more recent than <TIME>.  The SNQP server will endeavor to provide
  815.    this information.  The first line of the reply notes the number of
  816.    attributes <n>.  Subsequent lines list the attribute names.  The
  817.    information in the response is current through the time returned, but
  818.    may have changed after that time.  Accepting requests to improve a
  819.    t-bound and indicating the t-bound of the result are optional for
  820.    SNQP servers.
  821.  
  822.    If the relation is unknown, an error is returned.  If <TIME> is
  823.    submitted when t-bounds are not supported, an error is returned.
  824.  
  825. 3.3 Compare
  826.  
  827.    ---------------------------------------------------------------------
  828.  
  829.       COMPARE <COMPARISON-TYPE>
  830.       213 Performing <COMPARISON-TYPE> comparisons
  831.  
  832.       555 Unknown comparison type
  833.  
  834.    ---------------------------------------------------------------------
  835.  
  836.    The compare command lists the type of equality comparison performed
  837.    for SQL queries.  The compare command can be followed by a comparison
  838.    type to set the type.  Reply 555 is returned if the comparison type
  839.  
  840.  
  841.  
  842. Elliott & Ordille            Informational                     [Page 15]
  843.  
  844. RFC 2259                          SNQP                      January 1998
  845.  
  846.  
  847.    is unknown or unsupported.  "Default" and "CCSO" are defined
  848.    comparison types.  The default equality comparison is exact string
  849.    matching.  The query string may include "*" wildcards which match any
  850.    substring within the response string.  The CCSO equality comparison
  851.    matches words within strings.  Each word in the query string for an
  852.    attribute must appear in some order in the response string.  Words
  853.    are delimited by blank, comma, colon, semi-colon, tab, and newline.
  854.    The wildcard "*" matches any substring within a word.  Both string
  855.    and word comparisons are case insensitive.
  856.  
  857. 3.4 Help
  858.  
  859.    ---------------------------------------------------------------------
  860.  
  861.       HELP
  862.       210-The following commands are available:
  863.       210-<comma-separated-command-list>
  864.       210 <comma-separated-command-list>
  865.  
  866.       HELP <COMMAND>
  867.       210-<explanation of <COMMAND>>
  868.       210 <explanation of <COMMAND>>
  869.  
  870.       500 Sorry, no help available for "<COMMAND>"
  871.  
  872.    ---------------------------------------------------------------------
  873.  
  874.    The help command returns the list of available commands. If some
  875.    commands are not supported, for example advice, they should not be
  876.    listed.  Use of unsupported commands should still return an
  877.    informative error message.  Help can be followed by a command name
  878.    for information on that command.  If no help is available for a
  879.    command or the command does not exist, Reply 500 is returned.
  880.  
  881. 3.5 Imagui
  882.  
  883.    ---------------------------------------------------------------------
  884.  
  885.       IMAGUI
  886.       215 GUI responses enabled
  887.  
  888.    ---------------------------------------------------------------------
  889.  
  890.    The imagui command informs the server that the client is a graphical
  891.    user interface (GUI).  The client requests more comprehensive,
  892.    program-oriented errors and progress reports. It replies that GUI
  893.    responses are enabled.  See Section 4 for more information on GUI
  894.    responses.
  895.  
  896.  
  897.  
  898. Elliott & Ordille            Informational                     [Page 16]
  899.  
  900. RFC 2259                          SNQP                      January 1998
  901.  
  902.  
  903. 3.6 Next
  904.  
  905.    ---------------------------------------------------------------------
  906.  
  907.       NEXT
  908.       353 Starting next query.  Any pending responses discarded.
  909.  
  910.       450 No query in progress
  911.  
  912.    ---------------------------------------------------------------------
  913.  
  914.    The next command stops processing of the current SQL query.  It
  915.    starts the next SQL query in the block submitted with the last query
  916.    command.  If none remain, the query command is completed.  An error
  917.    is returned if no query is in progress.
  918.  
  919. 3.7 Noadvice
  920.  
  921.    ---------------------------------------------------------------------
  922.  
  923.       NOADVICE
  924.       216 Query responses enabled.  Advice disabled.
  925.  
  926.    ---------------------------------------------------------------------
  927.  
  928.    The noadvice command disables advice for query commands.  It
  929.    activates query searches, so queries will return responses.  See the
  930.    advice command for more information.
  931.  
  932. 3.8 Noimagui
  933.  
  934.    ---------------------------------------------------------------------
  935.  
  936.       NOIMAGUI
  937.       215 GUI responses disabled
  938.  
  939.    ---------------------------------------------------------------------
  940.  
  941.    The noimagui command disables detailed messages to a graphical user
  942.    interface program. It replies that GUI responses are disabled.  See
  943.    Section 4 for more information on GUI responses.
  944.  
  945. 3.9 Query
  946.  
  947.    The query command behaves differently depending on whether responses
  948.    or advice are enabled. We first describe the submission of a query
  949.    and the possible immediate error responses.  We then describe the
  950.  
  951.  
  952.  
  953.  
  954. Elliott & Ordille            Informational                     [Page 17]
  955.  
  956. RFC 2259                          SNQP                      January 1998
  957.  
  958.  
  959.    possible replies to the query command when responses are enabled.  We
  960.    finish by describing the possible replies to the query command when
  961.    advice is enabled.
  962.  
  963.    ---------------------------------------------------------------------
  964.  
  965.       QUERY <TIME>
  966.       350 Send query text, end with .
  967.  
  968.       450 Query already in progress
  969.       552 Query blocks are limited to one SQL query
  970.       556 T-bounds not supported
  971.  
  972.    ---------------------------------------------------------------------
  973.  
  974.    The query command submits a block of SQL queries to the SNQP server.
  975.    Each SQL query must be terminated with a semi-colon, and the entire
  976.    block is terminated with a line containing a single period.  Special
  977.    characters in query string constants can be included using the C
  978.    language conventions, e.g. "\n" is the newline character.
  979.  
  980.    Since a variety of cached information can be used in processing the
  981.    SQL queries, the user may ask for answers that are more recent than
  982.    <TIME>.  The SNQP server will endeavor to provide this information.
  983.    Accepting requests to improve a t-bound is optional for SNQP servers.
  984.  
  985.    If a query command is already in process, the entire block is
  986.    refused.  If multiple SQL queries are submitted in one block to a
  987.    server that does not support multi-query blocks, an error is
  988.    returned.  If <TIME> is submitted when t-bounds are not supported, an
  989.    error is returned.
  990.  
  991.    ---------------------------------------------------------------------
  992.  
  993.       351 Partial response follows ended with .
  994.       352 Beginning next query.  Previous query current through <TIME>.
  995.       250 All queries processed.  Current through <TIME>.
  996.  
  997.       653 <Communications err> with <location> <location description>
  998.       660 <Error> from <location> <location description>
  999.  
  1000.       700 <SQL query parsing error>
  1001.       750 <SQL query semantic error>
  1002.       761 <Requirements Error> for <location> <location description>
  1003.  
  1004.    ---------------------------------------------------------------------
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010. Elliott & Ordille            Informational                     [Page 18]
  1011.  
  1012. RFC 2259                          SNQP                      January 1998
  1013.  
  1014.  
  1015.    Responses are returned in blocks as they arrive from data
  1016.    repositories.  Reply 351 begins a response block.  Response blocks
  1017.    are terminated with periods.  Tuples are sent within the block as a
  1018.    list of attribute name and value pairs:
  1019.  
  1020.    ---------------------------------------------------------------------
  1021.  
  1022.    <attribute-name>: <attribute-value>
  1023.                    : <attribute-value>
  1024.  
  1025.    ---------------------------------------------------------------------
  1026.  
  1027.    Only the first line of a multi-line attribute returns the
  1028.    <attribute-name>.  Successive tuples are separated with blank lines.
  1029.    Attributes with null or blank values are suppressed at the option of
  1030.    the SNQP server.
  1031.  
  1032.    In between response blocks, error replies can be reported.  Replies
  1033.    653, 660 and 761 are examples of such errors.  Reply 653 reports a
  1034.    communication error with the data repository identified by the source
  1035.    location and described by the associated string. Reply 660 reports an
  1036.    error returned by a data repository.  Reply 761 reports a known
  1037.    requirement of the data repository that the query failed to satisfy.
  1038.    Reply 761 reflects comparison of the query with known characteristics
  1039.    of the data repository by the SNQP server.  For example, some data
  1040.    repositories refuse queries that do not contain a specific subset of
  1041.    attributes in the relation.  Other replies are possible.  It is best
  1042.    to check the the type and severity of the reply against the theory of
  1043.    reply codes in Section 4.
  1044.  
  1045.    When an SQL query in a block is successfully completed, the SNQP
  1046.    server sends Reply 352 to indicate that the next query is being
  1047.    started.  Reply 352 reports the t-bound of the previous query if it
  1048.    is available. Reply 352 is sent even if the previous query terminated
  1049.    due to permanent errors.   The one exception is that permanent errors
  1050.    generated by the next or stop command supersede Reply 352.
  1051.  
  1052.    When all SQL queries are complete, the SNQP server sends Reply 250 to
  1053.    indicate that all queries have been processed.  A query block
  1054.    containing one query that has no responses will only return Reply
  1055.    250.  Reply 250 reports the t-bound of the last SQL query in the
  1056.    block if it is available.  Reply 250 is sent even if the last query
  1057.    in the block terminated due to permanent errors.   The one exception
  1058.    is that permanent errors generated by the stop command supersede
  1059.    Reply 352.
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066. Elliott & Ordille            Informational                     [Page 19]
  1067.  
  1068. RFC 2259                          SNQP                      January 1998
  1069.  
  1070.  
  1071.    Note that this command follows the convention that "intermediate"
  1072.    reply codes, as defined in Section 4, are used until the SQL query is
  1073.    complete.  Final query completion error codes abort the processing of
  1074.    the SQL query.  Examples of these errors include parsing errors
  1075.    (Reply 700) and semantic errors (Reply 750) in the SQL query.  The
  1076.    SNQP server will attempt to continue with the next query if possible.
  1077.    The block of queries will be terminated with Reply 250 or 251 (from
  1078.    the stop command) to indicate that another query will be accepted.
  1079.    Indicating the t-bound of a query response is optional for SNQP
  1080.    servers.
  1081.  
  1082.    ---------------------------------------------------------------------
  1083.  
  1084.       354-The query will contact <n> data repositories, ended with .
  1085.       <location> <location-description>
  1086.  
  1087.       355-There are <n> attributes that may constrain the query, ended with .
  1088.       <attribute-name>
  1089.  
  1090.       356-There are <n> possible values for "<attribute>", ended with .
  1091.       <attribute-value>
  1092.  
  1093.       357-There are <n> constraining values for "<attribute>", ended with .
  1094.       357-<attribute-value>
  1095.       357 <attribute-value>
  1096.  
  1097.       352 Beginning next query.  Previous query current through <TIME>.
  1098.       250 All queries processed.  Current through <TIME>.
  1099.  
  1100.       700 <SQL query parsing error>
  1101.       750 <SQL query semantic error>
  1102.  
  1103.    ---------------------------------------------------------------------
  1104.  
  1105.    Different kinds of advice are returned in different blocks.  Basic
  1106.    advice about the number, n, of data repositories that will be
  1107.    searched is returned with Reply 354.  Subsequent lines list location
  1108.    and location description for the data repositories that will be
  1109.    searched.  The data repository locations can be supplied to the SNQP
  1110.    server using the "source" attribute.  Each location is followed by a
  1111.    blank and a descriptive phrase for the data repository.
  1112.  
  1113.    Basic advice about the attributes that may constrain the query is
  1114.    returned with reply code 355.  The first line of the reply includes
  1115.    the number, n, of attributes.  Subsequent lines list the names of the
  1116.    attributes.  The specific values of the attribute will determine
  1117.    whether the query is constrained further.
  1118.  
  1119.  
  1120.  
  1121.  
  1122. Elliott & Ordille            Informational                     [Page 20]
  1123.  
  1124. RFC 2259                          SNQP                      January 1998
  1125.  
  1126.  
  1127.    Advice for a particular attribute has two forms.  First, the advice
  1128.    may list the n possible values for the attribute in reply 356.  The
  1129.    list is complete; no other values for the attribute exist within the
  1130.    context of the query.  Second, the advice may list the n values for
  1131.    the attribute that are known to constrain the query.  The list is
  1132.    incomplete; other values of the attribute may exist within the
  1133.    context of the query.
  1134.  
  1135.    When advice for an SQL query in a block is successfully completed,
  1136.    the SNQP server sends reply 352 to indicate that the next query is
  1137.    being started.  Reply 352 reports the t-bound of the advice for the
  1138.    previous query if it is available. Reply 352 is sent even if the
  1139.    previous query terminated due to permanent errors.   The one
  1140.    exception is that permanent errors generated by the next or stop
  1141.    command supersede Reply 352.
  1142.  
  1143.    When all SQL queries are complete, the SNQP server sends Reply 250 to
  1144.    indicate that all queries have been processed.  Reply 250 reports the
  1145.    t-bound of the last SQL query in the block if it is available.  Reply
  1146.    250 is sent even if the last query in the block terminated due to
  1147.    permanent errors.   The one exception is that permanent errors
  1148.    generated by the stop command supersede Reply 352.
  1149.  
  1150.    Final query completion error codes abort the processing of the SQL
  1151.    query.  Examples of these errors include parsing errors and semantic
  1152.    errors in the SQL query.  The SNQP server will attempt to continue
  1153.    with the next query if possible. The block of queries will be
  1154.    terminated with Reply 250 or 251 (from the stop command) to indicate
  1155.    that another query will be accepted.  Indicating the t-bound of
  1156.    advice is optional for SNQP servers.
  1157.  
  1158. 3.10 Relations
  1159.  
  1160.    ---------------------------------------------------------------------
  1161.  
  1162.       RELATIONS <TIME>
  1163.       211-There are <n> relations defined:
  1164.       211-<Relation-name>
  1165.       211-<Relation-name>
  1166.       211 Current through <TIME>.
  1167.  
  1168.       556 T-bounds not supported
  1169.  
  1170.    ---------------------------------------------------------------------
  1171.  
  1172.    The relations command lists the currently available relation names.
  1173.    Since characteristics of relations can be cached, the user may ask
  1174.    for an answer that is more recent than <TIME>.  The SNQP server will
  1175.  
  1176.  
  1177.  
  1178. Elliott & Ordille            Informational                     [Page 21]
  1179.  
  1180. RFC 2259                          SNQP                      January 1998
  1181.  
  1182.  
  1183.    endeavor to provide this information.  The first line of the reply
  1184.    notes the number of relations <n>.  Subsequent lines list the
  1185.    relation names. The information in the response is current through
  1186.    the time returned, but may have changed after that time.  Accepting
  1187.    requests to improve a t-bound and indicating the t-bound of the
  1188.    result are optional for SNQP servers.
  1189.  
  1190.    If <TIME> is submitted when t-bounds are not supported, an error is
  1191.    returned.
  1192.  
  1193. 3.11 Stop
  1194.  
  1195.    ---------------------------------------------------------------------
  1196.  
  1197.       STOP
  1198.       251 All pending queries and responses discarded
  1199.  
  1200.       450 No query in progress
  1201.  
  1202.    ---------------------------------------------------------------------
  1203.  
  1204.    The stop command ends processing of the current SQL query, and
  1205.    cancels any that may have followed it in the last query command.  An
  1206.    error is returned if no queries are in progress.
  1207.  
  1208. 3.12 Quit
  1209.  
  1210.    ---------------------------------------------------------------------
  1211.  
  1212.       QUIT
  1213.       221 <domain-name> closing transmission channel
  1214.  
  1215.    ---------------------------------------------------------------------
  1216.  
  1217.    The quit command ends the session.  It closes the TCP connection
  1218.    after signing off with the domain name of the SNQP server.
  1219.  
  1220. 4. Replies
  1221.  
  1222.    Most SNQP replies are short.  They have a rely code followed by a
  1223.    continuation character and reply text.  If the continuation character
  1224.    is blank, the reply is complete.  If the continuation character is a
  1225.    dash ("-"), the reply continues on the next line.  Text within the
  1226.    reply can vary, but the reply code remains the same.  A two line
  1227.    reply example is given below:
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234. Elliott & Ordille            Informational                     [Page 22]
  1235.  
  1236. RFC 2259                          SNQP                      January 1998
  1237.  
  1238.  
  1239.    ---------------------------------------------------------------------
  1240.  
  1241.       nnn-Message1
  1242.       nnn Message2
  1243.  
  1244.    ---------------------------------------------------------------------
  1245.  
  1246.    In some cases commands or replies may be long, so these
  1247.    commands/replies use the '.'-terminated block structure that is used
  1248.    for message bodies in SMTP. Blocks are comprised of lines of text
  1249.    that constitute the command/reply.  Blocks are terminated with a
  1250.    period on a line by itself.
  1251.  
  1252.    The theory of reply codes explained for SMTP in RFC-821 is used here.
  1253.    Table 2 defines the reply code structure.  Reply codes are three
  1254.    digits, xyz.  The x digit indicates the command status.  The y digit
  1255.    indicates the component of the system that generated the reply.  The
  1256.    z digit allows for further distinctions within replies from the same
  1257.    component.
  1258.  
  1259.    ---------------------------------------------------------------------
  1260.       Code  Interpretation
  1261.    ---------------------------------------------------------------------
  1262.  
  1263.       1yz   Positive preliminary reply (not used in SNQP)
  1264.       2yz   Positive completion reply
  1265.       3yz   Positive intermediate reply
  1266.       4yz   Transient negative completion reply
  1267.       5yz   Permanent negative completion reply
  1268.       6yx   Transient negative intermediate reply
  1269.       7yx   Permanent negative intermediate reply
  1270.  
  1271.       x0z   Syntax or semantic problem
  1272.       x1z   Informational reply
  1273.       x2z   Related to transmission channel
  1274.       x3z   Formatted (location coded) report for GUI
  1275.       x4z   Status message to be displayed by GUI
  1276.       x5z   Related to query resolver
  1277.       x6z   Related to data repository
  1278.       x9z   Component generating the error is unknown or suspect
  1279.  
  1280.                      Table 2: Reply Code Structure
  1281.  
  1282.    ---------------------------------------------------------------------
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290. Elliott & Ordille            Informational                     [Page 23]
  1291.  
  1292. RFC 2259                          SNQP                      January 1998
  1293.  
  1294.  
  1295.    The GUI-related reply codes are only used if the server has been
  1296.    informed that it is communicating with a graphical user interface,
  1297.    via the imagui command.   For such codes in the x3z space, digit "z"
  1298.    takes on the role of digit "y" in other codes. I.e. 735 are permanent
  1299.    negative intermediate replies about the query resolver.
  1300.  
  1301.    Table 3a and Table 3b list the defined regular (non-GUI) reply codes.
  1302.    Text messages for the reply codes may vary.  The codes are sorted
  1303.    numerically.
  1304.  
  1305.    ---------------------------------------------------------------------
  1306.  
  1307.       210-The following commands are available:
  1308.       211-There are <n> relations defined:
  1309.       212-There are <n> attributes in relation "<relation>":
  1310.       213 Performing <comparison-type> type equality comparisons
  1311.       214 Basic advice enabled.  Query responses disabled.
  1312.       214 Advice enabled for "<attribute>" in "<relation>"
  1313.       215 GUI responses enabled
  1314.       215 GUI responses disabled
  1315.       216 Query responses enabled.  Advice disabled.
  1316.  
  1317.       220 <domain-name> <snqp-service-name> Query Service ready
  1318.       221 <domain-name> closing transmission channel
  1319.  
  1320.       250 All queries processed
  1321.       250 All queries processed.  Current through <time>.
  1322.       251 All pending queries and responses discarded
  1323.  
  1324.       340 Searching <n> data repositories
  1325.       350 Send the query text, end with .
  1326.       351 Partial response follows, ended with .
  1327.       352 Beginning next query in batch
  1328.       352 Beginning next query in batch.  Previous current through <time>.
  1329.       353 Starting next query. Any pending responses discarded.
  1330.       354 The query will contact <n> data repositories, ended with .
  1331.       355 There are <n> attributes that may constrain the query, ended with .
  1332.       356 There are <n> possible values for attribute "<attribute>":
  1333.       357 There are <n> constraining values for attribute "<attribute>":
  1334.  
  1335.       420 Too many connections in progress. Try later.
  1336.       421 Error in communicating with <snqp-service-name>
  1337.       450 No query in progress
  1338.       451 Cancel ignored
  1339.  
  1340.                         Table 3a: Reply Codes
  1341.  
  1342.    ---------------------------------------------------------------------
  1343.  
  1344.  
  1345.  
  1346. Elliott & Ordille            Informational                     [Page 24]
  1347.  
  1348. RFC 2259                          SNQP                      January 1998
  1349.  
  1350.  
  1351.    ---------------------------------------------------------------------
  1352.  
  1353.       450 Query already in progress
  1354.       490 Internal error: Invalid query reference number
  1355.       491 System error: <error number or message>
  1356.       492 Internal error: Out of client table space
  1357.       499 <snqp-service-name> shutting down
  1358.       500 Sorry, no help is available for "<command>"
  1359.       501 Unknown command
  1360.       502 Too many arguments for this command
  1361.       502 Not enough arguments for this command
  1362.  
  1363.       514 Advice not available
  1364.       514 Advice not available on <attribute>
  1365.  
  1366.       552 Query blocks are limited to one SQL query
  1367.       553 Unknown relation
  1368.       553 Unknown relation.  Current through <TIME>.
  1369.       554 Unknown attribute
  1370.       555 Unknown comparison type
  1371.       556 T-bounds not supported
  1372.       557 Will not list more than <n> data repositories
  1373.       557 Will not list more than <n> attribute values
  1374.       557 Will not list more than <n> responses
  1375.       557 Too many data repositories to list
  1376.       557 Too many attribute values to list
  1377.       557 Too many responses to list
  1378.       557 Too many data repositories to search
  1379.  
  1380.       651 <Error message from query resolver>
  1381.       653 <Communications error> with <location> <location description>
  1382.       660 <Error> from <location> <location description>
  1383.  
  1384.       700 <SQL parse error message>
  1385.       750 <SQL semantic error message>
  1386.       751 <Error message from query resolver>
  1387.       761 <Requirements error> for <location> <location description>
  1388.  
  1389.       790 Internal error: <fatal error from SNQP server>
  1390.  
  1391.  
  1392.                         Table 3b: Reply Codes
  1393.                                   (Continued)
  1394.  
  1395.    ---------------------------------------------------------------------
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402. Elliott & Ordille            Informational                     [Page 25]
  1403.  
  1404. RFC 2259                          SNQP                      January 1998
  1405.  
  1406.  
  1407.    Table 4 lists the defined GUI reply codes.  Text messages for the
  1408.    reply codes may vary.  The codes are sorted numerically.  An
  1409.    explanation of the codes follows the table.
  1410.  
  1411.    ---------------------------------------------------------------------
  1412.  
  1413.       331 nnnnnnn! <message>
  1414.       331 nnnnnnn.mmmmmm <message>
  1415.       331 nnnnnnn-mmmmmm <message>
  1416.       730 nnnnnnnammmmmm e <parse error message>
  1417.       735 nnnnnnnammmmmm e <semantic error message>
  1418.       340 <status>
  1419.  
  1420.                         Table 4: GUI Reply Codes
  1421.  
  1422.    ---------------------------------------------------------------------
  1423.  
  1424.    In Table 4, nnnnnnn is the line number in a query block, and mmmmmm
  1425.    is the column in the line.  Both numbers begin counting with 1.  The
  1426.    exclamation point response directs the program to list information
  1427.    after line n.  The period response directs the program to break line
  1428.    n at column m.  The hyphen response directs the program to flag line
  1429.    n at column m.  Replies 730 and 735 direct the GUI to indicate the
  1430.    parsing or semantic error at line n, column m.  Response 340 provides
  1431.    status information that can be displayed immediately in the GUI's
  1432.    status line.  A sample status message is one that indicates which
  1433.    data repository is being contacted.
  1434.  
  1435. 5. Protocol Requirements
  1436.  
  1437.    SQL queries may often have more functionality then a server supports
  1438.    or an application demands.  Moreover, query blocks larger than one
  1439.    SQL query, advice on query costs, some types of comparison operations
  1440.    or t-bounds need not be supported by a particular server.  SNQP
  1441.    defines a minimal subset of functionality for a working SNQP
  1442.    protocol.  Functionality beyond this subset is optional.  Servers
  1443.    that do not support optional functionality must return replies that
  1444.    indicate this to the user.
  1445.  
  1446.    Table 5 lists the minimum functionality for an SNQP server.
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458. Elliott & Ordille            Informational                     [Page 26]
  1459.  
  1460. RFC 2259                          SNQP                      January 1998
  1461.  
  1462.  
  1463.    ---------------------------------------------------------------------
  1464.       Command       Limitations
  1465.    ---------------------------------------------------------------------
  1466.       advice        Not supported.
  1467.       attributes    List the attributes for a relation.
  1468.       compare       List type of comparison operation.  At least
  1469.                     one of CCSO and default comparison types must
  1470.                     be supported.  Wildcards in SQL query strings
  1471.                     can be rejected by the query command with an
  1472.                     appropriate semantic error message.
  1473.       help          Explain the available SNQP commands.
  1474.       imagui        Not supported.
  1475.       next          Not supported.
  1476.       noadvice      Supported, but has no effect since advice
  1477.                     is not supported.
  1478.       noimagui      Supported, but has no effect since imagui
  1479.                     is not supported.
  1480.       query         Submit a block containing one SQL query statement.
  1481.                     The minimum supported SQL query statement is
  1482.                     a selection query that performs equality
  1483.                     comparisons between attribute values and
  1484.                     constant strings.  Conjunctions of such comparisons
  1485.                     are supported.  The minimum SQL query does not allow
  1486.                     projections, but returns all the attributes
  1487.                     for matching tuples.
  1488.       relations     List the relations available through the SNQP
  1489.                     server.
  1490.       stop          End processing of current query.
  1491.       quit          Terminate the query session.
  1492.  
  1493.  
  1494.                  Table 5: Minimum  SNQP Server Requirements
  1495.                           (Commands do not support t-bounds)
  1496.  
  1497.    ---------------------------------------------------------------------
  1498.  
  1499. 6. Security Considerations
  1500.  
  1501.    SNQP clients and servers depend on the Domain Name Service.  They are
  1502.    subject to all the security issues that arise in that context.  This
  1503.    version of the SNQP protocol does not define procedures for
  1504.    protecting the information communicated to and from an SNQP server.
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514. Elliott & Ordille            Informational                     [Page 27]
  1515.  
  1516. RFC 2259                          SNQP                      January 1998
  1517.  
  1518.  
  1519. 7. References
  1520.  
  1521.    [1]   American National Standards Institute. "SQL," ANSI Standard
  1522.          X3.135-1989.  1989.
  1523.  
  1524.    [2]   H. Garcia-Molina, G. Wiederhold. "Read-Only Transactions in
  1525.          a Distributed Database,"  ACM Transactions on Database Systems
  1526.          7(2), pp. 209-234.  June 1982.
  1527.  
  1528.    [3]   S. Dorner, P. Pomes. "The CCSO Nameserver: A Description,"
  1529.          Computer and Communications Services Office Technical Report,
  1530.          University of Illinois, Urbana, USA. 1992. Available in the
  1531.          current "qi" distribution from
  1532.          <URL:ftp://uiarchive.cso.uiuc.edu/local/packages/ph>
  1533.  
  1534.    [4]   J. Levine, T. Mason, D. Brown. "Parsing SQL," lex  yacc, 2nd
  1535.          ed.  O'Reilly and Associates, Inc. 1992.
  1536.  
  1537.    [5]   Ordille, J., "The Internet Nomenclator Project", RFC 2258,
  1538.          January 1998.
  1539.  
  1540.    [6]   J. Ordille. "Descriptive Name Services for Large Internets,"
  1541.          Ph. D. Dissertation. University of Wisconsin. 1993.
  1542.          <URL:http://cm.bell-labs.com/cm/cs/doc/93/12-01.ps.gz>
  1543.  
  1544.    [7]   J. Ordille, B. Miller. "Distributed Active Catalogs and
  1545.          Meta-Data Caching in Descriptive Name Services," Thirteenth
  1546.          International IEEE Conference on Distributed Computing Systems,
  1547.          pp. 120-129.  May 1993.
  1548.          <URL:http://cm.bell-labs.com/cm/cs/doc/93/5-01.ps.gz>
  1549.  
  1550.    [8]   J. Ordille. "Nomenclator Home Page." 1997.
  1551.          <URL:http://cm.bell-labs.com/cm/cs/what/nomenclator/>
  1552.  
  1553.    [9]   Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821,
  1554.          August 1982.
  1555.  
  1556.    [10   Yeong, W., Howes, T., and S. Kille.  "Lightweight Directory
  1557.          Access Protocol", RFC 1777, March 1995.
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570. Elliott & Ordille            Informational                     [Page 28]
  1571.  
  1572. RFC 2259                          SNQP                      January 1998
  1573.  
  1574.  
  1575. 8. Authors' Addresses
  1576.  
  1577.    Jim Elliott
  1578.    Epic Systems Corporation
  1579.    5301 Tokay Boulevard
  1580.    Madison, WI 53711  USA
  1581.  
  1582.    EMail: jim@apocalypse.org
  1583.  
  1584.  
  1585.    Joann J. Ordille
  1586.    Bell Labs, Lucent Technologies
  1587.    Computing Sciences Research Center
  1588.    700 Mountain Avenue, Rm 2C-301
  1589.    Murray Hill, NJ 07974  USA
  1590.  
  1591.    EMail: joann@bell-labs.com
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626. Elliott & Ordille            Informational                     [Page 29]
  1627.  
  1628. RFC 2259                          SNQP                      January 1998
  1629.  
  1630.  
  1631. 9.  Full Copyright Statement
  1632.  
  1633.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  1634.  
  1635.    This document and translations of it may be copied and furnished to
  1636.    others, and derivative works that comment on or otherwise explain it
  1637.    or assist in its implementation may be prepared, copied, published
  1638.    and distributed, in whole or in part, without restriction of any
  1639.    kind, provided that the above copyright notice and this paragraph are
  1640.    included on all such copies and derivative works.  However, this
  1641.    document itself may not be modified in any way, such as by removing
  1642.    the copyright notice or references to the Internet Society or other
  1643.    Internet organizations, except as needed for the purpose of
  1644.    developing Internet standards in which case the procedures for
  1645.    copyrights defined in the Internet Standards process must be
  1646.    followed, or as required to translate it into languages other than
  1647.    English.
  1648.  
  1649.    The limited permissions granted above are perpetual and will not be
  1650.    revoked by the Internet Society or its successors or assigns.
  1651.  
  1652.    This document and the information contained herein is provided on an
  1653.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  1654.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  1655.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  1656.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  1657.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682. Elliott & Ordille            Informational                     [Page 30]
  1683.  
  1684.