Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

GrayDB から Wikidata へのインポートを実施 #35

Closed
halsk opened this issue Oct 7, 2017 · 6 comments
Closed

GrayDB から Wikidata へのインポートを実施 #35

halsk opened this issue Oct 7, 2017 · 6 comments

Comments

@halsk
Copy link
Member

halsk commented Oct 7, 2017

How to use import tool of Wikidata

mySociety から教えて貰った、インポートツールの使い方です。

The main tool you can use to create Wikidata items is QuickStatements.

There are two versions of this. The old one is largely deprecated now, so you'll want to use the one at https://tools.wmflabs.org/quickstatements/

However, the instructions for it are still only on the old one! —
https://tools.wmflabs.org/wikidata-todo/quick_statements.php
Once you've created the statements for it, you select the "Import Commands" > "Version 1 format" from the header bar in the new version (it's quite well hidden!)

For creating new items, or adding basic statements to existing items, everything should work smoothly, but you should beware that if you use it for adding P39 (position held) records to existing items, it doesn't work if someone has held the same position more than once. Unfortunately that's very common with political data, where it's very likely that there will be a large number of people elected as a Q17506823 (member of the House of Representatives of Japan) in the 48th Term, who already have a P39: Q17506823 record for the 47th Term.

To help with that, we've developed a bot called PositionStatements that takes input in exactly the same format as QuickStatements, but adds an entirely new P39 record each time, rather than combining them all into one as QS does. There's no web interface to that yet, but you can either try to get the bot running yourselves locally (it's a Python script, linked from
https://www.wikidata.org/wiki/Wikidata:Requests_for_permissions/Bot/PositionStatements_Bot),
or you can send us a TSV file of commands, and we can run it on behalf of a Wikidata account of your choosing.

If you have any questions about either QuickStatements or PositionStatements, feel free to ask. It can be a bit confusing at first, but once you get the hang of it, it's incredibly powerful.

Do you think you'll be able to use these tools to add all the information we need directly into Wikidata?

http://tinyurl.com/yabzpkde is an example of a SPARQL query to get a list of members of the outgoing (47th) House of Representatives. That data is still quite far from complete, but it should be enough to give you the basic idea (and perhaps to practice with the tools), and it can easily be adjusted to find the members of the 48th after the election: http://tinyurl.com/ybvdcw66

Similarly, Wikidata's current understanding of who the governors of each prefecture is: http://tinyurl.com/ya57emlx — again, it would be ideal for us if you could correct any errors or omissions directly there.

@higa4
Copy link
Collaborator

higa4 commented Oct 9, 2017

GrayDB(google spread sheet)上でwikidataを参照できるプラグインです。
https://chrome.google.com/webstore/detail/wikipedia-and-wikidata-to/aiilcelhmpllcgkhhpifagfehbddkdfp?utm_source=permalink

@takahashim
Copy link

今日の作業の報告です。
GrayDB内にある、Wikidata未登録の候補者についてはこちらのツールを使って一括投入しました。Wikidata IDをGrayDBに戻す作業はまだのものが多数(300件から400件程度)あります。
今後の投入作業としては、各候補者の公認政党についてはこのツール(と投入用バッチ生成スクリプト)で一括更新できるように思います。

@takahashim
Copy link

GrayDB内の候補者データについて、現在登録されているGrayDBId 1048までは全てWikidata IDを付番しました。

@takahashim
Copy link

takahashim commented Oct 9, 2017

https://github.com/takahashim/cfej_import_wikidata 未登録者のインポートコマンド生成に使ったプロジェクトを整理してこちらに置いておきました。OAuth2のclient_secret.jsonを取得するのが面倒くさいです…(が、Google Spreadsheets APIはそういう仕様なんでしょうがない)。

@higa4
Copy link
Collaborator

higa4 commented Oct 10, 2017

おくればせながらQuickStatementsの使い方説明文書があったのではっておきます。
https://www.wikidata.org/wiki/Help:QuickStatements
いちばん下の「CSV to quick_statements 」というツールを使えば楽ができるかもしれない。

@nyampire
Copy link
Collaborator

以下で再作業のスレッドがたっているので、こちらクローズとしたく。

#61

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants