User:PerfektesChaos/js/citoidWikitext/opus

Software issues related to citoidWikitext: The opus postprocessing interface.

Rationale
When a Zotero result arrives, it may be less precise than desired.

Some modifications for certain sources might be appropriate, e.g. distinctions for particular publications based upon URL or details of received data.

Ideally this would have been done upstream already, but for the time being this gives a quick capability to improve the Zotero result set.

Installation
Gadget programmers need to wait for correct installation of this script before any function can be used. This requires two steps, loading and executing. Loading again would not be meaningful if already done. Therefore the state of this script is checked first. Another gadget which also uses this script library might have loaded already.

When loading of all components has been completed, the  hook will be fired.

Here is  a callback function with the actual functionality of the user application.

may use one parameter. That is the application object for the library. It is supposed to be mapped into  also.

API
The  object gained by callback function exposes the following function (among others).

.opus.fire
Transform and merge multiple citoid results. Improvement means: Merging means that the same query (“what book is this?”) may be launched to several libraries. Their answers might differ or fail completely. Partial answers from one library may fill gaps in the answer of another one.
 * completion by guessing missing fields
 * standardization and interpretation of values
 * normalization of encoding
 * formatting of values (dates, languages etc.)
 * additional knowledge about some publications

The result ensures entries for all compontents of the minimum data model.