Script to import Open Data Zurich fountains into wikidata without overwriting existing data. The script generates Quickstatement commands to be run in the online interface https://tools.wmflabs.org/wikidata-todo/quick_statements.php
.
The project is open source under the GNU Affero General Public License, with a profit contribution agreement applying under restricted conditions. See COPYING for information.
- Python 3.3 or higher (https://www.python.org/downloads/release/python-365/) make sure, it is added to your path
- v3.65 works ; most other were very troublesome as per https://github.com/water-fountains/import2wikidata/wiki/Trouble-Shooting (v3.53 on debian9 problematic with gastrodon; on win v3.8 with asyncio and win32api DLL, v3.7 with 'GenericMeta' from 'typing')
- Jupyter (http://jupyter.org/install)
- all packages mentioned in the import lines of the Jupyter notebook
zurich_fountains_preprocess.ipynb
(usepip install [package name]
to install - in debian rather 'pip3')- gastrodon , pandas
- Clone this repository to your local machine
git clone https://github.com/mmmatthew/import2wikidata.git
- Start jupyter from a command window in the directory just created
jupyter notebook
- In your browser, open
http://localhost:8888/notebooks/zurich_fountains_preprocess.ipynb
(the port may be different) - Run the script. It should create a file
quickstatement_commands*.txt
- Go to
https://tools.wmflabs.org/wikidata-todo/quick_statements.php
. - Authenticate yourself with your Wikidata account.
- Copy and paste the contents of
quickstatement_commands*.txt
into the blank field, and run the commands- before 'run', check the Umlauts (opening with notepad was fine, just doubleclick distorted them)
- if the wmflabs is slow, do not re-do it a second time, otherwise you generate duplicates
- you might even not see that pressing the "Do it" button had an effect. Watch twice before you hit it again (duplicates!)
- also, it takes up to hours until items you see newly inserted in the GUI also arrive in sparql queries
- ==> wait hours between multiple attempts to run
quickstatement_commands*.txt
(and redo the notebook first to detect duplicates)
- ==> wait hours between multiple attempts to run
Open Data Zurich fountain properties are mapped to the following wikidata properties
- bezeichnung -> Lde
- brunnenart_txt -> P31
- wasserart_txt -> P5623
- nummer -> P528
- historisches_baujahr -> P571
Type of water can take several values
- Verteilnetz -> Q53633635
- Quellwasser -> Q1881858
- Eigene Versorgung -> Q53634173
- Grundwasser -> Q161598
Check the project issues to find out where the current dev focus is.
See also https://github.com/water-fountains/import2wikidata/wiki