GeoShape#

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

Bases: BaseDataType

Implements the Wikibase data type ‘geo-shape’

Constructor, calls the superclass BaseDataType

Parameters:
  • value (str | None, default: None) – The GeoShape map file name in Wikimedia Commons to be linked

  • kwargs (Any)

Keyword Arguments:
  • prop_nr (str) – The item ID for this claim

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

  • references (References or list of Claim) – List with reference objects

  • qualifiers (Qualifiers) – List with qualifier objects

  • rank (WikibaseRank) – The snak type, either ‘value’, ‘somevalue’ or ‘novalue’

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 map (e.g. http://commons.wikimedia.org/data/main/Data:Paris.map), 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 = 'geo-shape'#
PTYPE = 'http://wikiba.se/ontology#GeoShape'#
SPARQL_IRI_PREFIX = 'http://commons.wikimedia.org/data/main/'#