rfc2259.txt
来自「著名的RFC文档,其中有一些文档是已经翻译成中文的的.」· 文本 代码 · 共 1,684 行 · 第 1/4 页
TXT
1,684 行
select * from People wher surname = "Elliott"; . 730 00000001a000022 e syntax error 730 00000001a000027 e syntax error 730 00000001a000037 e syntax error 730 00000001a000039 e syntax error 250 All queries processed Figure 3: Graphical User Interface Program Queries Server ---------------------------------------------------------------------2.4 User Changes Mind An exuberant user decides to search everywhere for family members, then look up a friend who works at Epic Systems, and finally search everywhere for an old school friend. Once the query set starts, the user realizes the folly of searching everywhere, stops the firstElliott & Ordille Informational [Page 8]RFC 2259 SNQP January 1998 query, executes the second query and then stops executing the query block. This scenario is illustrated in Figure 4. The t-bound is represented by <time> in this scenario due to space restrictions. --------------------------------------------------------------------- query 350 Send the query text, end with . select * from people where surname = "Smith"; select given_name, surname, email from people where surname = "Elliott" and organization = "Epic Systems*"; select * from people where surname = "Brown"; . next 352 Starting next query. Any pending responses discarded. 351 Partial response follows, ended with . Given_Name: Jim Surname: Elliott Email: jim@apocalypse.com . 352 Beginning next query. Previous current through <time>. stop 251 All pending queries and responses discarded Figure 4: User Changes Mind About Submitted Queries ---------------------------------------------------------------------2.5 User Worries About Costs In Figure 5a, the exuberant user decides to apply more caution, and asks for advice on searching for a friend named "Susan Brown". The user can not recall the name of the organization where Susan works, but remembers that the state name begins with "I". The advice response lists the locations of the data repositories that will be contacted. These locations can be supplied to the SNQP server using the "source" attribute. Each location is followed by a blank and a descriptive phrase for the data repository. Continuing in Figure 5b, the SNQP server also supplies a list of attributes that may constrainElliott & Ordille Informational [Page 9]RFC 2259 SNQP January 1998 the query further. The user recognizes the name Northeastern, and submits the query directly to that location. The user could also have added "organization = "Northeastern*"" to the original query. Other advice options are described in Section 3. --------------------------------------------------------------------- advice 214 Basic advice enabled. Query responses disabled. query 350 Send the query text, end with . select * from people where surname = "Brown" and given_name = "Susan" and state_or_province = "I*"; . 354 The query will contact 8 data repositories, ended with . ccso://ns.dacc.cc.il.us:105/* Danville Area Community College ccso://ns.eiu.bgu.edu:105/* Eastern Illinois University ccso://ns.ilstu.edu:105/* Illinois State University ccso://ns.imsa.edu:105/* Illinois Math and Science Academy ccso://ns.ne.edu:105/* Northeastern Illinois University ccso://ns.uiuc.edu:105/* University of Illinois at Urbana-Champaign ccso://ns.iup.edu:105/* Indiana University of Pennsylvania ccso://ph.indstate.edu:105/* Indiana State University . Figure 5a: User Asks About Costs Before Executing Query ---------------------------------------------------------------------Elliott & Ordille Informational [Page 10]RFC 2259 SNQP January 1998 --------------------------------------------------------------------- 355 There are 8 attributes that may constrain the query, ended with . Organization Department Email State_or_Province Country Postal_Code Phone Source . 250 All queries processed. Current through 12-Jun-1996 22:35 EDT. noadvice 214 Query responses returned. Advice disabled. query 350 Send the query text, end with . select * from people where surname = "Brown" and given_name = "Susan" and state_or_province = "I*" and source ="ccso://ns.neiu.bgu.edu:105/*"; . 351 Partial response follows, ended with . Given_Name: Susan Middle_Name: W. Surname: Brown Organization: Northeastern Illinois University Email: sw-brown@ne.edu Source: ccso://ne.edu:105/alias=SW-Brown . 250 All queries processed. Current through 12-Jun-1996 22:35 EDT. Figure 5b: User Asks About Costs Before Executing Query ---------------------------------------------------------------------Elliott & Ordille Informational [Page 11]RFC 2259 SNQP January 19983. Commands SNQP commands are case insensitive and terminated with a newline <LF> or carriage return <CR>. In the following descriptions, SNQP commands are in upper case and SNQP replies are in mixed case. Items in a command list are separated by blanks. Most SNQP replies are short. They have a rely code (see Section 4), followed by a continuation character and reply text. If the continuation character is blank, the reply is complete. If the continuation character is a dash ("-"), the reply continues on the next line. Text within the reply can vary, but the reply code remains the same. A two line reply example is given below: --------------------------------------------------------------------- nnn-Message1 nnn Message2 --------------------------------------------------------------------- In some cases commands or replies may be long, so these commands/replies use the '.'-terminated block structure that is used for message bodies in SMTP. Blocks are comprised of lines of text that constitute the command/reply. Blocks are terminated with a period on a line by itself. SNQP generally ignores blank lines in both directions, except that blanks lines separate tuples within query response blocks. Whenever a time is listed in a command or response, it has the format: --------------------------------------------------------------------- DD-MMM-YYYY HH:MM ZZZ --------------------------------------------------------------------- where DD is the day, MMM are the first three characters of the month, YYYY is the year, HH the hours on a 24 hour clock, MM the minutes, and ZZZ the commonly used US timezone abbreviations. If time zone is unspecified in a command, the timezone of the SNQP server is assumed. SNQP servers support a source attribute in every relation. In queries, the source attribute directs the SNQP server to a particular data repository. In query responses, the source attribute indicates the origin of the information in a tuple. In advice and errorElliott & Ordille Informational [Page 12]RFC 2259 SNQP January 1998 messages, the source attribute is provided so the client can contact the source in later queries. The source attribute has two possible forms: --------------------------------------------------------------------- <protocol>://<domain-name>:<port> <protocol>://<domain-name>:<port>/<tuple-id> --------------------------------------------------------------------- <protocol> identifies the protocol used to contact the data repository. The data repository can be (was) contacted at <domain- name> and <port>. When present, <tuple-id> identifies a specific entry in the data repository. It is missing when the data repository does not have an attribute that uniquely identifies its entries. Although the source string is similar to a URL, the protocols listed may or may not be supported by World-Wide Web browsers. An effort should be made to keep the protocol identifiers consistent with accepted standards, but in the end they are specific to SNQP servers. When a connection is established with an SNQP server, the server returns the following greeting where <domain-name> is the domain name of the server host, e.g. nomen.research.bell-labs.com, and <service-name> is the name of the service, e.g. Nomenclator: --------------------------------------------------------------------- 220 <domain-name> <snqp-service-name> Query Service ready --------------------------------------------------------------------- The following sections describe each command in detail. The commands are ordered alphabetically. Typical reply messages are explained with each command. Exceptional error conditions, for example system errors or rejection of connections due to load, may sometimes occur. These error replies are documented in Section 4.Elliott & Ordille Informational [Page 13]RFC 2259 SNQP January 19983.1 Advice --------------------------------------------------------------------- ADVICE 214 Basic advice enabled. Query responses disabled. 514 Advice not available ADVICE <RELATION> <ATTRIBUTE> 214 Advice enabled for "<attribute>" in "<relation>" 553 Unknown relation 554 Unknown attribute 514 Advice not available for "<attribute>" --------------------------------------------------------------------- In all cases, advice disables query searches. When queries are submitted, advice is returned about the cost of the query or ways of constraining the query further. There are two forms of the advice command. The first form of command does not include an attribute name. When an SQL query is processed, the SNQP server returns a list of data repositories that it will contact. It also returns a list of attributes that may constrain the query further. The specific values of the attributes will determine whether the query is constrained further. If advice is not available from the server, an error is returned. The second form of advice includes the name of a relation and the name of an attribute in that relation. SQL queries return a list of possible values for the attribute. The list may be complete, or may only include values that are known to constrain the search. This distinction is described further in the query command. If advice is not available on the attribute or the relation or attribute is unknown, an error is returned. When advice is not available on an attribute, basic advice and advice on other attributes may be available. Basic advice and advice for one or more attributes can be enabled simultaneously. They are not mutually exclusive. The advice command is useful to application programs which present lists of alternatives to the user. A query-form program can enable advice for an attribute, submit an empty query, and obtain the list of options for the attribute. The list will indicate whether it is a full list of all values for the attribute, or a constraint list ofElliott & Ordille Informational [Page 14]RFC 2259 SNQP January 1998 only those values known to constrain queries. The program can use full lists to create a selection menu on its query form. A program can also enable basic advice, submit the query, and then ask the user to select the data repositories to search from the resulting list.3.2 Attributes --------------------------------------------------------------------- ATTRIBUTES <RELATION> <TIME> 212-There are <n> attributes in relation "<RELATION>": 212-<Attribute-name> 212-<Attribute-name> 212 Current through <TIME> 553 Unknown relation. Current through <TIME>. 556 T-bounds not supported --------------------------------------------------------------------- The attributes command lists the attributes defined for the given relation. Since characteristics of relations may be defined outside the SNQP server and cached there, the user may ask for an answer that is more recent than <TIME>. The SNQP server will endeavor to provide this information. The first line of the reply notes the number of attributes <n>. Subsequent lines list the attribute names. The information in the response is current through the time returned, but may have changed after that time. Accepting requests to improve a t-bound and indicating the t-bound of the result are optional for SNQP servers. If the relation is unknown, an error is returned. If <TIME> is submitted when t-bounds are not supported, an error is returned.3.3 Compare --------------------------------------------------------------------- COMPARE <COMPARISON-TYPE> 213 Performing <COMPARISON-TYPE> comparisons 555 Unknown comparison type --------------------------------------------------------------------- The compare command lists the type of equality comparison performed for SQL queries. The compare command can be followed by a comparison type to set the type. Reply 555 is returned if the comparison typeElliott & Ordille Informational [Page 15]
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?