wikibaseintegrator.models.snaks

class wikibaseintegrator.models.snaks.Snak(snaktype=WikibaseSnakType.KNOWN_VALUE, property_number=None, hash=None, datavalue=None, datatype=None)[source]

Bases: BaseModel

Parameters:
  • snaktype (WikibaseSnakType) –

  • property_number (str | None) –

  • hash (str | None) –

  • datavalue (dict | None) –

  • datatype (str | None) –

__init__(snaktype=WikibaseSnakType.KNOWN_VALUE, property_number=None, hash=None, datavalue=None, datatype=None)[source]
Parameters:
  • snaktype (WikibaseSnakType) –

  • property_number (str | None) –

  • hash (str | None) –

  • datavalue (dict | None) –

  • datatype (str | None) –

property datatype
property datavalue
from_json(json_data)[source]
Return type:

Snak

Parameters:

json_data (dict[str, Any]) –

get_json()[source]
Return type:

dict[str, str]

property hash
property property_number
property snaktype
class wikibaseintegrator.models.snaks.Snaks[source]

Bases: BaseModel

__init__()[source]
Return type:

None

add(snak)[source]
Return type:

Snaks

Parameters:

snak (Snak) –

from_json(json_data)[source]
Return type:

Snaks

Parameters:

json_data (dict[str, list]) –

get(property)[source]
Return type:

list[Snak]

Parameters:

property (str | int) –

get_json()[source]
Return type:

dict[str, list]