citation-resolve-0.2.4: convert document IDs such as DOI, ISBN, arXiv ID to bibliographic reference.

Safe HaskellNone

Text.CSL.Input.Identifier

Description

This modules provides a way to convert document identifiers, such as DOIs, ISBNs, arXiv IDs to bibliographic references.

Each type of identifiers will be converted via internet services to a bibliographic record of type Reference , which in turn can be rendered in various format using citeproc-hs package hackage.haskell.org/package/citeproc-hs .

Moreover, the server responses are cached in a local database, making the server load as little as possible.

Synopsis

Documentation

type EReference = Either String ReferenceSource

EReference is the type returned by the Reference resolver, accompanied with possible error message.

readID :: Resolver ReferenceSource

Multi-purpose reference ID resolver. Resolve String starting with arXiv:, isbn:, doi: to Reference .

>>> (==) <$> readArXiv "1204.4779" <*>  readID "arXiv:1204.4779"
True
>>> (==) <$> readDOI "10.1088/1749-4699/5/1/015003" <*> readID "doi:10.1088/1749-4699/5/1/015003"
True
>>> (==) <$> readISBN "9780199233212" <*> readID "isbn:9780199233212"
True

readDOI :: Resolver ReferenceSource

resolve a DOI to a Reference.

>>> ref <- forceEither <$> readDOI "10.1088/1749-4699/5/1/015003"
>>> title ref
"Paraiso: an automated tuning framework for explicit solvers of partial differential equations"
>>> putStrLn $ url ref
http://dx.doi.org/10.1088/1749-4699/5/1/015003

readArXiv :: Resolver ReferenceSource

resolve an arXiv ID to a Reference. If it's a referred journal paper, it can also resolve the refereed version of the paper.

>>> ref <- forceEither <$> readArXiv "1204.4779"
>>> title ref
"Paraiso: an automated tuning framework for explicit solvers of partial differential equations"
>>> containerTitle ref
"Computational Science and Discovery"

readBibcode :: Resolver ReferenceSource

resolve an Bibcode ID to a Reference.

>>> ref <- forceEither <$> readBibcode " 2012CS&D....5a5003M"
>>> title ref
"Paraiso: an automated tuning framework for explicit solvers of partial differential equations"
>>> containerTitle ref
"Computational Science and Discovery"

readISBN :: Resolver ReferenceSource

resolve an ISBN to a Reference.

>>> ref <- forceEither <$> readISBN "9780199233212"
>>> title ref
"The nature of computation"