wikibaseintegrator.datatypes.globecoordinate

class wikibaseintegrator.datatypes.globecoordinate.GlobeCoordinate(latitude=None, longitude=None, altitude=None, precision=None, globe=None, wikibase_url=None, **kwargs)[source]

Bases: BaseDataType

Implements the Wikibase data type for globe coordinates

Parameters:
  • latitude (float | None) –

  • longitude (float | None) –

  • altitude (float | None) –

  • precision (float | None) –

  • globe (str | None) –

  • wikibase_url (str | None) –

  • kwargs (Any) –

DTYPE = 'globe-coordinate'
__init__(latitude=None, longitude=None, altitude=None, precision=None, globe=None, wikibase_url=None, **kwargs)[source]

Constructor, calls the superclass BaseDataType

Parameters:
  • latitude (Optional[float]) – Latitude in decimal format

  • longitude (Optional[float]) – Longitude in decimal format

  • altitude (Optional[float]) – Altitude (in decimal format?) (Always None at this moment)

  • precision (Optional[float]) – Precision of the position measurement, default 1 / 3600

  • globe (Optional[str]) – The globe entity concept URI (ex: http://www.wikidata.org/entity/Q2) or ‘Q2’

  • wikibase_url (Optional[str]) – The default wikibase URL, used when the globe is only an ID like ‘Q2’. Use wbi_config[‘WIKIBASE_URL’] by default.

  • 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')[source]
Return type:

bool

property qualifiers: Qualifiers
property qualifiers_order: list[str]
static quals_equal(olditem, newitem)

Tests for exactly identical qualifiers.

Return type:

bool

Parameters:
property rank: WikibaseRank
static ref_present(olditem, newitem)

Tests if (1) there is a single ref in the new item and (2) if this single ref is present among the claims of the old item.

Return type:

bool

Parameters:
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
reset_id()

Reset the ID of the current claim

set_value(latitude=None, longitude=None, altitude=None, precision=None, globe=None, wikibase_url=None)[source]
Parameters:
  • latitude (float | None) –

  • longitude (float | None) –

  • altitude (float | None) –

  • precision (float | None) –

  • globe (str | None) –

  • wikibase_url (str | None) –

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

None

Parameters:

claim (Claim) –