(c) 2014 PLOS Labs
Process input data and convert to Rich Citations JSON
Add this line to your application's Gemfile:
gem 'rich_citations_processor'
A source (text document is passed through a series of steps:
-
Parsing: The document is parsed from its source format (For example an XML document conforming to a JATS/NLM DTD) and turned into a set of internal object representations that closely match the Rich Citations JSON structure. If you want to support a new import format then you probably just want to write a new parser.
-
Identifier Resolving: Each reference is analyzed to determine a set of candidate URIs that it could resolve to.
-
Metadata Retrieval: Based on the candidate URIs a set of services is called to retrieve additional bibliographic metadata for each reference. This metadata conforms to the citeproc+json standard but can include additional metadata as needed such as licensing and abstracts.
-
Additionally results are cached for a URI to speed up prcoessing.
Sample code would be something along the lines of:
jats_xml = get_jats_or_nlm_document_from_some_service
parser = RichCitationsProcessor::Parsers::JATS.new(jats_xml)
-- or by mime type ---
parser = RichCitationsProcessor::Parsers.create('application/jats+xml', jats_xml)
paper = parser.parse!
serializer = RichCitationsProcessor::Serializers::JSON.new(paper)
-- or by mime type ---
serializer = RichCitationsProcessor::Serializers.create('application/richcitations+json', paper)
output = serializer.serialize
TODO: Write better usage instructions here
- Fork it ( http://github.com//rich_citations_processor/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request