wikibaseintegrator.datatypes.basedatatype
- class wikibaseintegrator.datatypes.basedatatype.BaseDataType(prop_nr=None, **kwargs)[source]
Bases:
Claim
The base class for all Wikibase data types, they inherit from it
- Parameters:
prop_nr (int | str | None) –
kwargs (Any) –
- DTYPE = 'base-data-type'
- __init__(prop_nr=None, **kwargs)[source]
Constructor, will be called by all data types.
- Parameters:
prop_nr (
int
|str
|None
) – The property number a Wikibase snak belongs tokwargs (Any) –
- equals(that, include_ref=False, fref=None)
Tests for equality of two statements. If comparing references, the order of the arguments matters!!! self is the current statement, the next argument is the new statement. Allows passing in a function to use to compare the references ‘fref’. Default is equality. fref accepts two arguments ‘oldrefs’ and ‘newrefs’, each of which are a list of references, where each reference is a list of statements
- Return type:
bool
- Parameters:
that (Claim) –
include_ref (bool) –
fref (Callable | None) –
- from_json(json_data)
- Parameters:
json_data (
dict
[str
,Any
]) – a JSON representation of a Claim- Return type:
- get_json()
- Return type:
dict
[str
,Any
]
- property id: str | None
- property qualifiers: Qualifiers
- property qualifiers_order: list[str]
- static quals_equal(olditem, newitem)
Tests for exactly identical qualifiers.
- property rank: WikibaseRank
- static ref_present(olditem, newitem)
Tests if (1) there is a single ref in the new item and (2) if this single ref is present among the claims of the old item.
- property references: References
- static refs_equal(olditem, newitem)
tests for exactly identical references
- remove(remove=True)
- Return type:
None
- property removed: bool
- reset_id()
Reset the ID of the current claim
- property type: str | dict