VI · 43

Implementations

Open-source libraries that parse and construct OpenURL ContextObjects, by language. Listed without endorsement.

Several open-source libraries implement OpenURL parsing and construction. They are useful for projects that consume or produce OpenURLs and prefer not to roll their own parser. Listed below without endorsement; check each project for current maintenance status before adopting.

Ruby

The openurl gem provides classes for constructing, serializing, and parsing 1.0 ContextObjects in both KEV and XML form. It powers the Umlaut link resolver and several other Ruby-based discovery tools.

Perl

URI::OpenURL on CPAN provides an OpenURL extension to the standard URI module, with constructors for 1.0 KEV ContextObjects and accessors for entities and descriptors.

Java

The original reference implementation for Java was OOMRef-J (OpenURL Object Model Reference, Java), maintained by OCLC alongside the OpenURL Registry. Its public hosting has been retired along with the rest of the Registry infrastructure. Several library-built Java projects continue to ship their own internal parsers.

Other languages

Production OpenURL parsing in other languages — PHP, Python, JavaScript — is typically done with hand-written code, often a few dozen lines that split on &, percent-decode, and group by entity prefix. The in-browser parser on this site is a compact example of such a parser.

Notes

  • Most production link-resolver products (SFX, 360 Link, Alma, EDS, WorldCat Discovery) include closed-source internal OpenURL parsers; these are not generally available as standalone libraries.
  • For new implementations, target SAP1 — KEV, By-Value, HTTP GET — and accept both 0.1 and 1.0 syntax on the input side.

Sources