VI · 44
Implementations
Open-source libraries that parse and construct OpenURL ContextObjects, by language. Listed without endorsement.
Several open-source libraries parse and build OpenURL ContextObjects. They are listed without endorsement; most are old and lightly maintained, which reflects how stable the standard is. Check each project before adopting it.
Ruby
The openurl gem builds, serializes and parses 1.0 ContextObjects in KEV and XML. Its last release (1.0.0) dates from 2014. It was used by the Umlaut link resolver.
Perl
URI::OpenURL on CPAN, by Tim Brody, extends Perl's URI module with constructors and accessors for 1.0 KEV OpenURLs. Its last release (0.4.6) dates from 2005.
Java
OCLC Research published OpenURL reference code for Java (including the OOMRef-J object model) while it ran the Registry. That work is no longer maintained. Java-based resolvers and discovery systems generally ship their own internal parsers.
Other languages
In PHP, Python and JavaScript, OpenURL handling is usually hand-written: split the query string on &, URL-decode each key and value, and group keys by prefix (url_, ctx_, rft, rfe, req, svc, res, rfr). The parser on this site is a compact client-side example. Watch out for the classic mistakes: decoding before splitting (which breaks values containing %26), discarding repeated keys such as rft.au and rft_id, and ignoring 0.1-style keys.
Open-source applications that emit OpenURLs
Library discovery front-ends such as VuFind and Blacklight generate OpenURLs and COinS for their records, and the reference manager Zotero can both read COinS and send OpenURLs to a configured resolver.
Notes
- Commercial resolvers (SFX, the Alma link resolver, 360 Link, EBSCO Full Text Finder, OCLC's resolver) contain their own closed-source OpenURL parsers.
- For new code, emit SAP1-style KEV with
url_verandctx_ver, and accept 0.1, 1.0 and hybrid input.