home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 2000s / rfc2016.txt < prev    next >
Text File  |  1996-10-29  |  38KB  |  1,180 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                          L. Daigle
  8. Request for Comments: 2016                                    P. Deutsch
  9. Category: Experimental                                         B. Heelan
  10.                                                               C. Alpaugh
  11.                                                            M. Maclachlan
  12.                                         Bunyip Information Systems, Inc.
  13.                                                             October 1996
  14.  
  15.                      Uniform Resource Agents (URAs)
  16.  
  17. Status of this Memo
  18.  
  19.    This memo defines an Experimental Protocol for the Internet
  20.    community.  This memo does not specify an Internet standard of any
  21.    kind.  Discussion and suggestions for improvement are requested.
  22.    Distribution of this memo is unlimited.
  23.  
  24. Abstract
  25.  
  26.    This paper presents an experimental architecture for an agent system
  27.    that provides sophisticated Internet information access and
  28.    management.  Not a generalized architecture for active objects that
  29.    roam the Internet, these agents are modeled as extensions of existing
  30.    pieces of the Internet information infrastructure.  This experimental
  31.    agent technology focuses on the necessary information structures to
  32.    encapsulate Internet activities into objects that can be activated,
  33.    transformed, and combined into larger structured activities.
  34.  
  35. Acknowledgements
  36.  
  37.    Several people have shared thoughts and viewpoints that have helped
  38.    shape the thinking behind this work over the past few years.  We'd
  39.    like to thank, in particular, Chris Weider, Patrik Faltstrom, Michael
  40.    Mealling, Alan Emtage, and the participants in the IETF URI Working
  41.    Group for many thought-provoking discussions.
  42.  
  43.    Sima Newell provided insightful comments on the document -- thanks to
  44.    her it is much more readable!
  45.  
  46. Introduction
  47.  
  48.    This document outlines an experimental agent system architecture that
  49.    was designed for the purpose of addressing high-level Internet
  50.    activities through encapsulation of protocol-specific actions.
  51.    Originally presented to the Uniform Resource Identifier (URI) working
  52.    group at the IETF, this technology was seen as taking a step beyond
  53.    resource location and resource naming.  By providing a structured
  54.    mechanism for abstracting characteristics of desired information and
  55.  
  56.  
  57.  
  58. Daigle, et. al.               Experimental                      [Page 1]
  59.  
  60. RFC 2016                Uniform Resource Agents             October 1996
  61.  
  62.  
  63.    distancing the necessary access incantations from the client, the
  64.    notion of a Uniform Resource Agent (URA) was created.
  65.  
  66.    The evolution of Internet information systems has been characterized
  67.    by building upon successive layers of encapsulated technologies.
  68.    Machine address numbers were devised, and then encapsulated in
  69.    advertised machine names, which has allowed the evolution of the
  70.    Domain Name System (DNS) [RFC1034, RFC1035].  Protocols were
  71.    developed for accessing Internet resources of various descriptions,
  72.    and then uniform mechanisms for specifying resource locations,
  73.    standardized across protocol types, were developed (URLs) [RFC1738].
  74.    Each layer of Internet information primitives has served as the
  75.    building blocks for the next level of abstraction and sophistication
  76.    of information access, location, discovery and management.
  77.  
  78.    The work described in this paper is an experimental system designed
  79.    to take another step in encapsulation.  While TCP/IP protocols for
  80.    routing, addressing, etc, have permitted the connection and
  81.    accessibility of a plethora of information services on the Internet,
  82.    these must yet be considered a diverse collection of heterogeneous
  83.    resources.  The World Wide Web effort is the most successful to date
  84.    in attempting to knit these resources into a cohesive whole.
  85.    However, the activity best-supported by this structure is (human)
  86.    browsing of these resources as documents.  The URA initiative
  87.    explores the possibility of specifying an activity with the same kind
  88.    of precision accorded to resource naming and identification.  By
  89.    focusing on activities, and not actions, URAs encapsulate resource
  90.    access mechanisms based on commonality of information content, not
  91.    protocol similarity.
  92.  
  93.    An invoker -- human or otherwise -- may delegate an entire set of
  94.    tasks to a fully-instantiated URA.  The nature of the tasks is
  95.    completely specified by the agent, because it encapsulates knowledge
  96.    about relevant Internet resources and the information required in
  97.    order to access them.  In this way, URAs insulate invokers from the
  98.    details of Internet protocols while allowing them to carry out high-
  99.    level Internet activities (such as searching a set of web pages and
  100.    news groups relevant to a given topic).  Also, by formally specifying
  101.    a high-level Internet activity in an agent, the same activity can be
  102.    repeated at a later date by the same invoker, someone else or even
  103.    another agent. Moreover, the agent object may easily be modified to
  104.    carry out another related task.
  105.  
  106.    More detail describing the underlying philosophy of this particular
  107.    approach can be found in [IIAW95].
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Daigle, et. al.               Experimental                      [Page 2]
  115.  
  116. RFC 2016                Uniform Resource Agents             October 1996
  117.  
  118.  
  119. Examples
  120.  
  121.    As a very simple example, consider the client task of subscribing to
  122.    a mailing list.  There are many mechanisms for providing users with
  123.    information necessary to complete a subscription.  Currently, all
  124.    applications which provide the ability to subscribe to mailing lists
  125.    must contain protocol-aware code to carry out the task once the
  126.    requisite personal data has been solicited from the user.
  127.    Furthermore, any application program that embeds the ability to
  128.    subscribe in its code necessarily limits the set of mailing lists to
  129.    which a client can subscribe (i.e, to those types foreseen by the
  130.    software's creators).  If, instead, there is an agent to which this
  131.    task can be delegated, all applications can make use of the agent,
  132.    and that agent becomes responsible for carrying out the necessary
  133.    interactions to complete the subscription.  Furthermore, that agent
  134.    may be a client to other agents which can supply particular
  135.    information about how to subscribe to new types of mail servers, etc.
  136.    URAs have been explored as an agent technology to address just these
  137.    types of issues.
  138.  
  139. Relationship to Other Internet Agents
  140.  
  141.    A number of Internet-aware agent and transportable code systems have
  142.    become popular -- Java [JAVA], TCL [TCL] and Safe-TCL, Telescript
  143.    [TELE], and the TACOMA system [TACOMA], to name a few of them.  To
  144.    understand the scope of the problem that URAs tackle, it is helpful
  145.    to understand how these systems differ from the URA approach.  Some
  146.    of these agent systems, like Java, focus on providing mechanisms for
  147.    creating and distributing (inter)active documents in the World Wide
  148.    Web.  Others, like TACOMA, have more general intentions of providing
  149.    environments for mobile, interacting processes.
  150.  
  151.    While each of these systems makes its individual contribution to
  152.    solving the transportation, communication, and security issues
  153.    normally associated with agent systems, they yield more objects that
  154.    exist within the Internet information space.  That is, while they may
  155.    permit individual users to have a more sophisticated interaction with
  156.    a particular information resource, they do not address the more
  157.    general Internet problems of naming, identifying, locating resources,
  158.    and locating the same or similar resources again at a later date. It
  159.    is this set of problems that URAs specifically set out to address.
  160.  
  161.    In order to create these URA objects that encapsulate a set of
  162.    Internet activities, it is necessary to specify their operating
  163.    environment and design structure.  Together, these form an
  164.    experimental architecture for URAs, which can be evaluated in a
  165.    preliminary way through a prototype implementation. The remainder of
  166.    this paper describes such an experimental architecture, and outlines
  167.  
  168.  
  169.  
  170. Daigle, et. al.               Experimental                      [Page 3]
  171.  
  172. RFC 2016                Uniform Resource Agents             October 1996
  173.  
  174.  
  175.    a prototype application built to test the concepts involved in the
  176.    creation and execution of URAs.
  177.  
  178. The Experimental Architecture
  179.  
  180.    The main goal in designing the URA architecture was to provide a
  181.    mechanism for separating client need descriptions from the
  182.    specifications of mechanisms for satisfying those needs.  For
  183.    example, from the client's perspective, the need to find MIDI music
  184.    files is quite distinct from the particular Internet resource actions
  185.    that might be necessary to find them at a given point in time.  This
  186.    one need might be best met by integrating information from several
  187.    very different sources.  Also, the client may have the same need on a
  188.    different day, but there may be new or different resources to call on
  189.    to satisfy it.
  190.  
  191.    A further goal was to provide very structured specifications of the
  192.    Internet actions carried out by a particular URA.  By making the
  193.    structure of an action explicit, it becomes possible to operate on
  194.    portions of an agent structure without requiring an understanding of
  195.    the complete semantics of its activity.
  196.  
  197.    At the centre of the URA architecture is the concept of a
  198.    (persistent) specification of an activity.  For purposes that should
  199.    become clear as the expected usage of URAs is described in more
  200.    detail, we choose to support this concept with the following
  201.    requirements of the architecture:
  202.  
  203.    - there is a formalized environment in which these specifications
  204.      are examined and executed and otherwise manipulated.  This is
  205.      referred to as a URAgency.
  206.  
  207.    - the activity specifications are modular, and independent of a
  208.      given URAgency environment.  Thus, they exist as object constructs
  209.      that can be shared amongst URAgencies.  There is a standardized
  210.      _virtual_ structure of these URA objects, although different
  211.      types may exist, with different underlying implementations.
  212.  
  213. Basic URAgency Requirements
  214.  
  215.    In the most abstract sense, a URAgency is a software system that
  216.    manipulates URA objects.  In the terminology of objects, a URAgency
  217.    identifies the types of URAs it handles, and is responsible for
  218.    applying methods to objects of those types.  For the purposes of this
  219.    experimental work, the only methods it is required to support are
  220.    those to get information about a given URA, and to execute a URA.
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Daigle, et. al.               Experimental                      [Page 4]
  227.  
  228. RFC 2016                Uniform Resource Agents             October 1996
  229.  
  230.  
  231.    The expected result of applying the "get information" method to a URA
  232.    is a description of some or all of the URA following the standardized
  233.    virtual structure of a URA object, outlined below.
  234.  
  235.    The appropriate way to "execute" a URA is to supply information for
  236.    the individual URA data segments (in effect, to permit the creation
  237.    of an instance of a virtual object), or to identify a URA instance.
  238.    Again, the information is to be supplied in accordance with the
  239.    virtual structure below.
  240.  
  241.    A URAgency claiming to handle a particular type of URA must have the
  242.    ability to map the implementation structure of that type of URA into
  243.    and out of the standard virtual URA structure. The URAgency must also
  244.    know how to activate the URA, and it must satisfy any runtime
  245.    dependencies for that type of URA.
  246.  
  247.    For example, a URA type may consist of a Pascal program binary which,
  248.    when run with particular command line arguments, yields information
  249.    in the standard URA object structure.  Activating this type of URA
  250.    might consist of executing the Pascal binary with an input file
  251.    containing all the necessary data segments.  A URAgency claiming to
  252.    handle this sort of URA type must first be able to provide an
  253.    environment to execute the Pascal binary (for whatever platform it
  254.    was compiled), and also be able to interact with the Pascal binary
  255.    according to these conventions to get information about the URA, or
  256.    execute it.
  257.  
  258.    As an alternative example, a URA type may consist of a script in some
  259.    interpreted language, with the URA object structure embedded as data
  260.    structures within the script.  A URAgency handling this type of URA
  261.    might have to be able to parse the script to pull out the standard
  262.    URA object structure, and provide the script language interpreter for
  263.    the purposes of executing the URA.
  264.  
  265. URA Object Structure
  266.  
  267.    In order to capture the necessary information for carrying out the
  268.    type of Internet activity described in the introductory paragraphs of
  269.    this document, six basic (virtual) components of a URA object have
  270.    been identified.  Any implementation of a URA type is expected to be
  271.    able to conform to this structure within the context of a URAgency.
  272.  
  273.    The six basic components of a URA object are:
  274.  
  275. URA HEADER:
  276.         Identification of the URA object, including a URA name, type
  277.         and abstract, creator name, and the resources required by the
  278.         URA.
  279.  
  280.  
  281.  
  282. Daigle, et. al.               Experimental                      [Page 5]
  283.  
  284. RFC 2016                Uniform Resource Agents             October 1996
  285.  
  286.  
  287. ACTIVATION DATA:
  288.         Specification of the data elements required to carry out the
  289.         URA activity.  For example, in the case of an Internet search
  290.         for "people", this could include specification of fields for
  291.         person name, organization, e-mail address.
  292.  
  293. TARGETS:
  294.         Specification of the URL/URN's to be accessed to carry out the
  295.         activity.  Note that, until URN's are in common use, the
  296.         ability to adjust URLs will be necessary.  A key issue for
  297.         URAs is the ability to transport them and activate them far
  298.         from the creator's originating site.  This may have
  299.         implications in terms of accessibility of resource sites.  For
  300.         example, a software search created in Canada will likely
  301.         access a Canadian Archie server, and North American ftp sites.
  302.         However, an invoker in Australia should not be obliged to edit
  303.         the URA object in order to render it relevant in Australia.
  304.         The creator, then, can use this section to specify the
  305.         expected type of service, with variables for the parts
  306.         that can be modified in context (e.g., the host name for an
  307.         Archie server, or a mirror ftp site).
  308.  
  309. EXPERIENCE INFORMATION:
  310.         Specification of data elements that are not strictly involved
  311.         in conversing with the targets in order to carry out the
  312.         agent's activity.  This space can be used to store information
  313.         from one invocation of a URA instance to the next.
  314.         This kind of information could include date of last
  315.         execution, or URLs of resources located on a previous
  316.         invocation of the agent.
  317.  
  318. ACTIVITY:
  319.         If URAs were strictly data objects, specifying required data
  320.         and URL/URN's would suffice to capture the essence of the
  321.         composite net interaction.  However, the variability of
  322.         Internet resource accesses and the scope of what URAs could
  323.         accomplish in the net environment seem to suggest the need to
  324.         give the creator some means of organizing the instantiation of
  325.         the component URL/URN's.  Thus, the body of the URA should
  326.         contain a scripting mechanism that minimally allows
  327.         conditional instantiation of individual URL/URN's.  These
  328.         conditions could be based on which (content) data elements the
  329.         user provided, or accessibility of one URL/URN, etc.  It also
  330.         provides a mechanism for suggesting scheduling of URL/URN
  331.         instantiation.
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Daigle, et. al.               Experimental                      [Page 6]
  339.  
  340. RFC 2016                Uniform Resource Agents             October 1996
  341.  
  342.  
  343.         The activity is specified by a script or program in a language
  344.         specified by the URA type, or by the URA header information.
  345.         All the required activation data, targets, and experience
  346.         information are referenced by their specification names.
  347.  
  348. RESPONSE FILTER:
  349.         The main purpose of the ACTIVITY module is to specify the
  350.         steps necessary to take the ACTIVATION DATA, contact the
  351.         TARGETS, and collect responses from those services.  The
  352.         purpose of the RESPONSE FILTER module is to transform those
  353.         responses into the result of the URA invocation.  This
  354.         transformation may be along the lines of reformatting
  355.         some text, or it may be a more elaborate interpretation
  356.         such as a relevance rating for a retrieved HTML page.
  357.  
  358.         The response filter is specified by a script or program in a
  359.         language specified by the URA type, or by the URA header
  360.         information.  All the required activation data, targets, and
  361.         experience information are referenced by their specification
  362.         names.
  363.  
  364.    See Appendix 1 for a more detailed description of the components of a
  365.    URA.  Appendix 2 contains a sample virtual URA structure.
  366.  
  367. The Architecture in Action
  368.  
  369.    Having introduced the required capabilities of the URAgency and
  370.    virtual structure of URA objects, it is now time to elaborate on the
  371.    tasks and interactions that are best supported by URAs.
  372.  
  373.    URAs are constructed by identifying net-based resources of interest
  374.    (targets) to carry out a particular task.  The activation data
  375.    component of a URA is the author's mechanism for specifying (to the
  376.    invoker) the elements of information that are required for successful
  377.    execution .  An invoker creates an instance of a URA object by
  378.    providing data that is consistent with, or fills in, this template.
  379.    Such an instance encapsulates everything that the agent "needs to
  380.    know" in order to contact the specified target(s), make a request of
  381.    the resource ("get", "search", etc.) and return a result to the
  382.    invoker.  This encapsulation is a sophisticated identification of the
  383.    task results.
  384.  
  385.    For example, in the case of a mailing list subscription URA, the
  386.    creator will identify the target URL for a resource that handles list
  387.    subscription (e.g., an HTML form), and specify the data required by
  388.    that resource (such as user name, user mail address, and mailing list
  389.    identifier).  When an invoker provides that information and
  390.    instantiates the URA, the resulting object completely encapsulates
  391.  
  392.  
  393.  
  394. Daigle, et. al.               Experimental                      [Page 7]
  395.  
  396. RFC 2016                Uniform Resource Agents             October 1996
  397.  
  398.  
  399.    all that is needed in order to subscribe the user -- the subscription
  400.    result is identified.
  401.  
  402.    URAs are manipulated through the application of methods.  This, in
  403.    turn , is governed by the URAgency with which the invoker is
  404.    interacting.  However, because the virtual structure of URAs is
  405.    represented consistently across URA types and URAgencies, a URAgency
  406.    can act as one of the targets of a URA.  Since methods can be applied
  407.    to URAs remotely, URAs can act as invokers of URAs.  This can yield a
  408.    complex structure of task modules.
  409.  
  410.    For example, a URA designed to carry out a generalized search of
  411.    book-selling resources might make use of individual URAs tailored to
  412.    each resource.  Thus, the top-level URA becomes the orchestrating URA
  413.    for access to a number of disparate resources, while being insulated
  414.    from the minute details of accessing those resources.
  415.  
  416. A Prototype Implementation
  417.  
  418.    The experimental work with URAs includes a prototype implementation
  419.    of URA objects.  These are written in the Tcl scripting language.  A
  420.    sample prototype Tcl URA can be found in Appendix 3.
  421.  
  422.    The URAgency that was created to handle these URAs is part of the
  423.    Silk Desktop Internet Resource Discovery tool. Silk provides a
  424.    graphical user interface environment that allows the user to access
  425.    and search for Internet information without having to know where to
  426.    look or how to look. Silk presents a list of the available URAs to
  427.    carry out these activities (e.g., "search for tech reports" or
  428.    "hotlist").  For each activity, the user is prompted for the
  429.    activation data, and Silk's URAgency executes the URA.  The Silk
  430.    software also supports the creation and maintenance of URA object
  431.    instances.  Users can add new URAs by creating new Tcl scripts (per
  432.    the guidelines in the "URA Writer's Guide", available with the Silk
  433.    software.  See [SILK]).  The Silk graphical interface hides some of
  434.    the mechanics of the underlying URAgency.  A more directly-accessible
  435.    version of this URAgency will become available.
  436.  
  437. Conclusions
  438.  
  439.    This work was originally conceived as an extension to the family of
  440.    Uniform Resource Identifiers (URIs): Uniform Resource Locators
  441.    (URLs), Uniform Resource Characteristics (URCs), and the proposed
  442.    Uniform Resource Names (URNs).  The approach of formalizing the
  443.    characteristics of an information task in a standardized object
  444.    structure is seen as a means of identifying a class of resources, and
  445.    contributes to the level of abstraction with which users can refer to
  446.    Internet resources.
  447.  
  448.  
  449.  
  450. Daigle, et. al.               Experimental                      [Page 8]
  451.  
  452. RFC 2016                Uniform Resource Agents             October 1996
  453.  
  454.  
  455.    Although still in its experimental stages, this work has already
  456.    evoked interest and shown promise in the area of providing mechanisms
  457.    for building more advanced tools to interact with the Internet at a
  458.    more sophisticated level than just browsing web pages.
  459.  
  460.    One of the major difficulties that has been faced in developing a
  461.    collection of URAs is the brittleness induced by interacting with
  462.    services that are primarily geared towards human-users.  Small
  463.    changes in output formats that are easily discernible by the human
  464.    eye can be entirely disruptive to a software client that must apply a
  465.    parsing and interpretation mechanism based on placement of cues in
  466.    the text.  This problem is certainly not unique to URAs -- any
  467.    software acting upon results from such a service is affected.
  468.    Perhaps there is the need for an evolution of "service entrances" to
  469.    information servers on the Internet -- mechanisms for getting "just
  470.    the facts" from an information server.  Of course, one way to provide
  471.    such access is for the service provider to develop and distribute a
  472.    URA that interacts with the service.  When the service's interface
  473.    changes, the service provider will be moved to update the URA that
  474.    was built to access it reliably.
  475.  
  476.    Work will continue to develop new types of URAs, as well as other
  477.    URAgencies.  This will necessitate the creation of URAgency
  478.    interaction standards -- the "common virtual URA object structure" is
  479.    the first step towards defining a lingua franca among URAs of
  480.    disparate types and intention.
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506. Daigle, et. al.               Experimental                      [Page 9]
  507.  
  508. RFC 2016                Uniform Resource Agents             October 1996
  509.  
  510.  
  511. References
  512.  
  513.  
  514. [IIAW95] Leslie L. Daigle, Peter Deutsch, "Agents for Internet
  515.    Information Clients", CIKM'95 Intelligent Information Agents
  516.    Workshop, December 1995.
  517.    Available from
  518.      <http://www.bunyip.com/products/silk/silktree/uratree/iiaw95.ps>
  519.  
  520. [JAVA] "The Java Language: A White Paper" Available from
  521.      <http://java.sun.com/1.0alpha2/doc/overview/java/index.html>
  522.  
  523. [RFC1034] Mockapetris, P., "Domain Names - Concepts and Facilities",
  524.    STD 13, RFC 1034, November 1987.
  525.  
  526. [RFC1035] Mockapetris, P., "Domain Names - Implementation and
  527.    Specification", STD 13, RFC 1035, November 1987.
  528.  
  529. [RFC1738] T. Berners-Lee, L. Masinter, M. McCahill, "Uniform Resource
  530.    Locators (URL)", RFC 1738, December 1994.
  531.  
  532. [SILK] Bunyip's Silk project homepage:
  533.      <http://www.bunyip.com/products/silk/>
  534.  
  535. [SILKURA] Silk URA information:
  536.      <http://www.bunyip.com/products/silk/silktree/uraintro.html>
  537.  
  538. [TACOMA] Johansen, D. van Renesse, R. Schneider, F. B., "An
  539.    Introduction to the TACOMA Distributed System", Technical Report
  540.    95-23, Department of Computer Science, University of Tromso,
  541.    Norway, June 1995.
  542.  
  543. [TCL] Ousterhout, J. K. "Tcl and the Tk Toolkit", Addison Wesley,
  544.    1994.
  545.  
  546. [TELE] White, J. E., "Telescript Technology: The Foundation for the
  547.    Electronic Marketplace", General Magic White Paper, General Magic
  548.    Inc., 1994.
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562. Daigle, et. al.               Experimental                     [Page 10]
  563.  
  564. RFC 2016                Uniform Resource Agents             October 1996
  565.  
  566.  
  567. Authors' Addresses
  568.  
  569.    Leslie Daigle
  570.    Peter Deutsch
  571.    Bill Heelan
  572.    Chris Alpaugh
  573.    Mary Maclachlan
  574.  
  575.    Bunyip Information Systems, Inc.
  576.    310 St. Catherine St. West
  577.    Suite 300
  578.    Montreal, Quebec, CANADA
  579.    H2X 2A1
  580.  
  581.    Phone:  (514) 875-8611
  582.    EMail: ura-bunyip@bunyip.com
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618. Daigle, et. al.               Experimental                     [Page 11]
  619.  
  620. RFC 2016                Uniform Resource Agents             October 1996
  621.  
  622.  
  623. Appendix 1 -- Virtual URA Structure
  624.  
  625.    This appendix contains a BNF-style description of the expected
  626.    virtual structure of a URA object.  This "virtual structure" acts as
  627.    the canonical representation of the information encapsulated in a
  628.    given URA.  It is expected that more information may optionally be
  629.    contained in the elements of the components --  the elements listed
  630.    here are offered as the "minimum" or "standard" set.
  631.  
  632.    N.B.:
  633.            []-delimited items are optional
  634.            %% denotes a comment
  635.            \0 represents the empty string
  636.            |  is "or"
  637.            {} are literal characters
  638.  
  639.    This form is used for convenience and clarity of expression --
  640.    whitespace and ordering of individual elements are not considered
  641.    significant.
  642.  
  643. <VIRTUAL_URA> := {<virtual-ura-structure>}
  644.  
  645. <virtual-ura-structure> := { URAHDR <ura-header> }
  646.                            { ACTDATA <activation-data> }
  647.                            { TARG <targets> }
  648.                            { EXPINFO <experience information> }
  649.                            { ACTSPEC <activity> }
  650.                            { RESPFILT <response filter> }
  651.  
  652. <ura-header> := { name <ura-name> }
  653.                 { author <ura-author> }
  654.                 { version <ura-version> }
  655.                 [ { lang <lang-dependencies> } ]
  656.                 [ { parent <parent-of-instance> } ]
  657.  
  658.  
  659.  
  660. <activation-data> := <act-data-element><activation-data> | \0
  661.  
  662. <act-data-element> := {
  663.                        { name <data-elt-name> }
  664.                        { response <data-elt-value> }
  665.                        { prompt <data-elt-prompt> }
  666.                        [ { required <boolean> } ]
  667.                        [ { default <data-default-val> } ]
  668.                       }
  669.  
  670. <targets> := <target-service><targets> | \0
  671.  
  672.  
  673.  
  674. Daigle, et. al.               Experimental                     [Page 12]
  675.  
  676. RFC 2016                Uniform Resource Agents             October 1996
  677.  
  678.  
  679. <target-service> := {
  680.                      { name <targ-url> }
  681.                      { protocol <url-protocol> }
  682.                      { url <url-spec> }
  683.                      [ { <url-type-specific-data> } ]
  684.                     }
  685.  
  686. <url-spec> :=  <complete-url> | <url-constructor>
  687.  
  688. <complete-url> := %% a complete, valid URL string
  689.                      (e.g., http://www.bunyip.com/)
  690.  
  691. <url-constructor> := {
  692.                       { scheme <url-scheme-spec> }
  693.                       { host <url-host-spec> }
  694.                       [ { port <url-port-spec> } ]
  695.                       { selector <url-selector-spec> }
  696.                      }
  697.  
  698. <url-scheme-spec> := {
  699.                       { name <scheme-name> }
  700.                       { response <scheme-value> }
  701.                       { prompt <scheme-prompt> }
  702.                      }
  703. <url-host-spec> := {
  704.                       { name <host-name> }
  705.                       { response <host-value> }
  706.                       { prompt <host-prompt> }
  707.                    }
  708. <url-port-spec> := {
  709.                       { name <port-name> }
  710.                       { response <port-value> }
  711.                       { prompt <port-prompt> }
  712.                    }
  713. <url-selector-spec> := {
  714.                       { name <selector-name> }
  715.                       { response <selector-value> }
  716.                       { prompt <selector-prompt> }
  717.                        }
  718.  
  719.  
  720. <experience information> := {
  721.                              { name <data-elt-name> }
  722.                              { response <data-elt-value> }
  723.                             }
  724.  
  725. <activity> :=  <compound-string>
  726.  
  727.  
  728.  
  729.  
  730. Daigle, et. al.               Experimental                     [Page 13]
  731.  
  732. RFC 2016                Uniform Resource Agents             October 1996
  733.  
  734.  
  735. <response filter> := <compound-string>
  736.  
  737.  
  738. %% Without requiring more detail...
  739.  
  740. <compound-string> := <string>\n<compound-string> | \0
  741. <boolean> := 0 | 1
  742. <ura-name> := <string>
  743. <ura-author> := <string>
  744. <ura-version> := <string>
  745. <lang-dependencies> := <string>
  746. <parent-of-instance> := <string>
  747. <data-elt-name> := <string>
  748. <data-elt-value> := <string>
  749. <data-elt-prompt> := <string>
  750. <data-elt-default> := <string>
  751. <data-default-val> := <string>
  752. <targ-url> := <string>
  753. <url-protocol> := http-get | http-post | ...
  754. <url-type-specific-data> := <string>
  755. <scheme-name> := <string>
  756. <scheme-value> := <string>
  757. <scheme-prompt> := <string>
  758. <host-name> := <string>
  759. <host-value> := <string>
  760. <host-prompt> := <string>
  761. <port-name> := <string>
  762. <port-value> := <string>
  763. <port-prompt> := <string>
  764. <url-selector-name> := <string>
  765. <url-selector-value> := <string>
  766. <url-selector-prompt> := <string>
  767.  
  768. Appendix 2  -- Sample Virtual URA
  769.                Representation
  770.  
  771.    A valid virtual representation of a Silk Tcl URA is presented below.
  772.    The actual URA from which it was drawn is given in Appendix 3.
  773.  
  774. {
  775.    {URAHDR
  776.       {name {DejaNews Search}}
  777.       {author {Leslie Daigle}}
  778.       {version  {1.0}}
  779.    }
  780.  
  781.    {ACTDATA
  782.       {name        {Topic Keywords}}
  783.  
  784.  
  785.  
  786. Daigle, et. al.               Experimental                     [Page 14]
  787.  
  788. RFC 2016                Uniform Resource Agents             October 1996
  789.  
  790.  
  791.       {prompt      {Topic Keywords}}
  792.       {response    {}}
  793.    }
  794.  
  795.    {EXPINFO
  796.       {name        {Comments}}
  797.       {prompt      {Comments}}
  798.       {response    {}}
  799.    }
  800.  
  801.    {ACTSPEC
  802.        {proc mapResponsesToDejanews {} {
  803.            set resp ""
  804.            if {[uraAreResponsesSet {Topic Keywords}]} {
  805.              lappend resp [list query [uraGetSpecResponse {
  806.              Topic Keywords}]]
  807.            }
  808.  
  809.            return $resp
  810.  
  811.          }
  812.       proc uraRun {} {
  813.         global errorInfo
  814.  
  815.         foreach serv [uraListOfServices] {
  816.           set u [uraGetServiceURL $serv]
  817.  
  818.           switch -- $serv {
  819.             dejanews {
  820.               if [catch {
  821.                 set query [mapResponsesToDejanews]
  822.                 if {$query != {}} {
  823.                     set result [uraHTTPPostSearch $u $query]
  824.                     if {$result != ""} {
  825.                       set list [dejanews_uraHTTPPostCanonicalize
  826.                       $result]
  827.                       puts $list
  828.                     }
  829.                   }
  830.               }] {
  831.                 puts stderr $errorInfo
  832.               }
  833.             }
  834.  
  835.             default {
  836.               # can't handle other searches, yet.
  837.             } } } }
  838.       }
  839.  
  840.  
  841.  
  842. Daigle, et. al.               Experimental                     [Page 15]
  843.  
  844. RFC 2016                Uniform Resource Agents             October 1996
  845.  
  846.  
  847.    }
  848.  
  849.    {RESPFILT
  850.       {
  851.        proc dejanews_uraHTTPPostCanonicalize {htmlRes} {
  852.  
  853.          set result {}
  854.          set lines {}
  855.          set clause {}
  856.          set garb1 ""
  857.          set garb2 ""
  858.  
  859.  
  860.          # Get the body of the result page -- throw away leading and
  861.          # trailing URLs
  862.  
  863.          regexp {([^<PRE>]*)<PRE>(.*)</PRE>.*}
  864.                  $htmlRes garb1 garb2 mainres
  865.  
  866.          set lines [split $mainres "\n"]
  867.  
  868.          foreach clause $lines {
  869.  
  870.            if [regexp
  871.            {<DT>.*(..\/..).*<A HREF="([^"]*)">([^<]*)</A>.*<B>([^<]*).*}
  872.                 $clause garb1 dt relurl desc grp] {
  873.  
  874.              lappend r [list HEADLINE [format "%s    (%s, %s)"
  875.                         [string trim $desc] \
  876.                  [string trim  $grp] $dt]]
  877.              lappend r [list URL [format
  878.                         "http://www.dejanews.com/cgi-bin/%s" $relurl]]
  879.              lappend r [list TYPE "text/plain"]
  880.  
  881.              lappend result $r
  882.            }
  883.          }
  884.          return $result
  885.        }
  886.       }
  887.  
  888.  
  889.    }
  890.  
  891. }
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898. Daigle, et. al.               Experimental                     [Page 16]
  899.  
  900. RFC 2016                Uniform Resource Agents             October 1996
  901.  
  902.  
  903. Appendix 3  -- Sample Silk Tcl URA
  904.  
  905.    The following is a valid Silk Tcl URA.  For more information on the
  906.    implementation and structure of Silk-specific URAs, see the "URA
  907.    Writers Guide" that accompanies the distribution of the Silk software
  908.    (available from <http://www.bunyip.com/products/silk>).
  909.  
  910. # ----------------------------------------------------------------------
  911. #
  912. #                             URA initialization
  913. #
  914. # ----------------------------------------------------------------------
  915.  
  916. #
  917. # Initialize the URA, its search specs and searchable services.
  918. #
  919.  
  920. # URA init.
  921.  
  922. set uraDebug 1
  923.  
  924. uraInit {
  925.   {name {DejaNews Search}}
  926.   {author {Leslie Daigle}}
  927.   {version {1.0}}
  928.   {description "This URA will search for UseNet News articles."}
  929.   {help "This is help on UseNet News search script."}
  930. }
  931.  
  932. #
  933. # bug: handling of choices/labels is kind of gross.
  934. #
  935.  
  936. # Search spec. init.
  937.  
  938. foreach item {
  939.   {
  940.     {name        {Topic Keywords}}
  941.     {field       Topic}
  942.     {tag         STRING}
  943.     {description {Keywords to search for in news articles}}
  944.     {prompt      {Topic Keywords}}
  945.     {help        {Symbols to look up, separated by spaces.}}
  946.     {type        STRING}
  947.     {subtype     {}}
  948.     {allowed     .*}
  949.     {numvals     1}
  950.     {required    0}
  951.  
  952.  
  953.  
  954. Daigle, et. al.               Experimental                     [Page 17]
  955.  
  956. RFC 2016                Uniform Resource Agents             October 1996
  957.  
  958.  
  959.     {response    {}}
  960.     {respset     0}
  961.   }
  962. } {
  963.   uraSearchSpecInit $item
  964. }
  965.  
  966. uraAnnotationInit {
  967.   {help        {Enter comments to store with an instance}}
  968.   {numvals     1}
  969.   {subtype     {}}
  970.   {response    {}}
  971.   {name        Comments}
  972.   {required    0}
  973.   {class       ANNOTATION}
  974.   {type        TEXT}
  975.   {description {General comments about this URA.}}
  976.   {respset     1}
  977.   {prompt      Comments}
  978.   {field       {}}
  979.   {allowed     .*}
  980. }
  981.  
  982. uraResultInit {
  983.   {name {Related Pages}}
  984.   {contents { {
  985.     {HEADLINE {The DejaNews UseNet search service}}
  986.     {TYPE text/plain}
  987.     {URL http://www.dejanews.com}
  988. } }}
  989. }
  990.  
  991.  
  992. foreach item {
  993.   {
  994.     {name dejanews}
  995.     {protocol http-post}
  996.     {url http://marge.dejanews.com/cgi-bin/nph-dnquery}
  997.   }
  998. } {
  999.   uraServicesInit $item
  1000. }
  1001.  
  1002.  
  1003. proc dejanews_uraHTTPPostCanonicalize {htmlRes} {
  1004.  
  1005.   set result {}
  1006.   set lines {}
  1007.  
  1008.  
  1009.  
  1010. Daigle, et. al.               Experimental                     [Page 18]
  1011.  
  1012. RFC 2016                Uniform Resource Agents             October 1996
  1013.  
  1014.  
  1015.   set clause {}
  1016.   set garb1 ""
  1017.   set garb2 ""
  1018.  
  1019.  
  1020.   # Get the body of the result page
  1021.   # -- throw away leading and trailing URLs
  1022.   regexp {([^<PRE>]*)<PRE>(.*)</PRE>.*} $htmlRes garb1 garb2 mainres
  1023.  
  1024.   set lines [split $mainres "\n"]
  1025.  
  1026.   foreach clause $lines {
  1027.  
  1028.     uraDebugPuts stderr [format "Line: %s" $clause]
  1029.  
  1030.     if [regexp
  1031.     {<DT>.*(..\/..).*<A HREF="([^"]*)">([^<]*)</A>.*<B>([^<]*).*} \
  1032.          $clause garb1 dt relurl desc grp] {
  1033.       uraDebugPuts stderr [format
  1034.                            "Date: %s Rel URL: %s Desc: %s Group: %s"
  1035.                            $dt $relurl $desc $grp]
  1036.  
  1037.       lappend r [list HEADLINE [format "%s    (%s, %s)"
  1038.                  [string trim $desc] \
  1039.           [string trim  $grp] $dt]]
  1040.       lappend r [list URL [format
  1041.                  "http://www.dejanews.com/cgi-bin/%s" $relurl]]
  1042.       lappend r [list TYPE "text/plain"]
  1043.  
  1044.       lappend result $r
  1045.     }
  1046.   }
  1047.   return $result
  1048.  
  1049. }
  1050.  
  1051.  
  1052. # ----------------------------------------------------------------------
  1053. #
  1054. #                             Mapping procedures
  1055. #
  1056. # ----------------------------------------------------------------------
  1057.  
  1058. #
  1059. # There is one procedure, for each searchable service, to map the search
  1060. # spec responses to a form suitable for inclusion into a search URL (or
  1061. # whatever form the particular query procedure accepts).
  1062. #
  1063.  
  1064.  
  1065.  
  1066. Daigle, et. al.               Experimental                     [Page 19]
  1067.  
  1068. RFC 2016                Uniform Resource Agents             October 1996
  1069.  
  1070.  
  1071. #
  1072. #
  1073. proc mapResponsesToDejanews {} {
  1074.   set resp ""
  1075.   if {[uraAreResponsesSet {Topic Keywords}]} {
  1076.     lappend resp [list query [uraGetSpecResponse {Topic Keywords}]]
  1077.   }
  1078.  
  1079.   return $resp
  1080.  
  1081. }
  1082.  
  1083.  
  1084. #
  1085. # bug: need better error reporting
  1086. # (i.e. which searches didn't work and why, etc.)
  1087. #
  1088. proc uraRun {} {
  1089.   global errorInfo
  1090.  
  1091.   foreach serv [uraListOfServices] {
  1092.     set u [uraGetServiceURL $serv]
  1093.  
  1094.     switch -- $serv {
  1095.       dejanews {
  1096.         if [catch {
  1097.           set query [mapResponsesToDejanews]
  1098.           uraDebugPuts stderr [format "%s: query is `%s'."
  1099.           $serv $query]
  1100.           if {$query != {}} {
  1101.               set result [uraHTTPPostSearch $u $query]
  1102.               if {$result != ""} {
  1103.                 uraDebugPuts stderr [format "%s: result is `%s'."
  1104.                 $serv $result]
  1105.                 set list [dejanews_uraHTTPPostCanonicalize $result]
  1106.                 uraDebugPuts stderr [format "%s: list is `%s'."
  1107.                 $serv $list]
  1108.                 puts $list
  1109.               }
  1110.             }
  1111.         }] {
  1112.           puts stderr $errorInfo
  1113.         }
  1114.       }
  1115.  
  1116.       default {
  1117.         # can't handle other searches, yet.
  1118.       }
  1119.  
  1120.  
  1121.  
  1122. Daigle, et. al.               Experimental                     [Page 20]
  1123.  
  1124. RFC 2016                Uniform Resource Agents             October 1996
  1125.  
  1126.  
  1127.     }
  1128.   }
  1129. }
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178. Daigle, et. al.               Experimental                     [Page 21]
  1179.  
  1180.