Appendix:

OHP - Open Hypermedia Protocol

Working Draft 1.5 20th June 1997

Authors

Hugh Davis, Andy Lewis, Sigi Reich, Antoine Rizk

Previous Versions

Status of this Document

This document specifies the draft for the Open Hypermedia Systems' Protocol (OHP). Distribution of this document is unlimited. Comments are welcome at Hugh Davis. For discussions about the protocol as well as Open Hypermedia Systems in general see also the OHS Mailing List and the OHS Working Group Home Page.

Abstract

This section should give a management summary and overview. What is the motivation behind OHP? What would be the benefits if OHP would be supported by tools? (viewer independent of linkservice, link editing possible, ...) Should we mention why http is insufficient (because Web users might be interested)?

Protocol Definition

This section specifies the actual form and the minimum set of messages defined in OHP. We describe the message header and the messages to be sent; we evolve on specific issues such as location specifications, presentation specifications, and expected functionality and behaviour of components. We finish with example scenarios and a list of references.

Overview

Introduction

The Open Hypermedia Protocol (OHP) is to be used as standardised protocol between viewers and link services. These agents of OHP transactions can be of various forms: a Viewer can be a dedicated viewer for a specific LinkService; or it can be an adapted version of an existing generic application such as Microsoft Word. The LinkService can be a 'simple' LinkService providing only links as well as a hyperbase providing both, links and documents. For the remainder of this document we will only use the terms Viewer and LinkService for these components.

For the definition of the protocol we additionally make some assumptions on the architecture. Note however, that we are not aiming and not claiming for fully defining a reference architecture. The general picture we have in mind when defining OHP is as follows:


Fig.: Components and Layers in OHP Definition

In defining OHP we abstracted in different layers. On the top-level a so-called Viewer talks OHP to another component which is only interesting from an OHP point of view in that this components understands and answers OHP requests. Typically though this component would be a LinkServer or a HyperBase. For the remainder of this document we will refer to it by LinkService.

OHP abstracts from the communication layer. However, there has to be a component that establishes connections, 'knows' how to talk to other services and viewers, and the more. We call this component a SessionManager and it could be described as an intermediate component between LinkService and Viewer. For the definition of OHP we assume that both Viewer and LinkService exchange OHP messages via the SessionManager, the actual communication though is not part of OHP.

Besides the components Viewer, LinkService and SessionManager there is a fourth component, the Document Management System (DMS). We are convinced that an additional protocol - a document management procotocol (DMP) - should allow standardised communication to document management systems. The Open Document Management API [ODMA97] could serve as a good example and some of the concepts in OHP, e.g., the definition of a NodeId as a unique document identifier, follow this proposal.

Form of the Protocol

General Form

OHP is a peer to peer asynchronous protocol. Messages may be sent by either the LinkService or by the Viewer. If a reply is expected, it is up to the receiving component to initiate a new message. There are thus two classes of messages to be considered; those sent by the Viewer and those sent by the LinkService.

Notational Conventions and Generic Grammar

For actually defining the mechanics of OHP we will follow a Backus-Naur Form (BNF) as is for instance done in Internet drafts. We use constructs such as OHP messages will consist of text strings (CHAR). In the following sections the messages are shown formatted on multiple lines for ease of presentation. However, the messages themselves will be one continuous stream of ASCII text, unbroken by line feeds (LF). The messages consist of Tags, which are proceeded by a backslash ('\') and succeeded by a white space (SP). The characters that follow, up to the next tag or the end of the message are the tag contents. A tag content may be empty if shown as optional in the message definition. The tags of each message are all compulsory, and must be presented in the order in the message definition. If a backslash ('\') occurs within the tag content, then it should be quoted by preceding it with a further backslash.

We can now begin to define the protocol.

Definitions

Message Header

As opposed to previous versions of this draft, which define a Channel as an identifier for messages, we have defined a dedicated message header. As already mentioned above, OHP abstracts from the communication layer so the header does not include any host or port or other communication specific information.

The OHP message header is defined as

MessHeader = \MessId the OHP Id and version number
             \Subject name of this message
             \SessionId a byte string
?? do we have a unique id or not?? not yet sure about that

MessId uniquely identifies this type of message and gives OHP version information. The subject field is considered to be particularely helpful in cases of the components cannot understand a message and could then at least provide additional information about the message.

Besides basic header information there is a number of fields that will be present in almost all messages but that does not have to be understood by the LinkService. These fields comprise

\UserId a byte string that can be used for identifying a user

As mentioned above, the actual managing of documents is a crucial issue. Within OHP documents are therfore not dealt with directly but rather by a reference called NodeId. A NodeId has to be unique within a given usage scenario. However, from a protocol perspective the NodeId is opaque.

Responsibilities of Session Manager

  1. Establishing of connections to the LinkServices the user wants to connect; transfering of OHP messages;
  2. If asked to by LaunchDocument, the SessionManager must be able to go and get the document for a given nodeid.
  3. There is an assumption that there will be of DMP which allows the SessionManager to ask for document attributes such as NickName, Type, Preferred Viewer etc. In the absence of a DMS the SessionManager will need to provide these. Otherwise it must be possible to do a "GetDocumentAttributes" Call which is part of DMP. We might need to define this bit of DMP now (so that we can ask the linkservice for the attributes where appropriate)

Overview of Messages

The following table gives an overview of the messages that are dependent in that a Viewer's request results in a LinkService's answer.

Viewer Requests LinkService Replies
GetServices Services
GetNodeId NodeId
CreateNode NodeId
GetAnchorTable AnchorTable

Tab.: Message Requests by Viewer and Answers by LinkService

Additionally, the Viewer might send the following messages:

The LinkService might send the following messages to the Viewer

All, Viewer, LinkService as well as other components speaking OHP can send an error message.

We will now present the messages in detail and also give examples or additional comments where necessary to understand the semantics of the protocol. >

Message "GetServices

The "GetServices" message is to be sent from Viewer to LinkService in order to know which services are available. The LinkService has to answer this request by a "Services" message. Services are defined by a description and a service name.

Note the naming of message ids in OHP: MV is short for "message from viewer", the second token gives the name of the message and the last two tokens define OHP as a message and give version information. Equally, service originated messages start with MS short for "message from service".

\MessId MV_GetServices_OHP_1.0
\Subject "GetServices"
\SessionId
\UserId

The linkservice will reply with

\MessId MS_Services_OHP_1.0
\Subject "Services"
\SessId??
\Data
     {\Service the name of the service
     \Description a description of the service in the local language}+
\UserId

We have identified a number of default services that each LinkService supporting OHP has to provide. All OHP compliant applications must provide at least the following services in the above list

Any of these services may be requested by

\MessId MS_RequestService_OHP_1.0
\Subject "RequestService"
\Service the name of the service
\AnchorID []
\LocSpec []
\Presentation
\SessionId 
\UserId

An OHP application must also provide an interface to allow anchors to be updated e.g. after document editing.

We do

\MessId MV_GetNodeId_OHP_1.0
\Subject "GetNodeId"
\DocumentName the name of the document
\SessionId ??
\UserId

The LinkServer will answer this request with

\MessId MS_NodeId_OHP_1.0
\Subject "NodeId"
\SessionId
\NodeId NodeId
\UserId

If the NodeId is "Null", then the document is currently unknown to the LinkService, and it is the responsibility of the SessionManager to register this node (are there cases where it could raise an error?). The SessionManager would thus send

\MessId MV_CreateNode_OHP_1.0
\Subject "CreateNode"
\SessionId
\DocumentName the name of the document
\UserId

The linkserver will eventually send back a NodeId message (see above). As a follow up, the SessionManager should then send a SetDocumentAttributes (DMP) message.

\MessId MV_SetDocumentAttributes_OHP_1.0
\Subject "SetDocumentAttributes"
\SessionId ??
\NodeId <NodeId>
\Attributes
    {\name the attribute's name
     \value the value}+
\UserId

The LinkService might send this message (e.g. as the result of a follow link from another application)

\MessId MS_LaunchDocument_OHP_1.0
\Subject "LaunchDocument"
\SessionId ??
\NodeId <NodeId>
\DMS "SessionManager" | "LinkService"| DMS handle ???
\ReadOnly "True" | "False"
\UserId

I think NodeId should be interpreted by the sessionmanager. We should not have to deal with the DMS stuff here. LaunchDocument will not have DatacallBack. Instead it will have a DMS field which will have the value "SessionManager", "LinkService" or the name of the DMS which can interpret the DocId.

The Viewer might now get the document and - in case in can not deal with the type of document on its own - launch the appropriate Viewer. This will be initiated by advising the SessionManager to to this task. Definition, ... is thus not part of OHP.

It may use a document management protocol (DMP) to get the document, or it may do it itself, or ask the LinkService. The SessionManager may also use DMP to obtain any document attributes, such as nickname, document type and preferred Viewer. If it doesn't do this, then it will be necessary for the SessionManager to supply these values.

Altrenatively, we may have loaded a document and wish to start Link services.

\MessId MV_UpdateAnchors_OHP_1.0
\Subject "UpdateAnchors"
\SessionId ??
\NodeId <NodeId>
\Data {\AnchorID <AnchorId> \LocSpec <LocSpec>
       \Presentation <Presentation> \Service ???}+
\UserId

Whereas the interface to link creation (joining n to m anchors and defining direction, scope etc) would probably be best implemented just once in the Session Manager.

We will need a Create Link message.

\MessId MV_CreateLink_OHP_1.0
\Subject "CreateLink"
\SessionId ??
\AAnchors {\AnchorID <AnchorID>}+
\BAnchors {\AnchorID <AnchorID>}+
\Direction "AtoB" or "Bidirectional"
\Description <text string>
\UserId

(Delete link is omitted as it can be done at the LinkService. It is not clear that there is a simple interface to this function which could be provided at the client end)

Now that we have the document itself and an appropriate application for the document, the application needs to know

  1. What services it may offer
  2. What anchors to display in the current document

The following message is sent to get the anchors for a given document. Note that the message is assynchronous, and that it should result in one or more AnchorTable messages. (e.g. if a distributed LinkService came up with separate answers. The application should be capable of concatting the tables).

\MessId MV_GetAnchorTable_OHP_1.0
\Subject "GetAnchorTable"
\SessionId ??
\NodeId <NodeId>
\SessionId 
\UserId

The LinkService should answer this with the "AnchorTable" message.

\MessId MS_AnchorTable_OHP_1.0
\Subject "AnchorTable"
\SessionId ??
\NodeId <NodeId>
\Data {\AnchorID <AnchorId> \LocSpec 
       \Direction \Presentation \Service}+ 
\UserId
The LinkService might also independently inform the Viewer about new anchors. It can this by sending "NewAnchor" messages.

\MessId MS_NewAnchor_OHP_1.0
\Subject "NewAnchor"
\SessionId ??
\Data {\AnchorID \LocSpec \Direction 
       \Presentation \Service} 
\UserId

The LinkService might also request from the Viewer to display an anchor. For this purpose the "DisplayAnchor" message is used (this is a French thing, isn't it ??????)

\MessId MS_DisplayAnchor_OHP_1.0
\Subject "DisplayAnchor"
\SessionId ??
\Subject DisplayAnchor 
\AnchorID \Presentation
\UserId

Equally, location specifications might wanted to be displayed by the server.

\MessId MS_DisplayLocSpec_OHP_1.0
\Subject "DisplayLocSpec"
\SessionId ??
\LocSpec \Presentation
\UserId

Again a French thing: interpret script

\MessId MS_Interpret_OHP_1.0
\Subject "Interpret"
\SessionId ??
\ScriptType \Data

If the contents of a document have changed during a session (or if it is a new document) it may be necessary to store the contents in the DMS (or Hyperbase). We will need a StoreDocument thing in the DMP for this.

This message is sent when a node is closed by the user.

\MessId MV_ClosingNode_OHP_1.0
\Subject "ClosingNode"
\SessionId ??
\NodeId <NodeId>
\UserId

This message is sent by the LinkService to a node that it wishes to automatically close. ??? Should'nt that be answered by a 'successful' or 'don't want to' or a simple 'cannot'.

\MessId MV_CloseNode_OHP_1.0
\Subject "CloseNode"
\SessionId ??
\NodeId <NodeId>
\UpdateNode "True" / "False"
\UserId

The application is then responsible for closing itself, ensuring that it has updated any anchors and its contents if required by the UpdateNode tag.

(Messages that may be sent either way. )

\MessId M_Error_OHP_1.0
\Subject "Error"
\SessionId ??
\MessageId Id of message that caused the error
\ErrorSubject \ErrorMessage
\UserId

(Note that the protocol is completely extensible in that other messages may be invented, and other tags inserted, and other values given to a tag. Of course there is no guarantee that they will be understood at the other end!)

Location Specifications

Pete argues that LocSpecs should be opaque byteblocks. Indeed, as far as OHP itself is concerned they could be.

On the other hand, if every applications makes its own LocSpec, applications will never be interchangeable.

We believe that a combination of both appraoches is necessary.

If we take the simplest data type, e.g. ASCII text, we have all developed similar fairly rich methods of loacting strings. The LocSpec should include standards for these methods. Later, we might extend standards for such things as pictures, formatted text, videos etc. But opaque types will always be OK.

The LocSpec standard, like DMP, is separate from OHP, but in order to be useful, we are defining some of it now.

We will use the Sigi approach but add optional extra tags at all levels.

We describe why Pete and Randy are both right. We motivate for the usage of HyTime [ISO92]. We introduce locspecs in general. we give a definition with a detailed description and examples.

LocSpecs in OHP are defined as follows:

LocSpec =
\ContentLength an Integer given the total length of this LocSpec in bytes \ContentType type, e.g., ASCII, binary
\Content Mime encoded text string
\LocData Loc

where "Loc" is defined as

Loc = NameLoc | DataLoc | TreeLoc | PathLoc | ScriptLoc | NALoc

In the sequel we will explain these different basic types of location specifications. Again, it is up to the developer to introduce his own additional location specification or to add additional tags where necessry for specific applications. For most cases, though, the proposed set of location specifications should be sufficient.

Name space locations are used to reference an object by its name. Names are expressed in OHP by NodeIds so the defintion of NameLoc is as follows:

NameLoc =
\LocType "NameLoc"
\NodeId <NodeId>

So-called data locations are coordinate locations, i.e., objects are addressed by their relative position to another object. DataLocs will be heavily used by OHP as most systems define anchors by relative positioning, for instance by keeping an offset. In order to know how this dimension specification should be interpreted, i.e. to get its data type, a quantum tag is defined. A reverse counter is kept in order to do cross checking of validity of anchors. In case the expected object still cannot be found an overrun behaviour can be specified: the error can simply be ignored, the markers be truncated to the last unit on the axis or an error can be raised.

DataLoc =
\LocType "DataLoc"
\NodeId <NodeId>
\Quantum "string" | "int" | "byte" | "utc"
\CountList list of Strings being interpreted by the viewer
\RevCountList list of Strings being interpreted by the viewer
\Overrun "ignore" | "error" | "trunc" overrun attribute, e.g. trunc, ignore, error

Tree locations can be used for addressing a single object within a tree. The addressing is done in a way that on each level of the tree an obejct is selected by its position. These position numbers are expressed in CountList.

\TreeLoc
\LocType "TreeLoc"
\NodeId <NodeId>
\Overrun "ignore" | "error" | "trunc"
\CountList list of numbers
can be used for addressing a single node of a tree in the standard manner by selecting a node on each level by its position geiven by an integer. Example with a book assuming that a book has a structure with chapters and sections "1 2 3" would get the third section of the second chapter of a book.

\PathLoc
\LocType "TreeLoc"
\Overrun "ignore" | "error" | "trunc"
\NodeId

ScriptLoc =
\LocType "ScriptLoc"
\Script viewer executable script

NALoc := \LocType "NALoc"
\Loc string as description of the object and its physical location

Additional specifications: count list follows the HyTime semantics of defining a dimenstion list. In particular, two markers define beginning and end on an axis thus resulting in number of axes * two markers. Example:

overrun behaviour specifies what to do in case of an overrun, i.e., in case the expected item cannot be found at the given position. This fact could be simply ignored, an error raised or the count list be truncated in that its items point to the last position. utc expects CountList items in the form yyyy-mm-dd hh:mm:ss.decimal format, e.g., 1997-06-06 17:59:22.6122.

Presentation Specification

\Presentation [\Colour colour][\style style][\visibility 
true/false]

Again we have to do some of this. I originally suggested triplet of Colour, style, visibility.

The above allows us to only put these things if we have them, and we could also add other tags if needed. We will define some tag values which will be understood.

How about RED, BLUE, GREEN, (the eight primary computer colours)

Flashing, bold, italic, outlined, shaded,

Example Scenarios

In this section we consider, by reference to some different types of hypermedia viewers, the way these applications might use the OHP protocol. In order to allow readers to 'play' with OHP and to better visualize the communiction process we have developed a small Java applet that should help in understanding OHP.

Related Work

The World-Wide Web Consortium proposes Protocol Extension Protocol (PEP).

HTTP is used increasingly in applications that need more facilities than the standard version of the protocol provides, from distributed authoring, collaboration and printing, to various remote procedure call mechanisms.

The Protocol Extension Protocol (PEP) is an extension mechanism designed to address the tension between private agreement and public specification and to accommodate extension of HTTP clients and servers by software components. The PEP mechanism is to associate each extension with a URI, and use a few new header fields to carry the extension identifier and related information from HTTP clients, through proxies and intermediaries, to servers, and back again. The kind of extensions capable of being introduced by PEP are envisioned as ranging from:

a simple qualification of a normal HTTP transaction; changes to HTTP semantics; new HTTP syntax, encoding or marshaling; initiation of HTTP-based protocols for new applications; to... protocols, which once initiated by a PEP transaction, run completely independently of HTTP.

PEP interacts with specific features of HTTP/1.1 [RFC2068] including scoping rules and cache semantics. PEP is intended to be compatible with HTTP/1.0 [RFC1945] inasmuch as HTTP/1.1 is compatible with HTTP/1.0, see [RFC2068], Section 19.7. It is proposed that the PEP extension mechanism is included in future versions of HTTP.

Acknowledgements

The OHS community, all that have contributed in any form.

References

Kenneth M. Anderson: A Critique of the Open Hypermedia Protocol. 3rd Workshop on Open Hypermedia Systems, Southampton, April 1997. Available as http://www.daimi.aau.dk/~kock/OHS-HT97/Papers/anderson.html.

Davis, H., Lewis, A., Rizk, A.: OHP: A Draft Proposal for a Standard Open Hypermedia Protocol (Levels 0 and 1: Revision 1.2 - 13th March. 1996). 2nd Workshop on Open Hypermedia Systems, Washington, March 1996. Available as http://www.ecs.soton.ac.uk/~hcd/protweb.htm.

ISO - International Organization for Standardization: Information Technology - Hypermedia/Time-based Structuring Language (HyTime), ISO/IEC 10744, 1992.

Open Document Management API (ODMA): Open Document Management API Version 1.5. Available as http://www.aiim.org/odma/odma15.htm.

PEP - an Extension Mechanism for HTTP: W3C Working Draft 28 April 1997. Edited by Henrik Frystyk Nielsen. Available as http://www.w3.org/TR/WD-http-pep-970428.

Reich, S.: How OHP's LocSpecs could benefit from ISO/IEC 10744. 3rd Workshop on Open Hypermedia Systems, Southampton, April 1997. Available as http://www.daimi.aau.dk/~kock/OHS-HT97/Papers/reich.ps.