Giter Club home page Giter Club logo

plugin-quickstatements's Introduction

Citation.js QuickStatements plugin

This npm package is a plugin to citation.js (see this article) that outputs bibliographic information to Wikidata QuickStatements. Some important points:

  1. it does not (currently) check if the information is already in Wikidata
  2. it only supports journals articles (at this moment)

Install

npm install @citation-js/plugin-quickstatements

To run the below example, you also need to install a few other packages (as they are currently not automatically pulled in, it seems):

npm install @citation-js/core @citation-js/plugin-pubmed @citation-js/plugin-doi @babel/register @babel/core

Use

Install the plugin by require-ing it:

require('@citation-js/plugin-quickstatements')

Formats

Formats and other features added by this plugin.

Input

The input is CSL generated by citation.js by any of its supported formats. Here's an example for how to create QuickStatements for a PubMed Central identifier:

c = require('@citation-js/core')
require('@citation-js/plugin-pubmed')
require('@citation-js/plugin-doi')

require('@babel/register')
require('@citation-js/plugin-quickstatements')

c.Cite.async([
  '10.1186/s13321-019-0380-5',
  'pmid:14266813',
  'PMC6613236'
])
  .then(Cite =>
    console.log(Cite.format('quickstatements'))
  )
  .catch(console.error)

Or for book ISBN numbers:

const c = require('@citation-js/core')
require('@citation-js/plugin-isbn')

require('@babel/register')
require('@citation-js/plugin-quickstatements')

c.Cite.async([
  '978-0956775016'
])
  .then(Cite =>
    console.log(Cite.format('quickstatements'))
  )
  .catch(console.error)

Output

The output is QuickStatements to be copied into the online webservice. The output looks like:

	CREATE

	LAST	P31	Q13442814
	LAST	Len	"Journal of Cheminformatics, ORCID, and GitHub"
	LAST	P304	"44"
	LAST	P356	"10.1186/s13321-019-0365-4"
	LAST	P433	"1"
	LAST	P478	"11"
	LAST	P698	"31281945"
	LAST	P932	"PMC6613236"
	LAST	P1476	"Journal of Cheminformatics, ORCID, and GitHub"
	LAST	P577	"2019-07-08"
	LAST	P2093	"Egon Willighagen"	P1545	"1"	
	LAST	P2093	"Nina Jeliazkova"	P1545	"2"	
	LAST	P2093	"Rajarshi Guha"	P1545	"3"

plugin-quickstatements's People

Contributors

egonw avatar larsgw avatar sweco-nlkbaa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.