I · 07

The KEV Format

Key/Encoded-Value is the URL-friendly serialization of a ContextObject — entity-prefixed key/value pairs, percent-encoded, the dominant form in production.

The Key/Encoded-Value (KEV) format is the serialization of a ContextObject that fits comfortably into the query string of an HTTP URL. It is one of two formats defined by Z39.88-2004 (the other being XML) and is, in practice, what almost every OpenURL emitted today actually looks like. KEV is the form expected by every commercial link resolver in production.

Structure

A KEV serialization is a sequence of key/value pairs in the form key=value, joined by &. Keys take one of these forms:

  • ctx_* — administrative attributes of the ContextObject itself.
  • <ent>_val_fmt — declares the format used to describe entity <ent>.
  • <ent>_ref_fmt and <ent>_ref — the format and URL of by-reference metadata.
  • <ent>_id — an identifier for the entity (a URI).
  • <ent>.<descriptor> — a specific descriptive field, with name defined by the format.
  • <ent>_dat — opaque administrative data for the entity.

Entity prefixes

PrefixEntity
rftReferent
rfeReferringEntity
reqRequester
svcServiceType
resResolver
rfrReferrer

The version parameter

Every KEV ContextObject must include ctx_ver=Z39.88-2004. This is the marker that distinguishes a 1.0 request from a 0.1 request. Resolvers use its presence to decide which parser to dispatch.

Format identifiers

The format used to describe an entity is named by a URI of the form info:ofi/fmt:kev:mtx:<type>. The four registered KEV metadata formats are:

The format determines which descriptor keys are legal under <ent>. and what their values mean.

A complete example

ctx_ver=Z39.88-2004
&rft_val_fmt=info:ofi/fmt:kev:mtx:journal
&rft.genre=article
&rft.atitle=On+the+Electrodynamics+of+Moving+Bodies
&rft.jtitle=Annalen+der+Physik
&rft.aulast=Einstein
&rft.aufirst=A.
&rft.date=1905
&rft.volume=322
&rft.issue=10
&rft.spage=891
&rft.epage=921
&rfr_id=info:sid/example.com:database

Encoding

Values are percent-encoded according to RFC 3986. Space may be encoded as + or %20. UTF-8 is the default character encoding (declared, if explicitly, by ctx_enc=info:ofi/enc:UTF-8). Multi-valued descriptors — for example several authors — are repeated, not concatenated.

Why KEV dominates

KEV won out over XML in practice for three reasons: it fits in a URL without an intermediate fetch, it is trivial to construct in any environment that can format an HTTP request, and the San Antonio Profile, Level 1 (SAP1) — the profile most resolvers conform to — specifies KEV as its only serialization. See Community Profiles.

Sources