Quantity#
- class wikibaseintegrator.datatypes.quantity.Quantity(amount=None, upper_bound=None, lower_bound=None, unit='1', wikibase_url=None, **kwargs)[source]#
Bases:
BaseDataTypeImplements the Wikibase data type for quantities
Constructor, calls the superclass BaseDataType
- Parameters:
amount (
str|int|float|None, default:None) – The amount valueupper_bound (
str|int|float|None, default:None) – Upper bound of the value if it exists, e.g. for standard deviationslower_bound (
str|int|float|None, default:None) – Lower bound of the value if it exists, e.g. for standard deviationsunit (
str|int, default:'1') – The unit item URL or the QID a certain amount has been measured in (https://www.wikidata.org/wiki/Wikidata:Units). The default is dimensionless, represented by a ‘1’wikibase_url (
str|None, default:None) – The default wikibase URL, used when the unit is only an ID like ‘Q2’. Use wbi_config[‘WIKIBASE_URL’] by default.
- from_sparql_value(sparql_value)[source]#
Parse data returned by a SPARQL endpoint and set the value to the object
- set_value(amount=None, upper_bound=None, lower_bound=None, unit='1', wikibase_url=None)[source]#
- Return type:
- DTYPE = 'quantity'#
- PTYPE = 'http://wikiba.se/ontology#Quantity'#