WikidataPain

Main class

Classes

DataValue

Reference

Snak

Statement

Util

Members

static Precision :number

static PrecisionComparison :string

static Rank :string

BATCH_ALERT_ON_FINISHED :boolean

Wether to display an alert once a batch has finished.

ENDPOINT :string

API-endpoint used for API calls.

MAXLAG :number

Maxlag used when making API calls.

NOTIFICATIONS_PROGRESS :boolean|number

Display a notification after every `n`-th finished action. Set to `false` to disable.

readonly ReferenceMode :string

readonly StatementEditMode :string

Methods

static adhoc(commands, probe) → {Promise.<void>}

Parameters:
Name Type Description
commands Object | string
probe number
Returns:
Promise.<void>

static adhocCommand(command) → {Promise.<void>}

Executes a single adhoc-command.
Parameters:
Name Type Description
command Object
Returns:
Promise.<void>

static adhocPreprocess(command) → {Promise.<Object>}

Parameters:
Name Type Description
command AdhocCommand
Returns:
Promise.<Object>

static batch(claims, action, configopt) → {Promise.<void>}

Parameters:
Name Type Attributes Description
claims Array.<T>
action function
config Config <optional>
Returns:
Promise.<void>

static batchRequestStop()

Stops all running batches after they've finished their currently running task.

static dissectTimestamp(date) → {DissectedTime}

Parameters:
Name Type Description
date string
Returns:
DissectedTime

static formatDates(input) → {string}

Try to format a English/German date with day-precision as a QuickStatement date.
Parameters:
Name Type Description
input string
Returns:
string

static getClaimsByEntity(entity, propertyopt) → {Promise.<Object>}

Parameters:
Name Type Attributes Default Description
entity string Wikidata Q-ID.
property string <optional>
null Wikidata P-ID.
Returns:
Promise.<Object>
Deprecated:
  • Yes

static normalizeClaimId(claimId) → {string}

Normalises claim IDs as returned by WDQS.
Parameters:
Name Type Description
claimId string
Returns:
string

static queryCsrfToken() → {Promise.<string>}

Returns:
Promise.<string> - CSRF-token.

static replaceMainSnak(claimId, newValue, oldValueopt, summaryopt) → {Promise.<void>}

Parameters:
Name Type Attributes Description
claimId string Wikidata claim-ID.
newValue string Wikidata Q-ID of the value to use as new mainsnak.
oldValue string <optional>
Wikidata Q-ID to replace. If not set any value will be replaced.
summary string <optional>
Returns:
Promise.<void>
Deprecated:
  • Yes