Citoid

cite-from-id is a node.js service which converts unique identifiers, such as a URL, to citations for use by RefToolbar and VisualEditor.

Installation
In order to have cite-from-id functioning on your wiki in conjunction with VisualEditor, you'll need the following: a working installation of VisualEditor and Parsoid, citation templates and a special json hook in order to hook VisualEditor and the templates together, and a working installation of Zotero's translation server.

At minimum, it is recommend you have the following extensions in your extension folder: Extension:VisualEditor, Extension:Parsoid, Extension:Scribunto, Extension:ParserFunctions

For developers, at the time being cite-from-id is not supported by the vagrant development environment.

VisualEditor and Parsoid

 * 1) Set up MediaWiki. Currently an apache server based installation is recommended both for development and production: Manual:Installation_guide
 * 2) Set up Parsoid: Parsoid/Setup
 * 3) Set up VisualEditor: Extension:VisualEditor

Importing citation templates
You'll need citation templates in your wiki's database in order to use any citation features. If you do not currently have citation templates on your wiki (for example, in the case of a new installation) you'll need to get them. Copying them from Wikipedia is the easiest way to do this. If you already have citation templates on your wiki, you can skip these steps.


 * 1) Install Extension:Scribunto and Extension:ParserFunctions. Scribunto allows you to use the programming language lua in your citation templates, and most citation templates on Wikipedia are in lua and make use of the Parser Functions.
 * 2) Export citation templates from wikipedia: Manual:Using_content_from_Wikipedia. Exporting Template:Cite_web, Template:Cite_news, Template:Cite_journal, Template:Cite_book is a good place to start.
 * 3) Upload your templates using the Special:Import page on your wiki (for example, http://localhost/index.php/Special:Import)

Register your templates
See: VisualEditor/Citation_tool

Zotero's translation server
See: Translation-server installation instructions

Implementation
The cite-from-id module will be a node.js service. A rough description of how the service would work is as follows:


 * 1) [client js] VisualEditor makes query for reference
 * 2) [node js] CiteURLEngine considers cache and either responds with the previously stored result or…
 * 3) [first or third party?] Query against DOI/ISBN/ISSN/etc. sources and return citation.

Potential use of DOI as internal resource identifier
URL -> attempt conversion to DOI

Conversion: DOI - URL key/value pair may be cached/db, from external resource, or page scraped to look for one

Key:DOI -> Citations. Lookup in cache/db, in external source(crossref) or generate on fly (or some combination if ISSN is available)

Conversion to DOI fails: generate citation, try to locate DOI from citation? (cross ref?)

If fails, generate new DOI to point to resource? Runs risk of duplicating DOIs. But if no DOI is available, there will be no internal identifier.

What about online journal/physical journal or newspaper relationship? same article may have digital citation and non-digital citation- Separate entries for each?

Related extensions and services

 * Zotero translation server -- xpcshell-based Zotero translation server, and https://github.com/zotero/zotero-node, an abandoned and old nodejs equivalent
 * Zotero field mappings, including vs. some cite templates
 * Wikipedia citation templates
 * VisualEditor/Citation_tool
 * Sample cite-tool definition on Wikipedia Beta
 * Restface (node.js restful api)