Parameters:
Name |
Type |
Description |
id |
string
|
|
loaded |
boolean
|
|
isNew |
boolean
|
|
Members
#
id :string
#
qualifiers :Object.<string, Array.<WikidataPain.Snak>>
#
qualifiersOrder :Array.<string>
#
rank :string
#
type :string
Methods
#
(static) collapseApiDictionary(dictionary) → {Array.<WikidataPain.Statement>}
Collapses a dictionary of properties and statements to a simple list of statements.
#
(static) filterCollapsed(claims, predicate) → {Promise.<Array.<WikidataPain.Statement>>}
#
(async, static) filterStatementsByMainsnak(claimsToFilter, snak) → {Promise.<Array.<WikidataPain.Statement>>}
#
(async, static) filterStatementsByQualifier(claimsToFilter, qualifier) → {Promise.<Array.<WikidataPain.Statement>>}
#
(async, static) filterStatementsByRefinable(claimsToFilter, whole, configopt) → {Promise.<Array.<WikidataPain.Statement>>}
#
(static) fromBlank(entity, mainsnak, rankopt) → {WikidataPain.Statement}
Parameters:
Name |
Type |
Description |
claimId |
string
|
Wikidata Claim-ID. |
#
(async, static) fromEntity(entity, propertyopt, loadReferencesopt) → {Promise.<Object.<string, Array.<WikidataPain.Statement>>>}
Parameters:
Name |
Type |
Attributes |
Default |
Description |
entity |
string
|
|
|
Wikidata Q-ID. |
property |
string
|
<optional>
|
null
|
Wikidata P-ID. |
loadReferences |
boolean
|
<optional>
|
false
|
Whether to load references. |
#
(async, static) fromEntityCollapsed(entity, property, loadReferencesopt) → {Promise.<Array.<WikidataPain.Statement>>}
Parameters:
Name |
Type |
Attributes |
Default |
Description |
entity |
string
|
|
|
Wikidata Q-ID. |
property |
string
|
|
|
Wikidata P-ID. |
loadReferences |
boolean
|
<optional>
|
false
|
Whether to load references. |
#
(static) fromRaw(raw, referencesLoadedopt) → {WikidataPain.Statement}
Parameters:
Name |
Type |
Attributes |
Default |
Description |
raw |
Object
|
|
|
|
referencesLoaded |
boolean
|
<optional>
|
false
|
Set references as loaded. |
Parameters:
Name |
Type |
Description |
entity |
string
|
|
raw |
Object
|
|
Parameters:
Name |
Type |
Description |
sparql |
Object
|
|
#
(async) addReference(reference) → {Promise.<void>}
Returns:
-
Type
-
Promise.<void>
#
(async) addReferenceInstant(reference, optionsopt, nullable) → {Promise.<void>}
Is committed instantly and may not be chained.
Returns:
-
Type
-
Promise.<void>
#
(async) commit(config) → {Promise.<Object>}
Parameters:
Name |
Type |
Description |
config |
Object
|
Properties
Name |
Type |
Attributes |
Description |
editgroup |
string
|
<optional>
|
|
summary |
string
|
<optional>
|
|
|
Returns:
-
Type
-
Promise.<Object>
#
(async) deleteInstant(optionsopt, nullable) → {Promise.<void>}
Deletes the statement using `wbremoveclaims`.
Is committed instantly and may not be chained.
Parameters:
Name |
Type |
Attributes |
Description |
options |
Object
|
<optional>
<nullable>
|
|
Returns:
-
Type
-
Promise.<void>
Parameters:
Name |
Type |
Description |
raw |
Object
|
|
#
(async) filterAnd(predicates) → {Promise.<boolean>}
Returns:
-
Type
-
Promise.<boolean>
#
(async) filterByMainsnakDataValue(predicate) → {Promise.<boolean>}
Parameters:
Name |
Type |
Description |
predicate |
function
|
|
Returns:
-
Type
-
Promise.<boolean>
#
(async) filterByNoQualifierSnaks(property) → {Promise.<boolean>}
Parameters:
Name |
Type |
Description |
property |
string
|
|
Returns:
-
Type
-
Promise.<boolean>
#
(async) filterByQualifier(property, predicate) → {Promise.<boolean>}
Parameters:
Name |
Type |
Description |
property |
string
|
|
predicate |
function
|
|
Returns:
-
Type
-
Promise.<boolean>
#
(async) filterByQualifiers(predicate) → {Promise.<boolean>}
Parameters:
Name |
Type |
Description |
predicate |
function
|
|
Returns:
-
Type
-
Promise.<boolean>
#
(async) filterOr(predicates) → {Promise.<boolean>}
Returns:
-
Type
-
Promise.<boolean>
#
(async) findPotentiallyRefinable(configopt) → {Promise.<Array.<WikidataPain.Statement>>}
Parameters:
Name |
Type |
Attributes |
Description |
config |
Object
|
<optional>
|
Properties
|
#
getEntity() → {string}
#
(async) getMainsnak() → {Promise.<WikidataPain.Snak>}
#
(async) getObject(requestReferencesopt) → {Promise.<Object>}
Parameters:
Name |
Type |
Attributes |
Default |
Description |
requestReferences |
boolean
|
<optional>
|
true
|
Whether to load references |
Returns:
-
Type
-
Promise.<Object>
#
(async) getQualifiers() → {Promise.<Object.<string, Array.<WikidataPain.Snak>>>}
#
(async) getQualifierSnaks(property) → {Promise.<Array.<WikidataPain.Snak>>}
Parameters:
Name |
Type |
Description |
property |
string
|
|
#
(async) getReferences() → {Promise.<Array.<WikidataPain.Reference>>}
#
(async) load(requestReferencesopt) → {Promise.<void>}
Explicitly loads the statement.
Typically, this method doesn't need to be called, but can be used to improve the efficiency of scripts.
Parameters:
Name |
Type |
Attributes |
Default |
Description |
requestReferences |
boolean
|
<optional>
|
false
|
|
Returns:
-
Type
-
Promise.<void>
#
(async) mergeFrom(other, configopt) → {Promise.<boolean>}
Parameters:
Name |
Type |
Attributes |
Description |
other |
WikidataPain.Statement
|
|
|
config |
Object
|
<optional>
|
Properties
Name |
Type |
Attributes |
Default |
Description |
referenceRefinableCriterium |
WikidataPain.ReferenceMatchingCriterium
|
<optional>
|
WikidataPain.ReferenceMatchingCriterium.overlap
|
|
|
Returns:
Whether a change occured.
-
Type
-
Promise.<boolean>
#
(async) mergeQualifierSnak(qualifier, newSnak) → {Promise.<boolean>}
Returns:
Whether a change occured.
-
Type
-
Promise.<boolean>
#
(async) mergeReference(newReference, configopt) → {Promise.<boolean>}
Parameters:
Name |
Type |
Attributes |
Description |
newReference |
WikidataPain.Reference
|
|
|
config |
Object
|
<optional>
|
Properties
Name |
Type |
Attributes |
Default |
Description |
referenceRefinableCriterium |
WikidataPain.ReferenceMatchingCriterium
|
<optional>
|
WikidataPain.ReferenceMatchingCriterium.overlap
|
|
|
Returns:
Whether changes occured.
-
Type
-
Promise.<boolean>
#
(async) moveToPropertyInstant(targetProperty, valueTransformeropt, nullable, configopt) → {Promise.<void>}
Creates a new statement with a different property based on this one and deletes this statement.
Is committed instantly and may not be chained.
Parameters:
Name |
Type |
Attributes |
Default |
Description |
targetProperty |
string
|
|
|
New property to move the claim to. |
valueTransformer |
ValueTransformer
|
<optional>
<nullable>
|
null
|
Function to apply to the claim's value which's result will be used as value for the newly created statement's claim. |
config |
Object
|
<optional>
|
|
Properties
Name |
Type |
Attributes |
Default |
Description |
editgroup |
string
|
<optional>
|
null
|
|
summary |
string
|
<optional>
|
null
|
|
|
Returns:
-
Type
-
Promise.<void>
#
(async) preferOnlyInstant(removeReasonForPreferredopt, configopt) → {Promise.<Array.<WikidataPain.Statement>>}
Parameters:
Name |
Type |
Attributes |
Default |
Description |
removeReasonForPreferred |
boolean
|
<optional>
|
false
|
|
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) qualifierAddOrRefine(newQualifier, configopt) → {Promise.<void>}
Parameters:
Name |
Type |
Attributes |
Description |
newQualifier |
WikidataPain.Snak
|
|
|
config |
Object
|
<optional>
|
Properties
Name |
Type |
Attributes |
Description |
onAdditionalQualifierValues |
'delete'
|
'fail'
|
<optional>
|
|
|
Returns:
-
Type
-
Promise.<void>
#
(async) qualifierAppend(snak) → {Promise.<void>}
Returns:
-
Type
-
Promise.<void>
#
(async) qualifierRemove(propertyOrSnak, snak) → {Promise.<number>}
Parameters:
Name |
Type |
Default |
Description |
propertyOrSnak |
string
|
|
(1) Name or the qualifier's property to remove. (2) Snak to remove. |
snak |
WikidataPain.Snak
|
null
|
(1) Snak of the qualifier to remove. Set to `null` to delete regardless of snak. (2) Leave `null`. |
Returns:
Number of qualifiers that have been removed-
-
Type
-
Promise.<number>
#
(async) refine(allowCreate, configopt) → {Promise.<Object>}
Loads the original statement and adds qualifiers and references of this statement to it.
Parameters:
Name |
Type |
Attributes |
Description |
allowCreate |
boolean
|
|
|
config |
Object
|
<optional>
|
Properties
Name |
Type |
Attributes |
Default |
Description |
editgroup |
string
|
<optional>
|
null
|
|
qualifierComparisonMethod |
WikidataPain.ComparisonMethod
|
<optional>
|
|
|
qualifierMatcher |
QualifierMatcher
|
<optional>
|
|
|
referenceRefinableCriterium |
WikidataPain.ReferenceMatchingCriterium
|
<optional>
|
WikidataPain.ReferenceMatchingCriterium.overlap
|
|
summary |
string
|
<optional>
|
null
|
|
|
Returns:
-
Type
-
Promise.<Object>
#
(async) removeReferenceByHash(hash) → {Promise.<boolean>}
Parameters:
Name |
Type |
Description |
hash |
string
|
|
Returns:
Whether a reference has been removed.
-
Type
-
Promise.<boolean>
#
(async) setClaim(configopt) → {Promise.<Object>}
Parameters:
Name |
Type |
Attributes |
Description |
config |
Object
|
<optional>
|
Properties
Name |
Type |
Attributes |
Description |
editgroup |
string
|
<optional>
<nullable>
|
|
summary |
string
|
<optional>
<nullable>
|
|
|
Returns:
-
Type
-
Promise.<Object>
#
(async) setRank(newRanknon-null, oldRankopt, nullable) → {Promise.<void>}
Returns:
-
Type
-
Promise.<void>
#
(async) setRankInstant(newRanknon-null, oldRankopt, nullable, configopt) → {Promise.<void>}
Parameters:
Name |
Type |
Attributes |
Default |
Description |
newRank |
WikidataPain.Rank
|
|
|
|
oldRank |
WikidataPain.Rank
|
<optional>
<nullable>
|
null
|
|
config |
Object
|
<optional>
|
|
Properties
Name |
Type |
Attributes |
Description |
editgroup |
string
|
<optional>
<nullable>
|
|
summary |
string
|
<optional>
<nullable>
|
|
|
Returns:
-
Type
-
Promise.<void>
#
(async) setValue(newValue) → {Promise.<void>}
Returns:
-
Type
-
Promise.<void>
#
(async) setValueInstant(newValue, optionsopt, nullable) → {Promise.<void>}
Sets this statement's value and the snaktype to `value` using `wbsetclaimvalue`.
Is committed instantly and may not be chained.
Parameters:
Name |
Type |
Attributes |
Description |
newValue |
any
|
|
|
options |
Object
|
<optional>
<nullable>
|
|
Returns:
-
Type
-
Promise.<void>
#
(async) setValueSnakType(snakType) → {Promise.<void>}
Returns:
-
Type
-
Promise.<void>
#
(async) setValueSnakTypeInstant(snaktype, optionsopt, nullable) → {Promise.<void>}
Sets this statement's mainsnak's type.
Is committed instantly and may not be chained.
Parameters:
Name |
Type |
Attributes |
Description |
snaktype |
WikidataPain.Snak.ValueType
|
|
Snak type to set. May not be `Value`. |
options |
Object
|
<optional>
<nullable>
|
|
Returns:
-
Type
-
Promise.<void>
Applies `valueTransformer` to the statement's claim's value and sets it's output as the claim's new value.
Must be committed by calling WikidataPain.Statement.commit.
Parameters:
Name |
Type |
Description |
valueTransformer |
ValueTransformer
|
Function to apply to the claim's value which's result with replace the claim's current value. |
Returns:
-
Type
-
Promise.<void>
Applies `valueTransformer` to the statement's claim's value and sets it's output as the claim's new value by using `wbsetclaimvalue`.
Is committed instantly and may not be chained.
Parameters:
Name |
Type |
Attributes |
Default |
Description |
valueTransformer |
ValueTransformer
|
|
|
|
options |
Object
|
<optional>
<nullable>
|
null
|
|
Returns:
-
Type
-
Promise.<void>