VIII · 49
How to Read a ContextObject String
Catalogues, reference sites and citation tools often show strings like “Context object: ctx_ver=Z39.88-2004&rft_val_fmt=…”. They are machine-readable citations. Here is how to read one.
A string that starts with ctx_ver=Z39.88-2004 (or contains rft_val_fmt=, rft.btitle=, rft.atitle=) is an OpenURL ContextObject in KEV form: a citation written as URL parameters. Library systems show it in "staff view" or export screens, put it in COinS spans for Zotero, and send it to link resolvers. The quickest way to read one is to paste it into the OpenURL parser, which accepts the bare string, a full URL, or text that starts with "Context object:".
Step by step
- Split on
&. Each piece is onekey=valuepair. - URL-decode each value.
+and%20are spaces;%3Ais:,%2Fis/,%2Cis a comma,%26is&; multi-byte sequences such as%C3%A9are UTF-8 characters (é). - Read the format.
rft_val_fmttells you which vocabulary therft.keys use:…mtx:book,…mtx:journal,…mtx:dissertation,…mtx:patent, or…mtx:dc(Dublin Core). - Read the item. Keys starting
rft.describe the cited item: titles, authors, dates, numbers. - Note the source.
rfr_id=info:sid/…names the system that produced the string.
Worked example
A typical string from a library catalogue:
ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fexample.org%3Acatalogue&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Les+jardins+%3A+de+la+Gr%C3%A8ce+antique+%C3%A0+l%27%C3%A9poque+moderne&rft.date=2016&rft.language=fran%C3%A7ais
Decoded:
| Key | Decoded value | Meaning |
|---|---|---|
ctx_ver | Z39.88-2004 | OpenURL 1.0 ContextObject |
ctx_enc | info:ofi/enc:UTF-8 | Values are UTF-8 |
rfr_id | info:sid/example.org:catalogue | Produced by a catalogue at example.org |
rft_val_fmt | info:ofi/fmt:kev:mtx:book | The item is described with the Book format |
rft.genre | book | A whole book |
rft.btitle | Les jardins : de la Grèce antique à l'époque moderne | Book title |
rft.date | 2016 | Publication year |
rft.language | français | Not a key of the Book format: a local extra that resolvers may ignore |
Things you will meet in real strings
- Empty values (
rft.au=,rft.isbn=) - The source had no data for that field. Harmless, but they add length.
- Keys that are not in the format (
rft.language,rft.externalDocID,rft.source) - Vendor or local additions. A resolver may ignore them.
- Dublin Core strings (
rft_val_fmt=info:ofi/fmt:kev:mtx:dc) - Keys such as
rft.title,rft.creator,rft.typeandrft.datecome from the Dublin Core format, used by VuFind and Blacklight for records that do not fit the book or journal formats. See Dublin Core (KEV). - Doubled encoding (
%253A) - The value was encoded twice, either deliberately (By-Value transport) or by mistake. Decode twice.
- 0.1-style keys without prefixes (
genre=,title=,sid=) - Older OpenURL 0.1 syntax, sometimes mixed with 1.0 keys. See OpenURL 0.1 vs 1.0.
Turning it into something useful
- A citation: take
rft.au/rft.aulast,rft.date,rft.btitleorrft.atitle+rft.jtitle,rft.pub, volume and pages. - A link to full text: put your library's resolver base URL and a
?in front of the string. See How to find your library's OpenURL resolver. - A check: paste it into the validator to spot missing or malformed fields.