2 minute read.And the DOI is …
Once structured metadata is added to a file then retrieving a given metadata element is usually a doddle. For example, for PDFs with embedded XMP one can use Phil Harvey’s excellent Exiftool utility.
Exiftool is a Perl library and application which I’ve blogged about here earlier which is available as a ‘.zip‘ file for Windows (no Perl required) or ‘.dmg‘ for MacOS. Note that Phil maintains this actively and has done so over the last five years. (And when I say actively I mean just that. I once made the mistake of printing out the change file.)
If Perl’s not your thing, then there’s a Ruby wrapper gem (MiniExiftool) to access the Exiftool command in trouper OO fashion. Here’s an example Ruby one-liner to get the DOI from a PDF (broken here to meet column width restriction):
% ruby -rubygems -e 'require "mini_exiftool";<br /> puts MiniExiftool.new("test.pdf")["doi"]'<br /> 10.1038/nphoton.2008.200
Of course, that could also have been run against an image, audio or video file with XMP packet.
(Makes one wonder vaguely about the feasibility of having a Swiss Army knife type of utility that could read any file to get the DOI using the embedded XMP, RDFa, RDF, HTML headers, COiNS, etc. Possibly even as last resort fall back to scanning the raw text - if any.)
Further reading
- Jul 9, 2026 – Schema 5.5 now available: adding CRediT, new record types for blogs and posters, and more
- Jun 23, 2026 – New Crossref Service Providers Program ready for applications
- Jun 18, 2026 – Building Better Connections: The Story of Crossref's Metadata Development
- May 26, 2026 – Two billion citation links in Crossref help research travel further
- Apr 23, 2026 – Why metadata matters for research integrity: a new joint guide from Crossref and DataCite
- Apr 13, 2026 – Strengthening community connections in São Paulo
- Mar 31, 2026 – Voices from Crossref Metadata Sprint in São Paulo
- Mar 19, 2026 – On metadata enrichment