Math#

class wikibaseintegrator.datatypes.math.Math(value=None, **kwargs)[source]#

Bases: String

Implements the Wikibase data type ‘math’ for mathematical formula in TEX format

Constructor, calls the superclass BaseDataType

Parameters:

value (str | None, default: None) – The string to be used as the value

from_sparql_value(sparql_value)[source]#

Parse data returned by a SPARQL endpoint and set the value to the object

Only an unknown value can be parsed: the RDF export holds a formula rendered as MathML (e.g. <math …><msup><mi>c</mi>…), not its TeX source, which is the value of the claim (c^2=a^2+b^2). The two can’t be compared, so a known value raises a ValueError and is left out of the fast run data.

Parameters:

sparql_value (dict) – A SPARQL value composed of type and value

Return type:

Self

Returns:

get_sparql_value(**kwargs)[source]#
Return type:

str

DTYPE = 'math'#
PTYPE = 'http://wikiba.se/ontology#Math'#