]> git.donarmstrong.com Git - org-ref.git/blobdiff - doi-utils.org
added an arxiv example
[org-ref.git] / doi-utils.org
index 5e539dbff3147bee8be0b3535df4e62a83255b68..8a9eac00b1295c1c23dc70650422c82720207cee 100644 (file)
@@ -45,9 +45,9 @@ The principle commands you will use from here are:
 #+END_SRC
 
 * Getting pdf files from a DOI
-The idea here is simple. When you visit http://dx.doi.org/doi, you get redirected to the journal site. Once you have the url for the article, you can usually compute the url to the pdf, or find it in the page. Then you simply download it. 
+The idea here is simple. When you visit http://dx.doi.org/doi, you get redirected to the journal site. Once you have the url for the article, you can usually compute the url to the pdf, or find it in the page. Then you simply download it.
 
-There are some subtleties in doing this that are described here. To get the redirect, we have to use url-retrieve, and a callback function. The callback does not return anything, so we communicate through global variables. url-retrieve is asynchronous, so we have to make sure to wait for it to finish. 
+There are some subtleties in doing this that are described here. To get the redirect, we have to use url-retrieve, and a callback function. The callback does not return anything, so we communicate through global variables. url-retrieve is asynchronous, so we have to make sure to wait for it to finish.
 
 #+BEGIN_SRC emacs-lisp :tangle doi-utils.el
 (defvar *doi-utils-waiting* t
@@ -76,8 +76,8 @@ To actually get the redirect we use url-retrieve like this.
   ;; we are going to wait until the url-retrieve is done
   (setq *doi-utils-waiting* t)
   ;; start with no redirect. it will be set in the callback.
-  (setq *doi-utils-redirect* nil) 
-  (url-retrieve 
+  (setq *doi-utils-redirect* nil)
+  (url-retrieve
    (format "http://dx.doi.org/%s" doi)
    'doi-utils-redirect-callback)
   ; I suspect we need to wait here for the asynchronous process to
@@ -168,7 +168,7 @@ we just change /abs/ to /pdf/.
     (replace-regexp-in-string "/abs/" "/pdf/" *doi-utils-redirect*)))
 #+END_SRC
 
-#+BEGIN_SRC emacs-lisp
+#+BEGIN_SRC emacs-lisp :tangle no
 (acs-pdf-url  "http://pubs.acs.org/doi/abs/10.1021/nl500037x")
 #+END_SRC
 
@@ -190,7 +190,7 @@ we just change /abs/ to /pdf/.
     (concat (replace-regexp-in-string "/stable/" "/stable/pdfplus/" *doi-utils-redirect*) ".pdf")))
 #+END_SRC
 
-** AIP 
+** AIP
 #+BEGIN_SRC emacs-lisp :tangle doi-utils.el
 (defun aip-pdf-url (*doi-utils-redirect*)
   (when (string-match "^http://scitation.aip.org" *doi-utils-redirect*)
@@ -295,7 +295,7 @@ http://www.pnas.org/content/early/2014/05/08/1319030111.full.pdf+html?with-ds=ye
        'aps-pdf-url
        'science-pdf-url
        'nature-pdf-url
-       'wiley-pdf-url       
+       'wiley-pdf-url
        'springer-pdf-url
        'acs-pdf-url
        'iop-pdf-url
@@ -317,7 +317,7 @@ http://www.pnas.org/content/early/2014/05/08/1319030111.full.pdf+html?with-ds=ye
 calculated. Loops through the functions in `doi-utils-pdf-url-functions'
 until one is found"
   (doi-utils-get-redirect doi)
-  
+
   (unless *doi-utils-redirect*
     (error "No redirect found for %s" doi))
   (message "applying functions")
@@ -369,11 +369,11 @@ page. you must have permission to access the pdf. We open the pdf
 at the end."
   (interactive)
   (save-excursion
-    (bibtex-beginning-of-entry) 
+    (bibtex-beginning-of-entry)
     (let (;; get doi, removing http://dx.doi.org/ if it is there.
          (doi (replace-regexp-in-string
                "http://dx.doi.org/" ""
-               (bibtex-autokey-get-field "doi")))             
+               (bibtex-autokey-get-field "doi")))
          (key)
          (pdf-url)
          (pdf-file)
@@ -398,7 +398,7 @@ at the end."
                      (message "%s" (buffer-string))
                      (delete-file pdf-file))
                  (message "%s saved" pdf-file)))
-       
+
              (when (file-exists-p pdf-file)
                (org-open-file pdf-file)))
          (message "No pdf-url found for %s at %s" doi *doi-utils-redirect* ))
@@ -411,8 +411,8 @@ I [[http://homepages.see.leeds.ac.uk/~eeaol/notes/2013/02/doi-metadata/][found]]
 
 #+BEGIN_SRC emacs-lisp :tangle doi-utils.el
 (defun doi-utils-get-json-metadata (doi)
-
-  (let ((url-request-method "GET") 
+  "Try to get json metadata for DOI. Open the DOI in a browser if we do not get it."
+  (let ((url-request-method "GET")
        (url-mime-accept-string "application/citeproc+json")
        (json-object-type 'plist)
        (json-data))
@@ -420,8 +420,11 @@ I [[http://homepages.see.leeds.ac.uk/~eeaol/notes/2013/02/doi-metadata/][found]]
        (url-retrieve-synchronously
         (concat "http://dx.doi.org/" doi))
       (setq json-data (buffer-substring url-http-end-of-headers (point-max)))
-      (message "%s" json-data)
-      (json-read-from-string json-data))))
+      (if (string-match "Resource not found" json-data)
+         (progn
+           (browse-url (concat "http://dx.doi.org/" doi))
+           (error "Resource not found. Opening website."))
+       (json-read-from-string json-data)))))
 #+END_SRC
 
 #+RESULTS:
@@ -433,7 +436,15 @@ For example:
 #+END_SRC
 
 #+RESULTS:
-| :volume | 99 | :indexed | (:timestamp 1399964115538.0 :date-parts [[2014 5 13]]) | :publisher | American Physical Society (APS) | :source | CrossRef | :URL | http://dx.doi.org/10.1103/PhysRevLett.99.016105 | :ISSN | [0031-9007 1079-7114] | :DOI | 10.1103/physrevlett.99.016105 | :type | journal-article | :title | Scaling Properties of Adsorption Energies for Hydrogen-Containing Molecules on Transition-Metal Surfaces | :issue | 1 | :deposited | (:timestamp 1313712000000.0 :date-parts [[2011 8 19]]) | :reference-count | 26 | :container-title | Phys. Rev. Lett. | :author | [(:given F. :family Abild-Pedersen) (:given J. :family Greeley) (:given F. :family Studt) (:given J. :family Rossmeisl) (:given T. :family Munter) (:given P. :family Moses) (:given E. :family Skúlason) (:given T. :family Bligaard) (:given J. :family Nørskov)] | :prefix | http://id.crossref.org/prefix/10.1103 | :score | 1.0 | :issued | (:date-parts [[2007 7]]) | :subject | [Physics and Astronomy(all)] | :subtitle | [] |
+| :member | http://id.crossref.org/member/16 | :volume | 99 | :indexed | (:timestamp 1423435577602 :date-parts [[2015 2 8]]) | :publisher | American Physical Society (APS) | :source | CrossRef | :URL | http://dx.doi.org/10.1103/PhysRevLett.99.016105 | :ISSN | [0031-9007 1079-7114] | :DOI | 10.1103/physrevlett.99.016105 | :type | journal-article | :title | Scaling Properties of Adsorption Energies for Hydrogen-Containing Molecules on Transition-Metal Surfaces | :issue | 1 | :deposited | (:timestamp 1313712000000 :date-parts [[2011 8 19]]) | :reference-count | 26 | :container-title | Phys. Rev. Lett. | :author | [(:given F. :family Abild-Pedersen) (:given J. :family Greeley) (:given F. :family Studt) (:given J. :family Rossmeisl) (:given T. :family Munter) (:given P. :family Moses) (:given E. :family Skúlason) (:given T. :family Bligaard) (:given J. :family Nørskov)] | :prefix | http://id.crossref.org/prefix/10.1103 | :score | 1.0 | :issued | (:date-parts [[2007 7]]) | :subject | [Physics and Astronomy(all)] | :subtitle | [] |
+
+or for a book:
+#+BEGIN_SRC emacs-lisp :tangle no
+(doi-utils-get-json-metadata "10.1007/978-1-4612-4968-9")
+#+END_SRC
+
+#+RESULTS:
+| :member | nil | :indexed | (:timestamp 1423773021494 :date-parts [[2015 2 12]]) | :publisher | Springer New York | :source | CrossRef | :URL | http://dx.doi.org/10.1007/978-1-4612-4968-9 | :ISBN | [http://id.crossref.org/isbn/978-0-387-96347-1 http://id.crossref.org/isbn/978-1-4612-4968-9] | :ISSN | [0172-6056] | :DOI | 10.1007/978-1-4612-4968-9 | :type | book | :title | Constructive Combinatorics | :deposited | (:timestamp 1378684800000 :date-parts [[2013 9 9]]) | :reference-count | 0 | :container-title | Undergraduate Texts in Mathematics | :author | [(:given Dennis :family Stanton) (:given Dennis :family White)] | :prefix | none | :score | 1.0 | :issued | (:date-parts [[1986]]) | :subtitle | [] |
 
 We can use that data to construct a bibtex entry. We do that by defining a template, and filling it in. I wrote this template expansion code which makes it easy to substitute values like %{} in emacs lisp.
 
@@ -448,63 +459,96 @@ We can use that data to construct a bibtex entry. We do that by defining a templ
 
 Now we define a function that fills in that template from the metadata.
 
+As different bibtex types share common keys, it is advantageous to separate data extraction from json, and the formatting of the bibtex entry.
+
+#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
+(setq doi-utils-json-metadata-extract
+      '((type       (plist-get results :type))
+        (author     (mapconcat (lambda (x) (concat (plist-get x :given) " " (plist-get x :family)))
+                     (plist-get results :author) " and "))
+        (title      (plist-get results :title))
+        (subtitle   (plist-get results :subtitle))
+        (journal    (plist-get results :container-title))
+        (series     (plist-get results :container-title))
+        (publisher  (plist-get results :publisher))
+        (volume     (plist-get results :volume))
+        (issue      (plist-get results :issue))
+        (number     (plist-get results :issue))
+        (year       (elt (elt (plist-get (plist-get results :issued) :date-parts) 0) 0))
+        (month      (elt (elt (plist-get (plist-get results :issued) :date-parts) 0) 1))
+        (pages      (plist-get results :page))
+        (doi        (plist-get results :DOI))
+        (url        (plist-get results :URL))
+        (booktitle  (plist-get results :container-title))))
+#+END_SRC
+
+Next, we need to define the different bibtex types. Each type has a bibtex type (for output) and the type as provided in the doi record. Finally, we have to declare the fields we want to output.
+
+#+BEGIN_SRC emacs-lisp :tangle doi-utils.el :results none
+(setq doi-utils-bibtex-type-generators nil)
+
+(defun doi-utils-concat-prepare (lst &optional acc)
+  "Given a list `lst' of strings and other expressions, which are
+intented to passed to `concat', concat any subsequent strings,
+minimising the number of arguments being passed to `concat'
+without changing the results."
+  (cond ((null lst) (nreverse acc))
+        ((and (stringp (car lst))
+              (stringp (car acc)))
+         (doi-utils-concat-prepare (cdr lst) (cons (concat (car acc) (car lst))
+                                         (cdr acc))))
+        (t (doi-utils-concat-prepare (cdr lst) (cons (car lst) acc)))))
+
+(defmacro doi-utils-def-bibtex-type (name matching-types &rest fields)
+  "Define a BibTeX type identified by (symbol) `name' with
+`fields' (given as symbols), matching to retrieval expressions in
+`doi-utils-json-metadata-extract'. This type will only be used
+when the `:type' parameter in the JSON metadata is contained in
+`matching-types' - a list of strings."
+  `(push (lambda (type results)
+           (when (or ,@(mapcar (lambda (match-type) `(string= type ,match-type)) matching-types))
+             (let ,(mapcar (lambda (field)
+                             (let ((field-expr (assoc field doi-utils-json-metadata-extract)))
+                               (if field-expr
+                                   ;; need to convert to string first
+                                   `(,(car field-expr) (format "%s" ,(cadr field-expr)))
+                                   (error "unknown bibtex field type %s" field))))
+                           fields)
+               (concat
+                ,@(doi-utils-concat-prepare
+                   (-flatten
+                    (list (concat "@" (symbol-name name) "{,\n")
+                          ;; there seems to be some bug with mapcan,
+                          ;; so we fall back to flatten
+                          (mapcar (lambda (field)
+                                    `("  " ,(symbol-name field) " = {" ,field "},\n"))
+                                  fields)
+                          "}\n")))))))
+         doi-utils-bibtex-type-generators))
+
+(doi-utils-def-bibtex-type article ("journal-article" "article-journal")
+                           author title journal year volume number pages doi url)
+
+(doi-utils-def-bibtex-type inproceedings ("proceedings-article")
+                           author title booktitle year month pages doi url)
+
+(doi-utils-def-bibtex-type book ("book")
+                           author title series publisher year pages doi url)
+
+(doi-utils-def-bibtex-type inbook ("book-chapter")
+                           author title booktitle series publisher year pages doi url)
+
+#+END_SRC
+
+With the code generating the bibtex entry in place, we can glue it to the json retrieval code.
 #+BEGIN_SRC emacs-lisp :tangle doi-utils.el
 (defun doi-utils-doi-to-bibtex-string (doi)
-  "return a bibtex entry as a string for the doi. Only articles are currently supported"
-  (let (type
-       results
-       author
-       title
-       booktitle
-       journal
-       year
-       volume
-       number
-       pages
-       month
-       url
-       json-data)
-    (setq results (doi-utils-get-json-metadata doi)
-         json-data (format "%s" results)
-         type (plist-get results :type)
-         author (mapconcat (lambda (x) (concat (plist-get x :given) " " (plist-get x :family)))
-                           (plist-get results :author) " and ")
-         title (plist-get results :title)
-         journal (plist-get results :container-title)
-         volume (plist-get results :volume)
-         issue (plist-get results :issue)
-         year (elt (elt (plist-get (plist-get results :issued) :date-parts) 0) 0)
-         pages (plist-get results :page)
-         doi (plist-get results :DOI)
-         url (plist-get results :URL))
-    (cond
-     ((or (string= type "journal-article") (string= type "article-journal"))
-      (doi-utils-expand-template "@article{,
-  author =      {%{author}},
-  title =       {%{title}},
-  journal =     {%{journal}},
-  year =        {%{year}},
-  volume =      {%{volume}},
-  number =      {%{issue}},
-  pages =       {%{pages}},
-  doi =          {%{doi}},
-  url =          {%{url}},
-}"))
-     
-     ((string= type "proceedings-article")
-      (setq booktitle (plist-get results :container-title))
-      (doi-utils-expand-template "@inproceedings{,
-  author =      {%{author}},
-  title =       {%{title}},
-  booktitle =    {%{booktitle}},
-  year =        {%{year}},
-  month =       {%{month}},
-  pages =       {%{pages}},
-  doi =          {%{doi}},
-  url =          {%{url}},
-}"))
-     
-    (t (message-box "%s not supported yet." type)))))
+  "return a bibtex entry as a string for the doi. Not all types are supported yet."
+  (let* ((results (doi-utils-get-json-metadata doi))
+         (type (plist-get results :type)))
+    ;(format "%s" results) ; json-data
+    (or (some (lambda (g) (funcall g type results)) doi-utils-bibtex-type-generators)
+        (message "%s not supported yet\n%S." type results))))
 #+END_SRC
 
 #+RESULTS:
@@ -518,15 +562,35 @@ To see that in action:
 #+RESULTS:
 #+begin_example
 @article{,
-  author =      {F. Abild-Pedersen and J. Greeley and F. Studt and J. Rossmeisl and T. Munter and P. Moses and E. Skúlason and T. Bligaard and J. Nørskov},
-  title =       {Scaling Properties of Adsorption Energies for Hydrogen-Containing Molecules on Transition-Metal Surfaces},
-  journal =     {Phys. Rev. Lett.},
-  year =        {2007},
-  volume =      {99},
-  number =      {1},
-  pages =       {nil},
-  doi =          {10.1103/physrevlett.99.016105},
-  url =          {http://dx.doi.org/10.1103/PhysRevLett.99.016105},
+  author = {F. Abild-Pedersen and J. Greeley and F. Studt and J. Rossmeisl and T. Munter and P. Moses and E. Skúlason and T. Bligaard and J. Nørskov},
+  title = {Scaling Properties of Adsorption Energies for Hydrogen-Containing Molecules on Transition-Metal Surfaces},
+  journal = {Phys. Rev. Lett.},
+  year = {2007},
+  volume = {99},
+  number = {1},
+  pages = {nil},
+  doi = {10.1103/physrevlett.99.016105},
+  url = {http://dx.doi.org/10.1103/PhysRevLett.99.016105},
+}
+#+end_example
+
+and for a book:
+
+#+BEGIN_SRC emacs-lisp :tangle no
+(doi-utils-doi-to-bibtex-string "10.1007/978-1-4612-4968-9")
+#+END_SRC
+
+#+RESULTS:
+#+begin_example
+@book{,
+  author = {Dennis Stanton and Dennis White},
+  title = {Constructive Combinatorics},
+  series = {Undergraduate Texts in Mathematics},
+  publisher = {Springer New York},
+  year = {1986},
+  pages = {nil},
+  doi = {10.1007/978-1-4612-4968-9},
+  url = {http://dx.doi.org/10.1007/978-1-4612-4968-9},
 }
 #+end_example
 
@@ -536,9 +600,11 @@ That is just the string for the entry. To be useful, we need a function that ins
 (defun doi-utils-insert-bibtex-entry-from-doi (doi)
   "insert bibtex entry from a doi. Also cleans entry using
 org-ref, and tries to download the corresponding pdf."
-  (interactive "sDOI")
+  (interactive "sDOI :")
   (insert (doi-utils-doi-to-bibtex-string doi))
   (backward-char)
+  ;; set date added for the record
+  (bibtex-set-field "DATE_ADDED" (current-time-string))
   (if (bibtex-key-in-head nil)
        (org-ref-clean-bibtex-entry t)
      (org-ref-clean-bibtex-entry))
@@ -546,45 +612,56 @@ org-ref, and tries to download the corresponding pdf."
    (doi-utils-get-bibtex-entry-pdf)
    (save-selected-window
      (org-ref-open-bibtex-notes)))
+
 #+END_SRC
 
 It may be you are in some other place when you want to add a bibtex entry. This next function will open the first entry in org-ref-default-bibliography go to the end, and add the entry. You can sort it later.
 
 #+BEGIN_SRC emacs-lisp :tangle doi-utils.el
 (defun doi-utils-add-bibtex-entry-from-doi (doi bibfile)
-  "add entry to end of a file in `org-ref-default-bibliography' or in the current directory ending with .bib."
+  "Add entry to end of a file in in the current directory ending
+with .bib or in `org-ref-default-bibliography'. If you have an
+active region that starts like a DOI, that will be the initial
+prompt. If no region is selected and the first entry of the
+kill-ring starts like a DOI, then that is the intial
+prompt. Otherwise, you have to type or pste in a DOI."
   (interactive
-   (list
-    (read-string "DOI: ")
-    (ido-completing-read
-     "Bibfile: "
-     (append org-ref-default-bibliography
-            (f-entries "." (lambda (f) (f-ext? f "bib")))))))
-  (find-file bibfile)
-  (goto-char (point-min))
-  (if (search-forward doi nil t)
-      (message "%s is already in this file" doi)
-    (end-of-buffer)
-    (insert "\n\n")
-    (doi-utils-insert-bibtex-entry-from-doi doi)
-    (save-buffer)))
+   (list (read-input "DOI: "
+                    ;; now set initial input
+                    (cond
+                     ;; If region is active and it starts like a doi we want it.
+                     ((and  (region-active-p)
+                             (s-match "^10" (buffer-substring
+                                             (region-beginning)
+                                             (region-end))))
+                      (buffer-substring (region-beginning) (region-end)))
+                     ;; if the first entry in the kill-ring looks
+                     ;; like a DOI, let's use it.
+                     ((if (s-match "^10" (car kill-ring))
+                          (car kill-ring)))
+                     ;; otherwise, we have no initial input. You
+                     ;; will have to type it in.
+                     (t
+                      nil)))
+        ;;  now get the bibfile to add it to
+        (ido-completing-read
+         "Bibfile: "
+         (append (f-entries "." (lambda (f) (f-ext? f "bib")))
+                 org-ref-default-bibliography))))
+  ;; Wrap in save-window-excursion to restore your window arrangement after this
+  ;; is done.
+  (save-window-excursion
+    (find-file bibfile)
+    ;; Check if the doi already exists
+    (goto-char (point-min))
+    (if (search-forward doi nil t)
+       (message "%s is already in this file" doi)
+      (end-of-buffer)
+      (insert "\n\n")
+      (doi-utils-insert-bibtex-entry-from-doi doi)
+      (save-buffer))))
 #+END_SRC
 
-It may be you want to just highlight a doi, and then add it. Here is that function.
-
-#+BEGIN_SRC emacs-lisp  :tangle doi-utils.el
-(defun doi-utils-add-bibtex-entry-from-region (start end)
-  "add entry assuming region is a doi to end of first entry in `org-ref-default-bibliography'."
-  (interactive "r")
-  (let ((doi (buffer-substring start end)))
-    (find-file (car org-ref-default-bibliography))
-    (end-of-buffer)
-    (insert "\n")
-    (doi-utils-insert-bibtex-entry-from-doi doi)))
-#+END_SRC
-
-#+RESULTS:
-: doi-utils-add-bibtex-entry-from-region
 
 * Updating bibtex entries
 I wrote this code because it is pretty common for me to copy bibtex entries from ASAP articles that are incomplete, e.g. no page numbers because it is not in print yet. I wanted a convenient way to update an entry from its DOI. Basically, we get the metadata, and update the fields in the entry.
@@ -617,7 +694,7 @@ There is not bibtex set field function, so I wrote this one.
       (insert value))))
 #+END_SRC
 
-The updating function looks like this. We get all the keys from the json plist metadata, and update the fields if they exist.
+The updating function for a whole entry looks like this. We get all the keys from the json plist metadata, and update the fields if they exist.
 
 #+BEGIN_SRC emacs-lisp :tangle doi-utils.el
 (defun plist-get-keys (plist)
@@ -642,13 +719,13 @@ The updating function looks like this. We get all the keys from the json plist m
                       (elt
                        (elt
                         (plist-get
-                         (plist-get results :issued) :date-parts) 0) 0)))      
+                         (plist-get results :issued) :date-parts) 0) 0)))
        (volume (plist-get results :volume))
        (number (or (plist-get results :issue) ""))
        (pages (or (plist-get results :page) ""))
        (url (or (plist-get results :URL) ""))
        (doi (plist-get results :DOI)))
-    
+
     ;; map the json fields to bibtex fields. The code each field is mapped to is evaluated.
     (setq mapping '((:author . (bibtex-set-field "author" author))
                    (:title . (bibtex-set-field "title" title))
@@ -665,12 +742,35 @@ The updating function looks like this. We get all the keys from the json plist m
      (lambda (key)
        (eval (cdr (assoc key mapping))))
      (plist-get-keys results)))
-  
+
   ; reclean entry, but keep key if it exists.
   (if (bibtex-key-in-head)
       (org-ref-clean-bibtex-entry t)
     (org-ref-clean-bibtex-entry)))
 #+END_SRC
+
+A downside to updating an entry is it overwrites what you have already fixed. So, we next develop a function to update the field at point.
+
+#+BEGIN_SRC emacs-lisp
+(defun doi-utils-update-field ()
+  (interactive)
+  (let* ((doi (bibtex-autokey-get-field "doi"))
+        (results (doi-utils-get-json-metadata doi))
+        (field (car (bibtex-find-text-internal nil nil ","))))
+    (cond
+     ((string= field "volume")
+      (bibtex-set-field field (plist-get results :volume)))
+     ((string= field "number")
+      (bibtex-set-field field (plist-get results :issue)))
+     ((string= field "pages")
+      (bibtex-set-field field (plist-get results :page)))
+     ((string= field "year")
+      (bibtex-set-field field (plist-get results :year)))
+     (t
+      (message "%s not supported yet." field)))))
+#+END_SRC
+
+
 * DOI functions for WOS
 I came across this API http://wokinfo.com/media/pdf/OpenURL-guide.pdf to make links to the things I am interested in here. Based on that document, here are three links based on a doi:10.1021/jp047349j that take you to different Web Of Science (WOS) pages.
 
@@ -760,7 +860,7 @@ The idea is to add a menu to the doi link, so rather than just clicking to open
 
 
 (defvar doi-link-menu-funcs '()
- "Functions to run in doi menu. Each entry is a list of (key menu-name function). 
+ "Functions to run in doi menu. Each entry is a list of (key menu-name function).
 The function must take one argument, the doi.")
 
 (setq doi-link-menu-funcs
@@ -776,7 +876,7 @@ The function must take one argument, the doi.")
 
 
 (defun doi-link-menu (link-string)
-   "Generate the link menu message, get choice and execute it. 
+   "Generate the link menu message, get choice and execute it.
 Options are stored in `doi-link-menu-funcs'."
    (interactive)
    (message
@@ -791,7 +891,7 @@ Options are stored in `doi-link-menu-funcs'."
                   (char-to-string input) doi-link-menu-funcs)))
      (when choice
        (funcall
-       (elt 
+       (elt
         choice
         2)
        link-string))))
@@ -801,7 +901,568 @@ Options are stored in `doi-link-menu-funcs'."
  'doi-link-menu)
 #+END_SRC
 
-doi:10.1021/jp047349j  
+doi:10.1021/jp047349j
+
+
+* Getting a doi for a bibtex entry missing one
+Some bibtex entries do not have a DOI, maybe because they were entered by hand, or copied from a source that did not have it available. Here we develop some functions to help you find the DOI using Crossref.
+
+Here is our example bibtex entry.
+#+BEGIN_SRC bibtex
+@article{deml-2014-oxide,
+  author =      {Ann M. Deml and Vladan Stevanovi{\'c} and
+                  Christopher L. Muhich and Charles B. Musgrave and
+                  Ryan O'Hayre},
+  title =       {Oxide Enthalpy of Formation and Band Gap Energy As
+                  Accurate Descriptors of Oxygen Vacancy Formation
+                  Energetics},
+  journal =     {Energy Environ. Sci.},
+  volume =      7,
+  number =      6,
+  pages =       1996,
+  year =        2014,
+  doi =                 {10.1039/c3ee43874k,
+  url =                 {http://dx.doi.org/10.1039/c3ee43874k}},
+
+}
+
+
+#+END_SRC
+
+The idea is to query Crossref in a way that is likely to give us a hit relevant to the entry.
+
+According to http://search.crossref.org/help/api we can send a query with a free form citation that may give us something back. We do this to get a list of candidates, and run a helm command to get the doi.
+
+
+#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
+(defun doi-utils-crossref-citation-query ()
+  "Query Crossref with the title of the bibtex entry at point to
+get a list of possible matches. This opens a helm buffer to
+select an entry. The default action inserts a doi and url field
+in the bibtex entry at point. The second action opens the doi
+url. If there is already a doi field, the function raises an
+error."
+  (interactive)
+  (bibtex-beginning-of-entry)
+  (let* ((entry (bibtex-parse-entry))
+        (json-string)
+        (json-data)
+        (doi))
+    (unless (string= ""(reftex-get-bib-field "doi" entry))
+      (error "Entry already has a doi field"))
+
+    (with-current-buffer
+       (url-retrieve-synchronously
+        (concat
+         "http://search.crossref.org/dois?q="
+         (url-hexify-string (org-ref-bib-citation))))
+      (setq json-string (buffer-substring url-http-end-of-headers (point-max)))
+      (setq json-data (json-read-from-string json-string)))
+
+    (let* ((name (format "Crossref hits for %s" (org-ref-bib-citation)))
+          (helm-candidates (mapcar (lambda (x)
+                                     (cons
+                                      (concat
+                                       (cdr (assoc 'fullCitation x))
+                                       " "
+                                       (cdr (assoc 'doi x)))
+                                      (cdr (assoc 'doi x))))
+                                     json-data))
+          (source `((name . ,name)
+                    (candidates . ,helm-candidates)
+                    ;; just return the candidate
+                    (action . (("Insert doi and url field" . (lambda (doi)
+                                                               (bibtex-make-field "doi")
+                                                               (backward-char)
+                                                               ;; crossref returns doi url, but I prefer only a doi for the doi field
+                                                               (insert (replace-regexp-in-string "^http://dx.doi.org/" "" doi))
+                                                               (when (string= ""(reftex-get-bib-field "url" entry))
+                                                                 (bibtex-make-field "url")
+                                                                 (backward-char)
+                                                                 (insert doi))))
+                               ("Open url" . (lambda (doi)
+                                               (browse-url doi))))))))
+      (helm :sources '(source)))))
+#+END_SRC
+
+#+RESULTS:
+: doi-utils-crossref-citation-query
+
+
+
+* Debugging a DOI
+I wrote this function to help debug a DOI. This function generates an org-buffer with the doi, gets the json metadata, shows the bibtex entry, and the pdf link for it.
+
+#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
+(defun doi-utils-debug (doi)
+  "Generate an org-buffer showing data about DOI."
+  (interactive "sDOI: ")
+  (switch-to-buffer "*debug-doi*")
+  (erase-buffer)
+  (org-mode)
+  (insert (concat "doi:" doi) "\n\n")
+  (insert "* JSON
+" (format "%s" (doi-utils-get-json-metadata doi)) "
+
+* Bibtex
+
+" (doi-utils-doi-to-bibtex-string doi) "
+
+* PDF
+" (doi-utils-get-pdf-url doi)))
+#+END_SRC
+
+#+RESULTS:
+: doi-utils-debug
+
+* Adding a bibtex entry from a crossref query
+The idea here is to perform a query on Crossref, get a helm buffer of candidates, and select the entry(ies) you want to add to your bibtex file. You can select a region, e.g. a free form citation, or set of words, or you can type the query in by hand.
+
+#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
+(defun doi-utils-add-entry-from-crossref-query (query bibtex-file)
+  (interactive (list
+               (read-input
+                "Query: "
+                ;; now set initial input
+                (cond
+                 ;; If region is active assume we want it
+                 ((region-active-p)
+                  (replace-regexp-in-string
+                   "\n" " "
+                   (buffer-substring (region-beginning) (region-end))))
+                 ;; type or paste it in
+                 (t
+                  nil)))
+               (ido-completing-read
+                "Bibfile: "
+                (append (f-entries "." (lambda (f) (f-ext? f "bib")))
+                        org-ref-default-bibliography))))
+  (let* ((json-string)
+        (json-data)
+        (doi))
+
+    (with-current-buffer
+       (url-retrieve-synchronously
+        (concat
+         "http://search.crossref.org/dois?q="
+         (url-hexify-string query)))
+      (setq json-string (buffer-substring url-http-end-of-headers (point-max)))
+      (setq json-data (json-read-from-string json-string)))
+
+    (let* ((name (format "Crossref hits for %s"
+                        ;; remove carriage returns. they cause problems in helm.
+                        (replace-regexp-in-string "\n" " " query)))
+          (helm-candidates (mapcar (lambda (x)
+                                     (cons
+                                      (concat
+                                       (cdr (assoc 'fullCitation x))
+                                       " "
+                                       (cdr (assoc 'doi x)))
+                                      (cdr (assoc 'doi x))))
+                                     json-data))
+          (source `((name . ,name)
+                    (candidates . ,helm-candidates)
+                    ;; just return the candidate
+                    (action . (("Insert bibtex entry" . (lambda (doi)
+                                                          (doi-utils-add-bibtex-entry-from-doi
+                                                           (replace-regexp-in-string "^http://dx.doi.org/" "" doi) ,bibtex-file)))
+                               ("Open url" . (lambda (doi)
+                                               (browse-url doi))))))))
+      (helm :sources '(source)))))
+#+END_SRC
+
+** json
+
+#+name: json
+#+BEGIN_EXAMPLE
+[
+  {
+    "doi": "http://dx.doi.org/10.1039/c3ee43874k",
+    "score": 4.7002907,
+    "normalizedScore": 100,
+    "title": "Oxide enthalpy of formation and band gap energy as accurate descriptors of oxygen vacancy formation energetics",
+    "fullCitation": "Ann M. Deml, Vladan Stevanović, Christopher L. Muhich, Charles B. Musgrave, Ryan O'Hayre, 2014, 'Oxide enthalpy of formation and band gap energy as accurate descriptors of oxygen vacancy formation energetics', <i>Energy &amp; Environmental Science</i>, vol. 7, no. 6, p. 1996",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1039%2Fc3ee43874k&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Oxide+enthalpy+of+formation+and+band+gap+energy+as+accurate+descriptors+of+oxygen+vacancy+formation+energetics&amp;rft.jtitle=Energy+%26+Environmental+Science&amp;rft.date=2014&amp;rft.volume=7&amp;rft.issue=6&amp;rft.spage=1996&amp;rft.aufirst=Ann+M.&amp;rft.aulast=Deml&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Ann+M.+Deml&amp;rft.au=+Vladan+Stevanovi%C4%87&amp;rft.au=+Christopher+L.+Muhich&amp;rft.au=+Charles+B.+Musgrave&amp;rft.au=+Ryan+O%27Hayre",
+    "year": "2014"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1103/physrevb.86.085123",
+    "score": 1.129964,
+    "normalizedScore": 24,
+    "title": "Composition-dependent oxygen vacancy formation in multicomponent wide-band-gap oxides",
+    "fullCitation": "Altynbek Murat, Julia E. Medvedeva, 2012, 'Composition-dependent oxygen vacancy formation in multicomponent wide-band-gap oxides', <i>Physical Review B</i>, vol. 86, no. 8",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1103%2Fphysrevb.86.085123&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Composition-dependent+oxygen+vacancy+formation+in+multicomponent+wide-band-gap+oxides&amp;rft.jtitle=Physical+Review+B&amp;rft.date=2012&amp;rft.volume=86&amp;rft.issue=8&amp;rft.aufirst=Altynbek&amp;rft.aulast=Murat&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Altynbek+Murat&amp;rft.au=+Julia+E.+Medvedeva",
+    "year": "2012"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1021/cm5033755",
+    "score": 0.94063884,
+    "normalizedScore": 20,
+    "title": " Tunable Oxygen Vacancy Formation Energetics in the Complex Perovskite Oxide Sr  x  La  1– x  Mn  y  Al  1– y  O 3 ",
+    "fullCitation": "Ann M. Deml, Vladan Stevanović, Aaron M. Holder, Michael Sanders, Ryan O’Hayre, Charles B. Musgrave, 2014, ' Tunable Oxygen Vacancy Formation Energetics in the Complex Perovskite Oxide Sr  x  La  1– x  Mn  y  Al  1– y  O 3 ', <i>Chemistry of Materials</i>, vol. 26, no. 22, pp. 6595-6602",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1021%2Fcm5033755&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=+Tunable+Oxygen+Vacancy+Formation+Energetics+in+the+Complex+Perovskite+Oxide+Sr++x++La++1%E2%80%93+x++Mn++y++Al++1%E2%80%93+y++O+3+&amp;rft.jtitle=Chemistry+of+Materials&amp;rft.date=2014&amp;rft.volume=26&amp;rft.issue=22&amp;rft.spage=6595&amp;rft.epage=6602&amp;rft.aufirst=Ann+M.&amp;rft.aulast=Deml&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Ann+M.+Deml&amp;rft.au=+Vladan+Stevanovi%C4%87&amp;rft.au=+Aaron+M.+Holder&amp;rft.au=+Michael+Sanders&amp;rft.au=+Ryan+O%E2%80%99Hayre&amp;rft.au=+Charles+B.+Musgrave",
+    "year": "2014"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1103/physrevb.37.5905",
+    "score": 0.8346345,
+    "normalizedScore": 17,
+    "title": "Oxygen-vacancy-formation enthalpy in YBa_{2}(Cu_{0.985}Fe_{0.015})_{3}O_{7-δ} oxide superconductor",
+    "fullCitation": "Chuck Blue, Khaled Elgaid, Ivan Zitkovsky, P. Boolchand, Darl McDaniel, W. Joiner, Jean Oostens, Warren Huff, 1988, 'Oxygen-vacancy-formation enthalpy in YBa_{2}(Cu_{0.985}Fe_{0.015})_{3}O_{7-δ} oxide superconductor', <i>Physical Review B</i>, vol. 37, no. 10, pp. 5905-5908",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1103%2Fphysrevb.37.5905&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Oxygen-vacancy-formation+enthalpy+in+YBa_%7B2%7D%28Cu_%7B0.985%7DFe_%7B0.015%7D%29_%7B3%7DO_%7B7-%CE%B4%7D+oxide+superconductor&amp;rft.jtitle=Physical+Review+B&amp;rft.date=1988&amp;rft.volume=37&amp;rft.issue=10&amp;rft.spage=5905&amp;rft.epage=5908&amp;rft.aufirst=Chuck&amp;rft.aulast=Blue&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Chuck+Blue&amp;rft.au=+Khaled+Elgaid&amp;rft.au=+Ivan+Zitkovsky&amp;rft.au=+P.+Boolchand&amp;rft.au=+Darl+McDaniel&amp;rft.au=+W.+Joiner&amp;rft.au=+Jean+Oostens&amp;rft.au=+Warren+Huff",
+    "year": "1988"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1063/1.1732384",
+    "score": 0.7613335,
+    "normalizedScore": 16,
+    "title": "Enthalpy of Formation of Oxygen Vacancies in Barium Oxide",
+    "fullCitation": "H. Holloway, 1962, 'Enthalpy of Formation of Oxygen Vacancies in Barium Oxide', <i>The Journal of Chemical Physics</i>, vol. 36, no. 11, p. 2820",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1063%2F1.1732384&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Enthalpy+of+Formation+of+Oxygen+Vacancies+in+Barium+Oxide&amp;rft.jtitle=The+Journal+of+Chemical+Physics&amp;rft.date=1962&amp;rft.volume=36&amp;rft.issue=11&amp;rft.spage=2820&amp;rft.aufirst=H.&amp;rft.aulast=Holloway&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=H.+Holloway",
+    "year": "1962"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1002/crat.2170221219",
+    "score": 0.73206276,
+    "normalizedScore": 15,
+    "title": "Vacancy formation enthalpy in AgZn alloys",
+    "fullCitation": "St. Chabik, 1987, 'Vacancy formation enthalpy in AgZn alloys', <i>Crystal Research and Technology</i>, vol. 22, no. 12, pp. 1523-1527",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1002%2Fcrat.2170221219&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Vacancy+formation+enthalpy+in+AgZn+alloys&amp;rft.jtitle=Crystal+Research+and+Technology&amp;rft.date=1987&amp;rft.volume=22&amp;rft.issue=12&amp;rft.spage=1523&amp;rft.epage=1527&amp;rft.aufirst=St.&amp;rft.aulast=Chabik&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=St.+Chabik",
+    "year": "1987"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1007/s10562-013-0985-7",
+    "score": 0.692246,
+    "normalizedScore": 14,
+    "title": "Methane Oxidation by Lanthanum Oxide Doped with Cu, Zn, Mg, Fe, Nb, Ti, Zr, or Ta: The Connection Between the Activation Energy and the Energy of Oxygen-Vacancy Formation",
+    "fullCitation": "Alan R. Derk, Bo Li, Sudhanshu Sharma, George M. Moore, Eric W. McFarland, Horia Metiu, 2013, 'Methane Oxidation by Lanthanum Oxide Doped with Cu, Zn, Mg, Fe, Nb, Ti, Zr, or Ta: The Connection Between the Activation Energy and the Energy of Oxygen-Vacancy Formation', <i>Catalysis Letters</i>, vol. 143, no. 5, pp. 406-410",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1007%2Fs10562-013-0985-7&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Methane+Oxidation+by+Lanthanum+Oxide+Doped+with+Cu%2C+Zn%2C+Mg%2C+Fe%2C+Nb%2C+Ti%2C+Zr%2C+or+Ta%3A+The+Connection+Between+the+Activation+Energy+and+the+Energy+of+Oxygen-Vacancy+Formation&amp;rft.jtitle=Catalysis+Letters&amp;rft.date=2013&amp;rft.volume=143&amp;rft.issue=5&amp;rft.spage=406&amp;rft.epage=410&amp;rft.aufirst=Alan+R.&amp;rft.aulast=Derk&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Alan+R.+Derk&amp;rft.au=+Bo+Li&amp;rft.au=+Sudhanshu+Sharma&amp;rft.au=+George+M.+Moore&amp;rft.au=+Eric+W.+McFarland&amp;rft.au=+Horia+Metiu",
+    "year": "2013"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1039/c3cp55214d",
+    "score": 0.6675249,
+    "normalizedScore": 14,
+    "title": "Oxygen vacancy formation and annihilation in lanthanum cerium oxide as a metal reactive oxide on 4H-silicon carbide",
+    "fullCitation": "Way Foong Lim, Kuan Yew Cheong, 2014, 'Oxygen vacancy formation and annihilation in lanthanum cerium oxide as a metal reactive oxide on 4H-silicon carbide', <i>Physical Chemistry Chemical Physics</i>, vol. 16, no. 15, p. 7015",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1039%2Fc3cp55214d&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Oxygen+vacancy+formation+and+annihilation+in+lanthanum+cerium+oxide+as+a+metal+reactive+oxide+on+4H-silicon+carbide&amp;rft.jtitle=Physical+Chemistry+Chemical+Physics&amp;rft.date=2014&amp;rft.volume=16&amp;rft.issue=15&amp;rft.spage=7015&amp;rft.aufirst=Way+Foong&amp;rft.aulast=Lim&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Way+Foong+Lim&amp;rft.au=+Kuan+Yew+Cheong",
+    "year": "2014"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1021/cm052543j",
+    "score": 0.6519111,
+    "normalizedScore": 13,
+    "title": "Energetics of Bulk and Nano-Akaganeite, β-FeOOH:  Enthalpy of Formation, Surface Enthalpy, and Enthalpy of Water Adsorption",
+    "fullCitation": "Lena Mazeina, Suraj Deore, Alexandra Navrotsky, 2006, 'Energetics of Bulk and Nano-Akaganeite, β-FeOOH:  Enthalpy of Formation, Surface Enthalpy, and Enthalpy of Water Adsorption', <i>Chemistry of Materials</i>, vol. 18, no. 7, pp. 1830-1838",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1021%2Fcm052543j&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Energetics+of+Bulk+and+Nano-Akaganeite%2C+%CE%B2-FeOOH%3A%C2%A0+Enthalpy+of+Formation%2C+Surface+Enthalpy%2C+and+Enthalpy+of+Water+Adsorption&amp;rft.jtitle=Chemistry+of+Materials&amp;rft.date=2006&amp;rft.volume=18&amp;rft.issue=7&amp;rft.spage=1830&amp;rft.epage=1838&amp;rft.aufirst=Lena&amp;rft.aulast=Mazeina&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Lena+Mazeina&amp;rft.au=+Suraj+Deore&amp;rft.au=+Alexandra+Navrotsky",
+    "year": "2006"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1063/1.1677897",
+    "score": 0.6344446,
+    "normalizedScore": 13,
+    "title": "Thermochemical and Theoretical Investigations of the Sodium-Oxygen System. I. The Standard Enthalpy of Formation of Sodium Oxide (Na2O)",
+    "fullCitation": "P. A. G. O'Hare, 1972, 'Thermochemical and Theoretical Investigations of the Sodium-Oxygen System. I. The Standard Enthalpy of Formation of Sodium Oxide (Na2O)', <i>The Journal of Chemical Physics</i>, vol. 56, no. 9, p. 4513",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1063%2F1.1677897&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Thermochemical+and+Theoretical+Investigations+of+the+Sodium-Oxygen+System.+I.+The+Standard+Enthalpy+of+Formation+of+Sodium+Oxide+%28Na2O%29&amp;rft.jtitle=The+Journal+of+Chemical+Physics&amp;rft.date=1972&amp;rft.volume=56&amp;rft.issue=9&amp;rft.spage=4513&amp;rft.aufirst=P.+A.+G.&amp;rft.aulast=O%27Hare&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=P.+A.+G.+O%27Hare",
+    "year": "1972"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1063/1.1679492",
+    "score": 0.6344446,
+    "normalizedScore": 13,
+    "title": "Erratum: Thermochemical and theoretical investigations of the sodium-oxygen system. I. The standard enthalpy of formation of sodium oxide (Na2O)",
+    "fullCitation": "P. A. G. O'Hare, 1973, 'Erratum: Thermochemical and theoretical investigations of the sodium-oxygen system. I. The standard enthalpy of formation of sodium oxide (Na2O)', <i>The Journal of Chemical Physics</i>, vol. 58, no. 5, p. 2196",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1063%2F1.1679492&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Erratum%3A+Thermochemical+and+theoretical+investigations+of+the+sodium-oxygen+system.+I.+The+standard+enthalpy+of+formation+of+sodium+oxide+%28Na2O%29&amp;rft.jtitle=The+Journal+of+Chemical+Physics&amp;rft.date=1973&amp;rft.volume=58&amp;rft.issue=5&amp;rft.spage=2196&amp;rft.aufirst=P.+A.+G.&amp;rft.aulast=O%27Hare&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=P.+A.+G.+O%27Hare",
+    "year": "1973"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1002/pssb.19680250249",
+    "score": 0.62748235,
+    "normalizedScore": 13,
+    "title": "On enthalpy calculation of vacancy formation in inorganic substances",
+    "fullCitation": "B. N. Oshcherin, 1968, 'On enthalpy calculation of vacancy formation in inorganic substances', <i>Physica Status Solidi (b)</i>, vol. 25, no. 2, pp. K123-K125",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1002%2Fpssb.19680250249&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=On+enthalpy+calculation+of+vacancy+formation+in+inorganic+substances&amp;rft.jtitle=Physica+Status+Solidi+%28b%29&amp;rft.date=1968&amp;rft.volume=25&amp;rft.issue=2&amp;rft.spage=K123&amp;rft.epage=K125&amp;rft.aufirst=B.+N.&amp;rft.aulast=Oshcherin&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=B.+N.+Oshcherin",
+    "year": "1968"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1002/pssb.2221040224",
+    "score": 0.62748235,
+    "normalizedScore": 13,
+    "title": "Vacancy Formation Enthalpy in Cadmium by Positron Lifetime Measurements",
+    "fullCitation": "P. Mascher, L. Breitenhuber, W. Puff, 1981, 'Vacancy Formation Enthalpy in Cadmium by Positron Lifetime Measurements', <i>physica status solidi (b)</i>, vol. 104, no. 2, pp. 601-605",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1002%2Fpssb.2221040224&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Vacancy+Formation+Enthalpy+in+Cadmium+by+Positron+Lifetime+Measurements&amp;rft.jtitle=physica+status+solidi+%28b%29&amp;rft.date=1981&amp;rft.volume=104&amp;rft.issue=2&amp;rft.spage=601&amp;rft.epage=605&amp;rft.aufirst=P.&amp;rft.aulast=Mascher&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=P.+Mascher&amp;rft.au=+L.+Breitenhuber&amp;rft.au=+W.+Puff",
+    "year": "1981"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1016/0375-9601(79)90707-2",
+    "score": 0.62748235,
+    "normalizedScore": 13,
+    "title": "Vacancy formation enthalpy in γ cerium from positron annihilation",
+    "fullCitation": "M. Boidron, R. Paulin, 1979, 'Vacancy formation enthalpy in γ cerium from positron annihilation', <i>Physics Letters A</i>, vol. 73, no. 3, pp. 200-202",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1016%2F0375-9601%2879%2990707-2&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Vacancy+formation+enthalpy+in+%CE%B3+cerium+from+positron+annihilation&amp;rft.jtitle=Physics+Letters+A&amp;rft.date=1979&amp;rft.volume=73&amp;rft.issue=3&amp;rft.spage=200&amp;rft.epage=202&amp;rft.aufirst=M.&amp;rft.aulast=Boidron&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=M.+Boidron&amp;rft.au=+R.+Paulin",
+    "year": "1979"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1016/0036-9748(83)90449-0",
+    "score": 0.62748235,
+    "normalizedScore": 13,
+    "title": "Estimation of the vacancy formation enthalpy of metals",
+    "fullCitation": "Alcides R. Patete, Joachim P. Neumann, 1983, 'Estimation of the vacancy formation enthalpy of metals', <i>Scripta Metallurgica</i>, vol. 17, no. 8, pp. 1047-1048",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1016%2F0036-9748%2883%2990449-0&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Estimation+of+the+vacancy+formation+enthalpy+of+metals&amp;rft.jtitle=Scripta+Metallurgica&amp;rft.date=1983&amp;rft.volume=17&amp;rft.issue=8&amp;rft.spage=1047&amp;rft.epage=1048&amp;rft.aufirst=Alcides+R.&amp;rft.aulast=Patete&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Alcides+R.+Patete&amp;rft.au=+Joachim+P.+Neumann",
+    "year": "1983"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1039/c3ja50034a",
+    "score": 0.62469214,
+    "normalizedScore": 13,
+    "title": "Formation of an oxygen vacancy-dinitrogen complex in nitrogen-doped hafnium oxide",
+    "fullCitation": "Mino Yang, Jee-Hwan Bae, Cheol-Woong Yang, Anass Benayad, Hionsuck Baik, 2013, 'Formation of an oxygen vacancy-dinitrogen complex in nitrogen-doped hafnium oxide', <i>Journal of Analytical Atomic Spectrometry</i>, vol. 28, no. 4, p. 482",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1039%2Fc3ja50034a&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Formation+of+an+oxygen+vacancy-dinitrogen+complex+in+nitrogen-doped+hafnium+oxide&amp;rft.jtitle=Journal+of+Analytical+Atomic+Spectrometry&amp;rft.date=2013&amp;rft.volume=28&amp;rft.issue=4&amp;rft.spage=482&amp;rft.aufirst=Mino&amp;rft.aulast=Yang&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Mino+Yang&amp;rft.au=+Jee-Hwan+Bae&amp;rft.au=+Cheol-Woong+Yang&amp;rft.au=+Anass+Benayad&amp;rft.au=+Hionsuck+Baik",
+    "year": "2013"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1016/0021-9517(81)90023-3",
+    "score": 0.62469214,
+    "normalizedScore": 13,
+    "title": "SCF-SW-X$alpha; calculations of the removal of oxygen from oxide surfaces by vacancy formation and crystallographic shear mechanisms",
+    "fullCitation": "E BROCAWIK, 1981, 'SCF-SW-X$alpha; calculations of the removal of oxygen from oxide surfaces by vacancy formation and crystallographic shear mechanisms', <i>Journal of Catalysis</i>, vol. 72, no. 2, pp. 379-382",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1016%2F0021-9517%2881%2990023-3&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=SCF-SW-X%24alpha%3B+calculations+of+the+removal+of+oxygen+from+oxide+surfaces+by+vacancy+formation+and+crystallographic+shear+mechanisms&amp;rft.jtitle=Journal+of+Catalysis&amp;rft.date=1981&amp;rft.volume=72&amp;rft.issue=2&amp;rft.spage=379&amp;rft.epage=382&amp;rft.aufirst=E&amp;rft.aulast=BROCAWIK&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=E+BROCAWIK",
+    "year": "1981"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1063/1.2335842",
+    "score": 0.62469214,
+    "normalizedScore": 13,
+    "title": "Bulk and surface oxygen vacancy formation and diffusion in single crystals, ultrathin films, and metal grown oxide structures",
+    "fullCitation": "J. Carrasco, N. Lopez, F. Illas, H.-J. Freund, 2006, 'Bulk and surface oxygen vacancy formation and diffusion in single crystals, ultrathin films, and metal grown oxide structures', <i>The Journal of Chemical Physics</i>, vol. 125, no. 7, p. 074711",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1063%2F1.2335842&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Bulk+and+surface+oxygen+vacancy+formation+and+diffusion+in+single+crystals%2C+ultrathin+films%2C+and+metal+grown+oxide+structures&amp;rft.jtitle=The+Journal+of+Chemical+Physics&amp;rft.date=2006&amp;rft.volume=125&amp;rft.issue=7&amp;rft.spage=074711&amp;rft.aufirst=J.&amp;rft.aulast=Carrasco&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=J.+Carrasco&amp;rft.au=+N.+Lopez&amp;rft.au=+F.+Illas&amp;rft.au=+H.-J.+Freund",
+    "year": "2006"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1016/j.ijhydene.2011.12.079",
+    "score": 0.6176822,
+    "normalizedScore": 13,
+    "title": "Oxygen vacancy formation on the Ni/Ce0.75Zr0.25O2(111) surface. A DFT+U study",
+    "fullCitation": "Delfina García Pintos, Alfredo Juan, Beatriz Irigoyen, 2012, 'Oxygen vacancy formation on the Ni/Ce0.75Zr0.25O2(111) surface. A DFT+U study', <i>International Journal of Hydrogen Energy</i>, vol. 37, no. 19, pp. 14937-14944",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1016%2Fj.ijhydene.2011.12.079&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Oxygen+vacancy+formation+on+the+Ni%2FCe0.75Zr0.25O2%28111%29+surface.+A+DFT%2BU+study&amp;rft.jtitle=International+Journal+of+Hydrogen+Energy&amp;rft.date=2012&amp;rft.volume=37&amp;rft.issue=19&amp;rft.spage=14937&amp;rft.epage=14944&amp;rft.aufirst=Delfina&amp;rft.aulast=Garc%C3%ADa+Pintos&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Delfina+Garc%C3%ADa+Pintos&amp;rft.au=+Alfredo+Juan&amp;rft.au=+Beatriz+Irigoyen",
+    "year": "2012"
+  },
+  {
+    "doi": "http://dx.doi.org/10.1103/physrevb.90.144105",
+    "score": 0.6172708,
+    "normalizedScore": 13,
+    "title": "Vacancy formation enthalpy of filled <span class=\"aps-inline-formula\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mi>d</mi></math></span>-band noble metals by hybrid functionals",
+    "fullCitation": "Weiwei Xing, Peitao Liu, Xiyue Cheng, Haiyang Niu, Hui Ma, Dianzhong Li, Yiyi Li, Xing-Qiu Chen, 2014, 'Vacancy formation enthalpy of filled &lt;span class=&quot;aps-inline-formula&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;d&lt;/mi&gt;&lt;/math&gt;&lt;/span&gt;-band noble metals by hybrid functionals', <i>Physical Review B</i>, vol. 90, no. 14",
+    "coins": "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1103%2Fphysrevb.90.144105&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Vacancy+formation+enthalpy+of+filled+%3Cspan+class%3D%22aps-inline-formula%22%3E%3Cmath+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1998%2FMath%2FMathML%22%3E%3Cmi%3Ed%3C%2Fmi%3E%3C%2Fmath%3E%3C%2Fspan%3E-band+noble+metals+by+hybrid+functionals&amp;rft.jtitle=Physical+Review+B&amp;rft.date=2014&amp;rft.volume=90&amp;rft.issue=14&amp;rft.aufirst=Weiwei&amp;rft.aulast=Xing&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Weiwei+Xing&amp;rft.au=+Peitao+Liu&amp;rft.au=+Xiyue+Cheng&amp;rft.au=+Haiyang+Niu&amp;rft.au=+Hui+Ma&amp;rft.au=+Dianzhong+Li&amp;rft.au=+Yiyi+Li&amp;rft.au=+Xing-Qiu+Chen",
+    "year": "2014"
+  }
+]
+#+END_EXAMPLE
+
+
+#+BEGIN_SRC emacs-lisp :var data=json  :results value raw :tangle no
+(let ((json-object-type 'plist)
+      (json (json-read-from-string data)))
+(aref json 0))
+#+END_SRC
+
+#+RESULTS:
+((year . 2014) (coins . ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1039%2Fc3ee43874k&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Oxide+enthalpy+of+formation+and+band+gap+energy+as+accurate+descriptors+of+oxygen+vacancy+formation+energetics&amp;rft.jtitle=Energy+%26+Environmental+Science&amp;rft.date=2014&amp;rft.volume=7&amp;rft.issue=6&amp;rft.spage=1996&amp;rft.aufirst=Ann+M.&amp;rft.aulast=Deml&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Ann+M.+Deml&amp;rft.au=+Vladan+Stevanovi%C4%87&amp;rft.au=+Christopher+L.+Muhich&amp;rft.au=+Charles+B.+Musgrave&amp;rft.au=+Ryan+O%27Hayre) (fullCitation . Ann M. Deml, Vladan Stevanovi\304\207, Christopher L. Muhich, Charles B. Musgrave, Ryan O'Hayre, 2014, 'Oxide enthalpy of formation and band gap energy as accurate descriptors of oxygen vacancy formation energetics', <i>Energy &amp; Environmental Science</i>, vol. 7, no. 6, p. 1996) (title . Oxide enthalpy of formation and band gap energy as accurate descriptors of oxygen vacancy formation energetics) (normalizedScore . 100) (score . 4.7002907) (doi . http://dx.doi.org/10.1039/c3ee43874k))
+
+
+
+Here is a list of helm candidates
+#+BEGIN_SRC emacs-lisp :var data=json :results code :tangle no
+(let (;(json-object-type 'plist)
+      (json (json-read-from-string data)))
+  (mapcar (lambda (x) (cons (assoc 'fullCitation x) x)) json))
+#+END_SRC
+
+#+RESULTS:
+#+BEGIN_SRC emacs-lisp :tangle no
+
+(((fullCitation . "Ann M. Deml, Vladan Stevanovi\304\207, Christopher L. Muhich, Charles B. Musgrave, Ryan O'Hayre, 2014, 'Oxide enthalpy of formation and band gap energy as accurate descriptors of oxygen vacancy formation energetics', <i>Energy &amp; Environmental Science</i>, vol. 7, no. 6, p. 1996")
+  (year . "2014")
+  (coins . "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1039%2Fc3ee43874k&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Oxide+enthalpy+of+formation+and+band+gap+energy+as+accurate+descriptors+of+oxygen+vacancy+formation+energetics&amp;rft.jtitle=Energy+%26+Environmental+Science&amp;rft.date=2014&amp;rft.volume=7&amp;rft.issue=6&amp;rft.spage=1996&amp;rft.aufirst=Ann+M.&amp;rft.aulast=Deml&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Ann+M.+Deml&amp;rft.au=+Vladan+Stevanovi%C4%87&amp;rft.au=+Christopher+L.+Muhich&amp;rft.au=+Charles+B.+Musgrave&amp;rft.au=+Ryan+O%27Hayre")
+  (fullCitation . "Ann M. Deml, Vladan Stevanovi\304\207, Christopher L. Muhich, Charles B. Musgrave, Ryan O'Hayre, 2014, 'Oxide enthalpy of formation and band gap energy as accurate descriptors of oxygen vacancy formation energetics', <i>Energy &amp; Environmental Science</i>, vol. 7, no. 6, p. 1996")
+  (title . "Oxide enthalpy of formation and band gap energy as accurate descriptors of oxygen vacancy formation energetics")
+  (normalizedScore . 100)
+  (score . 4.7002907)
+  (doi . "http://dx.doi.org/10.1039/c3ee43874k"))
+ ((fullCitation . "Altynbek Murat, Julia E. Medvedeva, 2012, 'Composition-dependent oxygen vacancy formation in multicomponent wide-band-gap oxides', <i>Physical Review B</i>, vol. 86, no. 8")
+  (year . "2012")
+  (coins . "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1103%2Fphysrevb.86.085123&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Composition-dependent+oxygen+vacancy+formation+in+multicomponent+wide-band-gap+oxides&amp;rft.jtitle=Physical+Review+B&amp;rft.date=2012&amp;rft.volume=86&amp;rft.issue=8&amp;rft.aufirst=Altynbek&amp;rft.aulast=Murat&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Altynbek+Murat&amp;rft.au=+Julia+E.+Medvedeva")
+  (fullCitation . "Altynbek Murat, Julia E. Medvedeva, 2012, 'Composition-dependent oxygen vacancy formation in multicomponent wide-band-gap oxides', <i>Physical Review B</i>, vol. 86, no. 8")
+  (title . "Composition-dependent oxygen vacancy formation in multicomponent wide-band-gap oxides")
+  (normalizedScore . 24)
+  (score . 1.129964)
+  (doi . "http://dx.doi.org/10.1103/physrevb.86.085123"))
+ ((fullCitation . "Ann M. Deml, Vladan Stevanovi\304\207, Aaron M. Holder, Michael Sanders, Ryan O\342\200\231Hayre, Charles B. Musgrave, 2014, ' Tunable Oxygen Vacancy Formation Energetics in the Complex Perovskite Oxide Sr  x  La  1\342\200\223 x  Mn  y  Al  1\342\200\223 y  O 3 ', <i>Chemistry of Materials</i>, vol. 26, no. 22, pp. 6595-6602")
+  (year . "2014")
+  (coins . "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1021%2Fcm5033755&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=+Tunable+Oxygen+Vacancy+Formation+Energetics+in+the+Complex+Perovskite+Oxide+Sr++x++La++1%E2%80%93+x++Mn++y++Al++1%E2%80%93+y++O+3+&amp;rft.jtitle=Chemistry+of+Materials&amp;rft.date=2014&amp;rft.volume=26&amp;rft.issue=22&amp;rft.spage=6595&amp;rft.epage=6602&amp;rft.aufirst=Ann+M.&amp;rft.aulast=Deml&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Ann+M.+Deml&amp;rft.au=+Vladan+Stevanovi%C4%87&amp;rft.au=+Aaron+M.+Holder&amp;rft.au=+Michael+Sanders&amp;rft.au=+Ryan+O%E2%80%99Hayre&amp;rft.au=+Charles+B.+Musgrave")
+  (fullCitation . "Ann M. Deml, Vladan Stevanovi\304\207, Aaron M. Holder, Michael Sanders, Ryan O\342\200\231Hayre, Charles B. Musgrave, 2014, ' Tunable Oxygen Vacancy Formation Energetics in the Complex Perovskite Oxide Sr  x  La  1\342\200\223 x  Mn  y  Al  1\342\200\223 y  O 3 ', <i>Chemistry of Materials</i>, vol. 26, no. 22, pp. 6595-6602")
+  (title . " Tunable Oxygen Vacancy Formation Energetics in the Complex Perovskite Oxide Sr  x  La  1\342\200\223 x  Mn  y  Al  1\342\200\223 y  O 3 ")
+  (normalizedScore . 20)
+  (score . 0.94063884)
+  (doi . "http://dx.doi.org/10.1021/cm5033755"))
+ ((fullCitation . "Chuck Blue, Khaled Elgaid, Ivan Zitkovsky, P. Boolchand, Darl McDaniel, W. Joiner, Jean Oostens, Warren Huff, 1988, 'Oxygen-vacancy-formation enthalpy in YBa_{2}(Cu_{0.985}Fe_{0.015})_{3}O_{7-\316\264} oxide superconductor', <i>Physical Review B</i>, vol. 37, no. 10, pp. 5905-5908")
+  (year . "1988")
+  (coins . "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1103%2Fphysrevb.37.5905&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Oxygen-vacancy-formation+enthalpy+in+YBa_%7B2%7D%28Cu_%7B0.985%7DFe_%7B0.015%7D%29_%7B3%7DO_%7B7-%CE%B4%7D+oxide+superconductor&amp;rft.jtitle=Physical+Review+B&amp;rft.date=1988&amp;rft.volume=37&amp;rft.issue=10&amp;rft.spage=5905&amp;rft.epage=5908&amp;rft.aufirst=Chuck&amp;rft.aulast=Blue&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Chuck+Blue&amp;rft.au=+Khaled+Elgaid&amp;rft.au=+Ivan+Zitkovsky&amp;rft.au=+P.+Boolchand&amp;rft.au=+Darl+McDaniel&amp;rft.au=+W.+Joiner&amp;rft.au=+Jean+Oostens&amp;rft.au=+Warren+Huff")
+  (fullCitation . "Chuck Blue, Khaled Elgaid, Ivan Zitkovsky, P. Boolchand, Darl McDaniel, W. Joiner, Jean Oostens, Warren Huff, 1988, 'Oxygen-vacancy-formation enthalpy in YBa_{2}(Cu_{0.985}Fe_{0.015})_{3}O_{7-\316\264} oxide superconductor', <i>Physical Review B</i>, vol. 37, no. 10, pp. 5905-5908")
+  (title . "Oxygen-vacancy-formation enthalpy in YBa_{2}(Cu_{0.985}Fe_{0.015})_{3}O_{7-\316\264} oxide superconductor")
+  (normalizedScore . 17)
+  (score . 0.8346345)
+  (doi . "http://dx.doi.org/10.1103/physrevb.37.5905"))
+ ((fullCitation . "H. Holloway, 1962, 'Enthalpy of Formation of Oxygen Vacancies in Barium Oxide', <i>The Journal of Chemical Physics</i>, vol. 36, no. 11, p. 2820")
+  (year . "1962")
+  (coins . "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1063%2F1.1732384&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Enthalpy+of+Formation+of+Oxygen+Vacancies+in+Barium+Oxide&amp;rft.jtitle=The+Journal+of+Chemical+Physics&amp;rft.date=1962&amp;rft.volume=36&amp;rft.issue=11&amp;rft.spage=2820&amp;rft.aufirst=H.&amp;rft.aulast=Holloway&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=H.+Holloway")
+  (fullCitation . "H. Holloway, 1962, 'Enthalpy of Formation of Oxygen Vacancies in Barium Oxide', <i>The Journal of Chemical Physics</i>, vol. 36, no. 11, p. 2820")
+  (title . "Enthalpy of Formation of Oxygen Vacancies in Barium Oxide")
+  (normalizedScore . 16)
+  (score . 0.7613335)
+  (doi . "http://dx.doi.org/10.1063/1.1732384"))
+ ((fullCitation . "St. Chabik, 1987, 'Vacancy formation enthalpy in AgZn alloys', <i>Crystal Research and Technology</i>, vol. 22, no. 12, pp. 1523-1527")
+  (year . "1987")
+  (coins . "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1002%2Fcrat.2170221219&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Vacancy+formation+enthalpy+in+AgZn+alloys&amp;rft.jtitle=Crystal+Research+and+Technology&amp;rft.date=1987&amp;rft.volume=22&amp;rft.issue=12&amp;rft.spage=1523&amp;rft.epage=1527&amp;rft.aufirst=St.&amp;rft.aulast=Chabik&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=St.+Chabik")
+  (fullCitation . "St. Chabik, 1987, 'Vacancy formation enthalpy in AgZn alloys', <i>Crystal Research and Technology</i>, vol. 22, no. 12, pp. 1523-1527")
+  (title . "Vacancy formation enthalpy in AgZn alloys")
+  (normalizedScore . 15)
+  (score . 0.73206276)
+  (doi . "http://dx.doi.org/10.1002/crat.2170221219"))
+ ((fullCitation . "Alan R. Derk, Bo Li, Sudhanshu Sharma, George M. Moore, Eric W. McFarland, Horia Metiu, 2013, 'Methane Oxidation by Lanthanum Oxide Doped with Cu, Zn, Mg, Fe, Nb, Ti, Zr, or Ta: The Connection Between the Activation Energy and the Energy of Oxygen-Vacancy Formation', <i>Catalysis Letters</i>, vol. 143, no. 5, pp. 406-410")
+  (year . "2013")
+  (coins . "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1007%2Fs10562-013-0985-7&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Methane+Oxidation+by+Lanthanum+Oxide+Doped+with+Cu%2C+Zn%2C+Mg%2C+Fe%2C+Nb%2C+Ti%2C+Zr%2C+or+Ta%3A+The+Connection+Between+the+Activation+Energy+and+the+Energy+of+Oxygen-Vacancy+Formation&amp;rft.jtitle=Catalysis+Letters&amp;rft.date=2013&amp;rft.volume=143&amp;rft.issue=5&amp;rft.spage=406&amp;rft.epage=410&amp;rft.aufirst=Alan+R.&amp;rft.aulast=Derk&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Alan+R.+Derk&amp;rft.au=+Bo+Li&amp;rft.au=+Sudhanshu+Sharma&amp;rft.au=+George+M.+Moore&amp;rft.au=+Eric+W.+McFarland&amp;rft.au=+Horia+Metiu")
+  (fullCitation . "Alan R. Derk, Bo Li, Sudhanshu Sharma, George M. Moore, Eric W. McFarland, Horia Metiu, 2013, 'Methane Oxidation by Lanthanum Oxide Doped with Cu, Zn, Mg, Fe, Nb, Ti, Zr, or Ta: The Connection Between the Activation Energy and the Energy of Oxygen-Vacancy Formation', <i>Catalysis Letters</i>, vol. 143, no. 5, pp. 406-410")
+  (title . "Methane Oxidation by Lanthanum Oxide Doped with Cu, Zn, Mg, Fe, Nb, Ti, Zr, or Ta: The Connection Between the Activation Energy and the Energy of Oxygen-Vacancy Formation")
+  (normalizedScore . 14)
+  (score . 0.692246)
+  (doi . "http://dx.doi.org/10.1007/s10562-013-0985-7"))
+ ((fullCitation . "Way Foong Lim, Kuan Yew Cheong, 2014, 'Oxygen vacancy formation and annihilation in lanthanum cerium oxide as a metal reactive oxide on 4H-silicon carbide', <i>Physical Chemistry Chemical Physics</i>, vol. 16, no. 15, p. 7015")
+  (year . "2014")
+  (coins . "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1039%2Fc3cp55214d&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Oxygen+vacancy+formation+and+annihilation+in+lanthanum+cerium+oxide+as+a+metal+reactive+oxide+on+4H-silicon+carbide&amp;rft.jtitle=Physical+Chemistry+Chemical+Physics&amp;rft.date=2014&amp;rft.volume=16&amp;rft.issue=15&amp;rft.spage=7015&amp;rft.aufirst=Way+Foong&amp;rft.aulast=Lim&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Way+Foong+Lim&amp;rft.au=+Kuan+Yew+Cheong")
+  (fullCitation . "Way Foong Lim, Kuan Yew Cheong, 2014, 'Oxygen vacancy formation and annihilation in lanthanum cerium oxide as a metal reactive oxide on 4H-silicon carbide', <i>Physical Chemistry Chemical Physics</i>, vol. 16, no. 15, p. 7015")
+  (title . "Oxygen vacancy formation and annihilation in lanthanum cerium oxide as a metal reactive oxide on 4H-silicon carbide")
+  (normalizedScore . 14)
+  (score . 0.6675249)
+  (doi . "http://dx.doi.org/10.1039/c3cp55214d"))
+ ((fullCitation . "Lena Mazeina, Suraj Deore, Alexandra Navrotsky, 2006, 'Energetics of Bulk and Nano-Akaganeite, \316\262-FeOOH:\302\240 Enthalpy of Formation, Surface Enthalpy, and Enthalpy of Water Adsorption', <i>Chemistry of Materials</i>, vol. 18, no. 7, pp. 1830-1838")
+  (year . "2006")
+  (coins . "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1021%2Fcm052543j&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Energetics+of+Bulk+and+Nano-Akaganeite%2C+%CE%B2-FeOOH%3A%C2%A0+Enthalpy+of+Formation%2C+Surface+Enthalpy%2C+and+Enthalpy+of+Water+Adsorption&amp;rft.jtitle=Chemistry+of+Materials&amp;rft.date=2006&amp;rft.volume=18&amp;rft.issue=7&amp;rft.spage=1830&amp;rft.epage=1838&amp;rft.aufirst=Lena&amp;rft.aulast=Mazeina&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=Lena+Mazeina&amp;rft.au=+Suraj+Deore&amp;rft.au=+Alexandra+Navrotsky")
+  (fullCitation . "Lena Mazeina, Suraj Deore, Alexandra Navrotsky, 2006, 'Energetics of Bulk and Nano-Akaganeite, \316\262-FeOOH:\302\240 Enthalpy of Formation, Surface Enthalpy, and Enthalpy of Water Adsorption', <i>Chemistry of Materials</i>, vol. 18, no. 7, pp. 1830-1838")
+  (title . "Energetics of Bulk and Nano-Akaganeite, \316\262-FeOOH:\302\240 Enthalpy of Formation, Surface Enthalpy, and Enthalpy of Water Adsorption")
+  (normalizedScore . 13)
+  (score . 0.6519111)
+  (doi . "http://dx.doi.org/10.1021/cm052543j"))
+ ((fullCitation . "P. A. G. O'Hare, 1972, 'Thermochemical and Theoretical Investigations of the Sodium-Oxygen System. I. The Standard Enthalpy of Formation of Sodium Oxide (Na2O)', <i>The Journal of Chemical Physics</i>, vol. 56, no. 9, p. 4513")
+  (year . "1972")
+  (coins . "ctx_ver=Z39.88-2004&amp;rft_id=info%3Adoi%2Fhttp%3A%2F%2Fdx.doi.org%2F10.1063%2F1.1677897&amp;rfr_id=info%3Asid%2Fcrossref.org%3Asearch&amp;rft.atitle=Thermochemical+and+Theoretical+Investigations+of+the+Sodium-Oxygen+System.+I.+The+Standard+Enthalpy+of+Formation+of+Sodium+Oxide+%28Na2O%29&amp;rft.jtitle=The+Journal+of+Chemical+Physics&amp;rft.date=1972&amp;rft.volume=56&amp;rft.issue=9&amp;rft.spage=4513&amp;rft.aufirst=P.+A.+G.&amp;rft.aulast=O%27Hare&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.au=P.+A.+G.+O%27Hare")
+  (fullCitation . "P. A. G. O'Hare, 1972, 'Thermochemical and Theoretical Investigations of the Sodium-Oxygen System. I. The Standard Enthalpy of Formation of Sodium Oxide (Na2O)', <i>The Journal of Chemical Physics</i>, vol. 56, no. 9, p. 4513")
+  (title . "Thermochemical and Theoretical Investigations of the Sodium-Oxygen System. I. The Standard Enthalpy of Formation of Sodium Oxide (Na2O)")
+  (normalizedScore . 13)
+  (score . 0.6344446)
+  (doi . "http://dx.doi.org/10.1063/1.1677897"))
+ ...)
+#+END_SRC
+
+
+* ISBN utility
+These are not really doi utilities, but for now I am putting them here.
+
+I found this on the web. It can be handy, but the bibtex entry has a lot of stuff in it.
+
+#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
+(defun isbn-to-bibtex-lead (isbn)
+ "Search lead.to for ISBN bibtex entry. You have to copy the entry if it is on the page to your bibtex file."
+ (interactive "sISBN: ")
+(browse-url
+(format "http://lead.to/amazon/en/?key=%s+&si=all&op=bt&bn=&so=sa&ht=us" isbn)))
+#+END_SRC
+
+Here we get isbn metadata and build a bibtex entry.
+http://xisbn.worldcat.org/xisbnadmin/doc/api.htm#getmetadata
+
+
+#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
+(defun isbn-to-bibtex (isbn bibfile)
+  "Get bibtex entry for ISBN and insert it into BIBFILE unless an
+entry with the generated key already exists in the file."
+  (interactive
+   (list
+    (read-input
+     "ISBN: "
+     ;; now set initial input
+     (cond
+      ;; If region is active and it starts with a number, we use it
+      ((and  (region-active-p)
+            (s-match "^[0-9]" (buffer-substring (region-beginning) (region-end))))
+       (buffer-substring (region-beginning) (region-end)))
+      ;; if first entry in kill ring starts with a number assume it is an isbn
+      ;; and use it as the guess
+      ((if (s-match "^[0-9]" (car kill-ring))
+          (car kill-ring)))
+      ;; type or paste it in
+      (t
+       nil)))
+    (ido-completing-read
+     "Bibfile: "
+     (append (f-entries "." (lambda (f) (f-ext? f "bib")))
+            org-ref-default-bibliography))))
+
+  (let* ((results (with-current-buffer
+                     (url-retrieve-synchronously
+                      (format
+                       "http://xisbn.worldcat.org/webservices/xid/isbn/%s?method=getMetadata&format=json&fl=*"
+                       isbn))
+                   (json-read-from-string
+                    (buffer-substring url-http-end-of-headers (point-max)))))
+        (status (cdr (nth 1 results)))
+        (metadata (aref (cdar results) 0))
+        (new-entry)
+        (new-key))
+
+    ;; check if we got something
+    (unless (string= "ok" status)
+      (error "Status is %s" status))
+
+    ;; construct an alphabetically sorted bibtex entry. I assume ISBN numbers go
+    ;; with book entries.
+    (setq new-entry
+         (concat "\n@book{,\n"
+                 (mapconcat
+                  'identity
+                  (loop for field in (-sort 'string-lessp (mapcar 'car metadata))
+                        collect
+                        (format "  %s={%s}," field (cdr (assoc field metadata))))
+                  "\n")
+                 "\n}\n"))
+
+    ;; build entry in temp buffer to get the key so we can check for duplicates
+    (setq new-entry (with-temp-buffer
+                     (insert new-entry)
+                     (org-ref-clean-bibtex-entry)
+                     (setq new-key (bibtex-key-in-head))
+                     (buffer-string)))
+    (find-file bibfile)
+    (goto-char (point-min))
+    (when (search-forward new-key nil t)
+      (beep)
+      (setq new-key (read-input
+                    (format  "%s already exists. Enter new key (C-g to cancel): " new-key)
+                    new-key)))
+    (goto-char (point-max))
+    (insert new-entry)
+    ;; set key. It is simplest to just replace it, even if it is the same.
+    (bibtex-beginning-of-entry)
+    (re-search-forward bibtex-entry-maybe-empty-head)
+    (if (match-beginning bibtex-key-in-head)
+       (delete-region (match-beginning bibtex-key-in-head)
+                      (match-end bibtex-key-in-head)))
+    (insert new-key)
+    (bibtex-fill-entry)
+    (save-buffer)))
+#+END_SRC
+
+
 
 * end of file
 #+BEGIN_SRC emacs-lisp :tangle doi-utils.el
@@ -814,4 +1475,3 @@ doi:10.1021/jp047349j
 
 #+RESULTS:
 : Loaded doi-utils.el
-