wikibaseintegrator.datatypes.form

class wikibaseintegrator.datatypes.form.Form(value=None, **kwargs)[source]

Bases: BaseDataType

Implements the Wikibase data type ‘wikibase-form’

Parameters:
  • value (str | None) –

  • kwargs (Any) –

DTYPE = 'wikibase-form'
__init__(value=None, **kwargs)[source]

Constructor, calls the superclass BaseDataType

Parameters:
  • value (str with the format "L<Lexeme ID>-F<Form>") – The form number to serve as a value using the format “L<Lexeme ID>-F<Form ID>” (example: L252248-F2)

  • prop_nr (str with a 'P' prefix followed by digits) – The property number for this claim

  • snaktype (str) – The snak type, either ‘value’, ‘somevalue’ or ‘novalue’

  • references (A data type with subclass of BaseDataType) – List with reference objects

  • qualifiers (A data type with subclass of BaseDataType) – List with qualifier objects

  • rank (str) – rank of a snak with value ‘preferred’, ‘normal’ or ‘deprecated’

  • kwargs (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:

Claim

get_json()
Return type:

Dict[str, Any]

get_sparql_value()[source]
Return type:

str

has_equal_qualifiers(other)
Return type:

bool

Parameters:

other (Claim) –

property id: str | None
property mainsnak: Snak
parse_sparql_value(value, type='literal', unit='1')
Return type:

bool

property qualifiers: Qualifiers
property qualifiers_order: List[str]
property rank: WikibaseRank
property references: References
static refs_equal(olditem, newitem)

tests for exactly identical references

Return type:

bool

Parameters:
remove(remove=True)
Return type:

None

property removed: bool
set_value(value=None)[source]
Parameters:

value (str | None) –

property type: str | Dict
update(claim)
Return type:

None

Parameters:

claim (Claim) –