Qualifier¶
-
class
wikibase_api.models.
Qualifier
(api)¶ Collection of API functions for qualifiers
Example function call:
from wikibase_api import Wikibase wb = Wikibase( # Parameters ) claim_id = "Q2$8C67587E-79D5-4E8C-972C-A3C5F7ED06B3" r = wb.qualifier.add(claim_id, "P585", "13700 million years BCE") print(r)
-
add
(claim_id, property_id, value, snak_type='value')¶ Create a new qualifier for the specified claim
Parameters: - claim_id (str) – Claim identifier (e.g.
"Q2$8C67587E-79D5-4E8C-972C-A3C5F7ED06B3"
) - property_id (str) – Property identifier (e.g.
"P1"
) - value (any) – Value of the qualifier. 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
- claim_id (str) – Claim identifier (e.g.
-
remove
(claim_id, qualifier_ids)¶ Delete the specified qualifier(s)
Parameters: - claim_id (str) – Claim identifier (e.g.
"Q2$8C67587E-79D5-4E8C-972C-A3C5F7ED06B3"
) - qualifier_ids (str or list(str)) – Hash(es) of the qualifier(s) to be deleted (e.g.
"e3401fd064ec7c3cb7169aca6efff7419d95312a"
,["e3401fd064ec7c3cb7169aca6efff7419d95312a", "d86fda314abf561afca0d1fef97546ea050f3c1e"]
)
Returns: Response
Return type: dict
- claim_id (str) – Claim identifier (e.g.
-
update
(claim_id, qualifier_id, property_id, value, snak_type='value')¶ Update the value of the specified qualifier
Parameters: - claim_id (str) – Claim identifier (e.g.
"Q2$8C67587E-79D5-4E8C-972C-A3C5F7ED06B3"
) - property_id (str) – Property identifier (e.g.
"P1"
) - qualifier_id (str) – Hash of the qualifier to be updated (e.g.
"e3401fd064ec7c3cb7169aca6efff7419d95312a"
) - value (any) – Value of the qualifier. 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
- claim_id (str) – Claim identifier (e.g.
-