somnathrakshit / geograpy3

Extract place names from a URL or text, and add context to those names -- for example distinguishing between a country, region or city.
https://geograpy3.readthedocs.io
Apache License 2.0
124 stars 12 forks source link

[BUG]wikidataid is not unique and labels are not handled as lists #54

Closed WolfgangFahl closed 3 years ago

WolfgangFahl commented 3 years ago

Describe the bug The wikidataid for countries, regions and cities should be unique there might be multiple labels but not multiple entries under the same id

To Reproduce use primarykey of pyLoDStorage

Expected behavior Primary key should be set and index should be automatically created.

WolfgangFahl commented 3 years ago
0:Arlington County (None - None)
1:Rincón (None - None)
2:Happy Valley-Goose Bay (None - None)
3:St. Petersburg (None - None)
4:Abele (None - None)
======================================================================
FAIL: testCityManagerFromJSONBackup (tests.test_location.TestLocationHierarchy)
tests the loading and parsing of the cityList form the json backup file
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/wf/Documents/pyworkspace/geograpy3/tests/test_location.py", line 262, in testCityManagerFromJSONBackup
    citiesByWikiDataId=self.checkNoDuplicateWikidataIds(cityManager)
  File "/Users/wf/Documents/pyworkspace/geograpy3/tests/test_location.py", line 195, in checkNoDuplicateWikidataIds
    self.assertEqual(len(duplicates),0)
AssertionError: 5 != 0