NECKAr_get_functions module

NECKAr_get_functions.get_WDid(json_object)[source]

Gets Wikidata id of item

Parameters:json_object – entity object <class ‘dict’>
Returns:id <class ‘string’>
NECKAr_get_functions.get_alias_list(json_object)[source]

Gets aliases and other language labels of a person

Parameters:json_object – entity object <class ‘dict’>
Returns:aliaslist (list of strings)
NECKAr_get_functions.get_ceo(json_object)[source]

Gets CEO (P169)

Parameters:json_object – entity object <class ‘dict’>
Returns:ceo (list of int)
NECKAr_get_functions.get_coordinate(json_object)[source]

gets coordinate location of entity

Parameters:json_object – entity object <class ‘dict’>
Returns:coordinate [long (int), lat (int)] | None
NECKAr_get_functions.get_country(json_object)[source]

Gets country (P17)

Parameters:json_object – entity object <class ‘dict’>
Returns:country (list of int)
NECKAr_get_functions.get_datebirth(json_object)[source]

Gets date of birth of a person This function calls the functions get_datelife with thh property P569

Parameters:json_object – entity object <class ‘dict’>
Returns:date ob birth <class ‘string’> | None
NECKAr_get_functions.get_datedeath(json_object)[source]

Gets date of death of a person This function calls the functions get_datelife with thh property P570

Parameters:json_object – entity object <class ‘dict’>
Returns:date ob death <class ‘string’>| None
NECKAr_get_functions.get_datelife(json_object, P)[source]
Gets dates for person
this only returns a date if it is an explicit date of birth or dead, no latest possible date(P1326) or range (befor/after)
Parameters:
  • json_object – ntity object <class ‘dict’>
  • P – Property (defines if date of birth (P569) or date of death (P570) is searched)
Returns:

date <class ‘string’> | None

Gets link of an item to the German Wikipedia

Parameters:json_object – entity object <class ‘dict’>
Returns:de_sitelink <class ‘string’> | None
NECKAr_get_functions.get_description(json_obejct)[source]

Gets English description of an item

Parameters:json_obejct – entity object <class ‘dict’>
Returns:description <class ‘string’> | None

Gets link of an item to the English Wikipedia

Parameters:json_object – entity object <class ‘dict’>
Returns:en_sitelink <class ‘string’> | None
NECKAr_get_functions.get_founder(json_object)[source]

Gets founder (P112)

Parameters:json_object – entity object <class ‘dict’>
Returns:founder (list of int)
NECKAr_get_functions.get_gender(json_object)[source]

Gets gender of person (“P21”)

Parameters:json_object – entity object <class ‘dict’>
Returns:gender <class ‘string’>| <class ‘int’> | None
NECKAr_get_functions.get_geonamesID(json_object)[source]

gets geonames ID of entity

Parameters:json_object – entity object <class ‘dict’>
Returns:geonames ID (string)| None
NECKAr_get_functions.get_hq_location(json_object)[source]

Gets HQ Location (P159)

Parameters:json_object – entity object <class ‘dict’>
Returns:hq_location (int) | None
NECKAr_get_functions.get_inception(json_object)[source]

Gets date of inception (P571)

Parameters:json_object – entity object <class ‘dict’>
Returns:date of inception (string) | None
NECKAr_get_functions.get_instance_of(json_object)[source]

Gets the id of the organization type (instance of) (P131)

Parameters:json_object – entity object <class ‘dict’>
Returns:instance_of (list of int)
NECKAr_get_functions.get_label(json_object, id)[source]

Gets en label of item

Parameters:
  • json_object – entity object <class ‘dict’>
  • id – Wikidata id <class ‘string’>
Returns:

norm_name: label <class ‘string’> | None

NECKAr_get_functions.get_location_inside(json_object)[source]

gets the id of the country (P17) and or continent (P30) the enities is in

Parameters:json_object – entity object <class ‘dict’>
Returns:tuple of id of country (in_country) and id of continent (in_continent) (both lists of int)
NECKAr_get_functions.get_occupation(json_object)[source]

Gets occupation of person (“P106”)

Parameters:json_object – entity object <class ‘dict’>
Returns:occupation <class ‘string’>
NECKAr_get_functions.get_official_language(json_object)[source]

Gets official language (P37) of object

Parameters:json_object – entity object <class ‘dict’>
Returns:official language (int) | None
NECKAr_get_functions.get_official_website(json_object)[source]

Gets official website (P856)

Parameters:json_object – entity object <class ‘dict’>
Returns:official_website (string) | None
NECKAr_get_functions.get_poi(json_object, country_subclass, settlement_subclass, city_subclass, sea_subclass, river_subclass, mountain_subclass, mountainr_subclass, state_subclass, hgte_subclass)[source]

gets the location type of the entity

Parameters:
  • json_object – entity object <class ‘dict’>
  • country_subclass – list of all country (Q6256, Q3624078, Q1763527) subclasses
  • settlement_subclass – list of all settlement (Q486972) subclasses
  • city_subclass – list of all city (Q515) subclasses
  • sea_subclass – list of all sea (Q165) subclasses
  • river_subclass – list of all river (Q4022) subclasses
  • mountain_subclass – list of all mountain (Q8502) subclasses
  • mountainr_subclass – list of all mountain range (Q41437459) subclasses
  • state_subclass – list of all state (Q7275) subclasses
  • hgte_subclass – list of all human geographic territorail entity (Q15642541) subclasses
Returns:

list of types (list of strings)

NECKAr_get_functions.get_population(json_object)[source]

gets population of entity

Parameters:json_object – entity object <class ‘dict’>
Returns:population (int) | None