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 information package the standard talks about; KEV and XML are two ways of writing it down, and the OpenURL transports are ways of delivering it. A ContextObject names what is being referenced (the Referent) together with as much of the surrounding context (where the reference was made, who is asking, for what service) as the source chooses to include.
The six Entities
A ContextObject contains exactly one Referent and may contain the five other Entities. The numbers allowed differ slightly between the two ContextObject Formats:
| Entity | KEV prefix | KEV format | XML format | Role |
|---|---|---|---|---|
| Referent | rft | exactly 1 | exactly 1 | The resource being referenced |
| ReferringEntity | rfe | 0 or 1 | 0 or 1 | The resource that contains the reference |
| Requester | req | 0 or 1 | 0 or 1 | The person or agent requesting services |
| ServiceType | svc | 0 or 1 | 0 or more | The kind of service requested |
| Resolver | res | 0 or 1 | 0 or more | The target of the request |
| Referrer | rfr | 0 or 1 | 0 or 1 | The system that generated the ContextObject |
Each Entity has its own page; start at Entities Overview.
Four kinds of Descriptor
An Entity is described by one or more Descriptors:
- Identifier —
rft_id - A URI such as
info:doi/10.1103/PhysRev.47.777. In KEV, several identifiers may describe the same Entity. - By-Value Metadata —
rft_val_fmt+rft.* - Metadata carried inline, using the keys of the Metadata Format named in
rft_val_fmt. At most one per Entity in KEV. - By-Reference Metadata —
rft_ref_fmt+rft_ref - A pointer to metadata stored elsewhere: its format and its network location. Both keys must be present.
- Private Data —
rft_dat - Source-specific data whose meaning depends on a prior agreement with the resolver. The KEV guidelines discourage it because it reduces interoperability.
The same pattern applies to every Entity prefix: rfe_id, req_ref, svc_val_fmt, and so on.
Administrative data
- ctx_ver
- Version. The only value is
Z39.88-2004(capital Z). - ctx_enc
- Character encoding. The Registry lists
info:ofi/enc:UTF-8(the default) andinfo:ofi/enc:ISO-8859-1, among others. - ctx_id
- Optional identifier for the ContextObject.
- ctx_tim
- Optional creation time,
YYYY-MM-DDorYYYY-MM-DDThh:mm:ssTZD.
In the XML format the same information is carried as the version, identifier and timestamp attributes of <ctx:context-object>.
Abstract vs. serialized
Keep the abstract ContextObject distinct from its representation. When a resolver speaks of "the ContextObject" it usually means the parsed object, not the URL-encoded string it arrived in. Note also that the url_ keys (url_ver, url_ctx_fmt…) belong to the transport, not to the ContextObject.