Backend Call Frame Format

From Olympus
Jump to: navigation, search

Through the CALL directive in Execute Agents, the task designer can make the DM send queries to backend modules and store the results in a concept. In practice, RavenClaw sends the query as a Galaxy frame through the hub to a server that can be either the backend itself or a stub that forwards the information to a non-Galaxy process (e.g. in the case of Perl backends, which don't have Galaxy hooks). Backends are obviously dependent on the application so it is likely that you will have to implement your own backend module. The goal of this page is to describe the format of the Galaxy frame used to exchange the information so your can understand what the DM sends to the backend and know how to respond and be understood by RavenClaw.

At the highest level, the Galaxy frame that the DM sends has only two slots called :inframe and :outframe. You can probably guess what each of these is used for ;) They are both GAL_STRING objects that contain a string describing the concept values. Both have the same syntax, which can be formally described as:

 frame ::= { <element list> }
 element ::= <slot> <value>
 slot ::= <string with no space>
 value ::= <string> | <frame> | :<number n> { <value list of length n> }

The :inframe string itself is a frame, whose elements are the "<" concepts listed in the CALL directive's call description string. The :outframe string is also a frame which contains a single element whose value will be stored in the call description string's ">" concept.

Following is an example of :inframe string (from the LetsGoPublic system) which contains a single frame concept called "query" whose elements are "type" (an integer concept) and "place". The latter is itself a struct concept (here, frame and struct concepts are strictly equivalent, which is not the case within RavenClaw, see Concepts in RavenClaw) with two string elements: "name" and "type". The :inframe is:

 {c
   query {c
     type    100
     place   {c
       name    FORBES AND CRAIG
       type    stop
     }
   }
 }

The corresponding result concept (arbitrarily called new_result, since the name of the single return concept is never used) is a frame containing a single element "stops". The latter is an array of 6 elements (in this example), each element being a frame with two atomic elements "name" and "id". Here is how the :outframe looks like:

 {c
   new_result {c
     stops   :6
     {
       {
         name    FORBES AVENUE OPPOSITE CRAIG
         id      4357
       }
       {
         id      4301
         name    FORBES AVENUE AT CRAIG
       }
       {
         id      4356
         name    FORBES AVENUE OPPOSITE CRAIG
       }
       {
         name    CRAIG STREET AT FORBES
         id      3358
       }
       {
         name    FORBES AVENUE AT CRAIG  B
         id      4303
       }
       {
         name    FORBES AVENUE AT CRAIG
         id      4302
       }
     }
   }
 }

See also: Concepts in RavenClaw, CALL

Personal tools