WikidataPain

WikidataPain

Main class

Classes

DataValue
Reference
Snak
Statement
Util

Members

# (static) Precision :number

Type:
  • number

# (static) PrecisionComparison :string

Type:
  • string

# (static) Rank :string

Type:
  • string

# ComparisonMethod :WikidataPain.ComparisonMethod

Type:
  • WikidataPain.ComparisonMethod

# ENDPOINT :string

API-endpoint used for API calls.
Type:
  • string

# MAXLAG :number

Maxlag used when making API calls.
Type:
  • number

# NOTIFICATIONS_PROGRESS :boolean|number

Display a notification after every `n`-th finished action. Set to `false` to disable.
Type:
  • boolean | number

# QualifierMatcherFactory :function

Type:
  • function

# ReferenceMatchingCriterium :WikidataPain.ReferenceMatchingCriterium

Type:
  • WikidataPain.ReferenceMatchingCriterium

Methods

# (async, static) adhoc(commandsopt, probeopt) → {Promise.<void>}

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

# (static) batch(claims, action, probeopt, non-null, configopt) → {BatchResponse}

Parameters:
Name Type Attributes Default Description
claims Array.<T>
action function
probe number <optional>
null Number of actions after each a notification is displayed allowing to prematurely cancel the batch.
config Object <optional>
Properties
Name Type Attributes Description
notificationProgress boolean | number <optional>
= Display a notification after every `n`-th finished action. Set to `false` to disable. Set to `null` to use global value.
Returns:
Type
BatchResponse

# (static) batchRequestStop()

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

# (async, static) createQuickStatements(commandBlock, configopt) → {Promise.<Object>}

Adds statements using QuickStatements.
Parameters:
Name Type Attributes Description
commandBlock string
config Object <optional>
Properties
Name Type Attributes Description
editgroup string <optional>
probe number <optional>
summary string <optional>
Returns:
Type
Promise.<Object>

# (async, static) get(requestBody) → {Promise.<Object>}

Makes a generic GET-request to the Wikidata-MediaWiki-Actions-API.
Parameters:
Name Type Description
requestBody Object
Returns:
Type
Promise.<Object>

# (static) interceptorToggle()

Toggles the interceptor.

# (async, static) post(requestBody) → {Promise.<Object>}

Makes a generic POST-request to the Wikidata-MediaWiki-Actions-API.
Parameters:
Name Type Description
requestBody Object
Returns:
Type
Promise.<Object>

# (async, static) postCsrf(requestBody) → {Promise.<Object>}

Makes a generic POST-request with a CSRF-token to the Wikidata-MediaWiki-Actions-API.
Parameters:
Name Type Description
requestBody Object
Returns:
Type
Promise.<Object>

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

Requests a CSRF-token from the Wikidata-API.
Returns:
CSRF-token.
Type
Promise.<string>

# (async, static) rankByReasonInstant(entitynon-null, propertynon-null, configopt) → {Promise.<Array.<WikidataPain.Statement>>}

Parameters:
Name Type Attributes Description
entity string
property string
config Object <optional>
Properties
Name Type Attributes Default Description
editgroup string <optional>
null
summary string <optional>
null
Returns:
Other statements sharing the same property that have been edited.
Type
Promise.<Array.<WikidataPain.Statement>>

# (async, static) refineQuickStatements(commandBlock, allowCreateopt, configopt) → {Promise.<Object>}

Adds statements using QuickStatements.
Parameters:
Name Type Attributes Default Description
commandBlock string
allowCreate boolean <optional>
false
config Object <optional>
Properties
Name Type Attributes Default Description
editgroup string <optional>
probe number <optional>
qualifierComparisonMethod WikidataPain.ComparisonMethod <optional>
qualifierMatcher QualifierMatcher <optional>
referenceRefinableCriterium WikidataPain.ReferenceMatchingCriterium <optional>
WikidataPain.ReferenceMatchingCriterium.overlap
summary string <optional>
Returns:
Type
Promise.<Object>

# (async, static) refineRsolver(commandBlockopt, allowCreateopt, configopt) → {Promise.<void>}

Parameters:
Name Type Attributes Default Description
commandBlock string <optional>
null
allowCreate boolean <optional>
false
config Object <optional>
Properties
Name Type Attributes Description
confirmBefore boolean <optional>
editgroup string <optional>
probe number <optional>
qualifierComparisonMethod WikidataPain.ComparisonMethod <optional>
qualifierMatcher QualifierMatcher <optional>
referenceRefinableCriterium WikidataPain.ReferenceMatchingCriterium <optional>
Returns:
Type
Promise.<void>

# (static) rsolver(commandBlockopt) → {Promise.<string>}

Resolves a command block as string using Rsolver.
Parameters:
Name Type Attributes Default Description
commandBlock string <optional>
null
Returns:
Type
Promise.<string>

# (async, static) taskWorker(action) → {Promise.<void>}

Maintains a shared queue for all tasks registered using this method.
Parameters:
Name Type Description
action function
Returns:
Type
Promise.<void>

# (async, static) wdqs(query, transformopt) → {Promise.<Array.<Object>>}

Requests data from Wikidata Query Service.
Parameters:
Name Type Attributes Default Description
query string
transform boolean <optional>
false
Returns:
Type
Promise.<Array.<Object>>

# (async, static) wdqsTransformBinding(binding) → {Promise.<any>}

Transforms a single WDQS binding to a corresponding WikidataPain representation.
Parameters:
Name Type Description
binding Object
Returns:
Type
Promise.<any>