Page MenuHomePhabricator

Make a script to import coordinates from Wikipedia to Wikidata
Closed, ResolvedPublic

Description

legoktm implemented coordinates logic to Pywikibot so you can ask the page for the coordinates, see https://github.com/wikimedia/pywikibot-core/blob/master/pywikibot/page.py#L1155

I have some code lying around here to import coordinates to Wikidata so I can probably glue the two together to make it easy to import


Version: core-(2.0)
Severity: normal

Details

Reference
bz62011

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:01 AM
bzimport set Reference to bz62011.

Script is about done, but I ran into some Wikidata problems.

I'm getting the coordinate with "coordinate = page.coordinates(primary_only=True) "
Than I'm adding the coordinate as a claim

newclaim = pywikibot.Claim(self.repo, u'P625')
newclaim.setTarget(coordinate)
item.addClaim(newclaim)

And we end up with a nice serialization error (https://www.wikidata.org/w/index.php?title=Q3969823&oldid=113051304). Tracked in 62105

Change 116285 had a related patch set uploaded by Multichill:
(bug 62011) Script to import coordinates from Wikipedia to Wikidata

https://gerrit.wikimedia.org/r/116285

Change 116285 merged by jenkins-bot:
(bug 62011) Script to import coordinates from Wikipedia to Wikidata

https://gerrit.wikimedia.org/r/116285

The basic features are working:
https://www.wikidata.org/w/index.php?diff=120934196&oldid=120933867

If other issues raise up, please file a new bug.