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) ContextObject Format, defined in Part 2 of Z39.88-2004, writes a ContextObject as a string of key=value pairs joined by &. Its Registry identifier is info:ofi/fmt:kev:mtx:ctx. It is the format of almost every OpenURL in production and the format required by the SAP1 profile.
Key patterns
ctx_ver,ctx_enc,ctx_id,ctx_tim: administrative data about the ContextObject.<ent>_id: an Identifier Descriptor (a URI). May repeat.<ent>_val_fmt: the Metadata Format used for By-Value Metadata.<ent>.<key>: a By-Value Metadata field, named by that Metadata Format. Requires<ent>_val_fmt.<ent>_ref_fmtand<ent>_ref: By-Reference Metadata (format and location); each requires the other.<ent>_dat: Private Data.
Keys must start with a letter or digit; the remaining characters may be letters, digits, _ or .. Pair order carries no meaning.
Entity prefixes
| Prefix | Entity | Number allowed in KEV |
|---|---|---|
rft | Referent | exactly 1 |
rfe | ReferringEntity | 0 or 1 |
req | Requester | 0 or 1 |
svc | ServiceType | 0 or 1 |
res | Resolver | 0 or 1 |
rfr | Referrer | 0 or 1 |
A KEV representation holds exactly one ContextObject. Within an Entity, identifiers may repeat, but there is at most one By-Value Metadata block, one By-Reference Metadata block and one Private Data descriptor.
The version key
ctx_ver=Z39.88-2004 declares the ContextObject version. The KEV ContextObject matrix marks it optional, but sources almost always include it and many resolvers rely on it (or on the transport key url_ver) to tell a 1.0 request from a 0.1 request.
KEV Metadata Formats
The format of each Entity's By-Value Metadata is named by an identifier of the form info:ofi/fmt:kev:mtx:<name>. Those registered with the standard and used for scholarly linking (SAP1) are:
info:ofi/fmt:kev:mtx:journal: articles, journals, issues, preprints and conference papers in serials (reference)info:ofi/fmt:kev:mtx:book: books, chapters, proceedings, reports (reference)info:ofi/fmt:kev:mtx:dissertation: theses and dissertations (reference)info:ofi/fmt:kev:mtx:patent: patents (reference)info:ofi/fmt:kev:mtx:sch_svc: scholarly ServiceTypes such as full text or ILL (reference)
The Registry also holds info:ofi/fmt:kev:mtx:dc (unqualified Dublin Core, used by tools such as VuFind and Blacklight; see Dublin Core (KEV)), the Canonical Citation format, a JPEG 2000 service format, and draft formats for maps, scores, sound recordings, visual materials and computer resources. See The OpenURL Registry.
A complete example
ctx_ver=Z39.88-2004
&ctx_enc=info:ofi/enc:UTF-8
&rft_val_fmt=info:ofi/fmt:kev:mtx:journal
&rft.genre=article
&rft.atitle=Zur+Elektrodynamik+bewegter+K%C3%B6rper
&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
&rft_id=info:doi/10.1002/andp.19053221004
&rfr_id=info:sid/example.com:database
Shown unencoded for readability except for the non-ASCII ö, which is written as its two UTF-8 bytes %C3%B6. "Zur Elektrodynamik bewegter Körper" is the original German title of the 1905 special-relativity paper; volume 17 of the original numbering is now cited as volume 322.
Encoding
All values must be URL-encoded. The default character encoding is UTF-8; ctx_enc can declare another registered encoding such as ISO-8859-1, which matters mainly for HTML-form submissions. Spaces may be + or %20. Repeatable fields are repeated, never concatenated. Appendix E of the standard gives the exact encoding procedure; see Anatomy of an OpenURL.
Why KEV dominates
KEV fits in a URL without an extra fetch, it is easy to produce in any environment that can build an HTTP request, and it is a direct descendant of the OpenURL 0.1 syntax that databases had already implemented. SAP1, the scholarly profile, is built on it. See Community Profiles.