TabularData#

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

Bases: BaseDataType

Implements the Wikibase data type ‘tabular-data’

Constructor, calls the superclass BaseDataType

Parameters:

value (str | None, default: None) – Reference to tabular data file on Wikimedia Commons.

from_sparql_value(sparql_value)[source]#

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

The RDF representation is the full Wikimedia Commons URL of the file (e.g. http://commons.wikimedia.org/data/main/Data:Population+FR+Q1657686.tab), only the page title is kept.

Parameters:

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

Return type:

Self

Returns:

get_sparql_value(**kwargs)[source]#

The IRI of the value in the RDF export: the URL of the page on Wikimedia Commons, with the page title encoded like MediaWiki’s wfUrlencode() (a space is a ‘+’, ‘:’ and ‘/’ are kept), e.g. <http://commons.wikimedia.org/data/main/Data:Paris.map>

Return type:

str | None

set_value(value=None)[source]#
Return type:

None

DTYPE = 'tabular-data'#
PTYPE = 'http://wikiba.se/ontology#TabularData'#
SPARQL_IRI_PREFIX = 'http://commons.wikimedia.org/data/main/'#