I · 05

The ContextObject

The ContextObject is the abstract container carried by every OpenURL: a Referent plus the context in which it is being requested.

The ContextObject is the central abstraction of the OpenURL Framework. It is the in-memory object the standard talks about; KEV and XML are two ways of writing it down. A ContextObject names what is being requested (the Referent) together with as much of the surrounding context (who is requesting, from where, of what service) as the source chooses to include.

Definition

A ContextObject is defined by Z39.88-2004 as an aggregation of entities, each entity being a description of one of the roles in the request. A ContextObject also carries administrative attributes — a version, optional identifier, optional timestamp, and a character-encoding declaration.

The same ContextObject may be expressed in either of the two serialization formats — KEV or XML — without loss of information. The framework defines a one-to-one mapping between the abstract entities and their serialized representations.

The six entities

A ContextObject may contain six kinds of entity. One — the Referent — is required; the other five are optional. The cardinality and KEV abbreviation of each is:

EntityAbbrev.CardinalityRole
Referentrftexactly 1The resource being referenced
ReferringEntityrfe0 or 1The resource containing the reference
Requesterreq0 or 1The party making the request
ServiceTypesvc0 or moreThe kind of service requested
Resolverres0 or moreThe target resolver
Referrerrfr0 or 1The system that generated the ContextObject

Each entity is treated in detail on its own page; see Entities Overview.

How an entity is described

Each entity may be described in any combination of three ways:

  • By value. Descriptive metadata is included inline. For the Referent in KEV form, this takes the form rft.<descriptor>=<value>, with the descriptor names defined by the format named in rft_val_fmt.
  • By identifier. A URI identifier is supplied through <entity>_id, for example rft_id=info:doi/10.0000/example.
  • By reference. A pointer to externally-stored metadata is supplied through <entity>_ref_fmt (the format of the referenced metadata) and <entity>_ref (the URL where it can be retrieved).

Multiple methods may be combined: a Referent can carry both a DOI and a full set of descriptive metadata.

Administrative attributes

A ContextObject also carries administrative information about itself:

ctx_ver
Version of the framework. The only registered value is Z39.88-2004.
ctx_id
Optional identifier for the ContextObject itself.
ctx_tim
Optional timestamp in W3CDTF format.
ctx_enc
Character encoding. The registered value info:ofi/enc:UTF-8 indicates UTF-8.

Abstract vs. concrete

It is worth keeping the abstract ContextObject distinct from its serialized form. When a resolver speaks of "the ContextObject" it usually means the parsed object — the Referent and any other entities it contains — not the URL-encoded query string it arrived in. Both KEV and XML are equally valid ways to write a ContextObject down; the choice between them is a matter of transport and convenience.

Sources