Claim

class wikibase_api.models.Claim(api)

Collection of API functions for claims

Example function call:

from wikibase_api import Wikibase

wb = Wikibase(
    # Parameters
)

r = wb.claim.get("Q1")
print(r)
add(entity_id, property_id, value, snak_type='value')

Create a new claim for the specified entity

Parameters:
  • entity_id (str) – Entity identifier (e.g. "Q1")
  • property_id (str) – Property identifier (e.g. "P1")
  • value (any) – Value of the claim. If snak_type is set to “novalue” or “somevalue”, value must be None
  • snak_type (str) – Value type (one of ["value", "novalue", "somevalue"]. "value" (default) is used for normal property-value pairs. "novalue" is used to indicate that an item has none of the property (e.g. a person has no children). "somevalue" is used when it is known that a value exists, but the value itself is not known
Returns:

Response

Return type:

dict

remove(claim_ids)

Delete one or multiple claims

Parameters:claim_ids (str or list(str)) – Claim identifier(s) (e.g. "Q2$8C67587E-79D5-4E8C-972C-A3C5F7ED06B3" or ["Q2$8C67587E-79D5-4E8C-972C-A3C5F7ED06B3", "Q2$ACC73295-5CF2-4B6A-95AA-CF156AB2B036"]), can be obtained with get()
Returns:Response
Return type:dict
update(claim_id, value, snak_type='value')

Update the value of the specified claim

Parameters:
  • claim_id (str) – Claim identifier (e.g. "Q2$8C67587E-79D5-4E8C-972C-A3C5F7ED06B3"), can be obtained with get()
  • value (any) – Value of the claim. If snak_type is set to “novalue” or “somevalue”, value must be None
  • snak_type (str) – Value type (one of ["value", "novalue", "somevalue"]. "value" (default) is used for normal property-value pairs. "novalue" is used to indicate that an item has none of the property (e.g. a person has no children). "somevalue" is used when it is known that a value exists, but the value itself is not known
Returns:

Response

Return type:

dict