#12039 closed enhancement (fixed)
Query wikidata with name then add id to selected object
Reported by: | hjart | Owned by: | simon04 |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin wikipedia | Version: | |
Keywords: | wikidata | Cc: | Polyglot, species |
Description
I would appreciate a function that would query the Wikidata api using either the value of the name=* tag of a selected object or a text input box. Upon succes the function would then add wikidata="returned_id" to a selected object
Attachments (1)
Change History (13)
comment:1 by , 9 years ago
Component: | Core → Plugin wikipedia |
---|---|
Owner: | changed from | to
comment:2 by , 9 years ago
This would be for objects for which there are Wikidata articles, but not necessarily Wikipedia articles, so possibly independent from that plugin.
comment:3 by , 9 years ago
So this is like #10148, but starting with the name
tag instead of the wikipedia
tag?
comment:4 by , 9 years ago
Many of the objects I'm interested in tagging wikidata=*
would never have their own Wikipedia article and in many cases not even an official name. Furthermore I don't really think I would want it to run every time I enter a name tag. I can see cases where that would be annoying unless it would only run for certain preselected groups of objects (such as historic=memorial
). So I think I would primarily want a function that I would actively run by clicking a menu item or hitting a key. Something very plain and boring :-)
comment:5 by , 9 years ago
Wikidata items do not have to have unique names, so ways to figure out which item to choose would be needed. This could prove to be a bit complex.
comment:6 by , 9 years ago
by , 8 years ago
Attachment: | 2016-07-10-225237_590x270_scrot.png added |
---|
comment:7 by , 8 years ago
Cc: | added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
follow-up: 9 comment:8 by , 8 years ago
Nice work, thanks!
Two suggestions:
- could you add a language selector? Because it onlys searches with JOSM's current language, and changing that requires a JOSM restart...
- could you populate target key list with only the entries from the Wikidata-Page in the OSM-Wiki?
comment:9 by , 8 years ago
Replying to species:
- could you add a language selector? Because it onlys searches with JOSM's current language, and changing that requires a JOSM restart...
The query string is considered in the language set in the wikidata plugin (use the rightmost button in the dialog)
- could you populate target key list with only the entries from the Wikidata-Page in the OSM-Wiki?
Done in [o32634:32635].
follow-up: 11 comment:10 by , 8 years ago
I love the Wikidata button. Iv'e found lots of objects in Denmark for which there are (mainly) german and/or english, but no native wikipedia articles and I've found it very helpfull for discovering those.
I have found though that if a wikidata item has more than one set of coordinates (happens if imported from 2 wikipedias each with their own set), it doesn't appear in the list.
Also if coordinates are stored only on wikidata (note the {{coord wd|...}} template in i.e. https://da.wikipedia.org/wiki/Frilandsmuseet_i_Maribo which gets coordinates from Wikidata), a wikipedia article won't show up when pressing the leftmost button.
comment:11 by , 8 years ago
Both issues have to be taken care of on the Wikipedia/Wikidata side since the plugin is just using the official API.
Replying to hjart:
I have found though that if a wikidata item has more than one set of coordinates (happens if imported from 2 wikipedias each with their own set), it doesn't appear in the list.
I can confirm this. This is very bad. I created a bug https://phabricator.wikimedia.org/T141080 – let's see.
Also if coordinates are stored only on wikidata (note the {{coord wd|...}} template in i.e. https://da.wikipedia.org/wiki/Frilandsmuseet_i_Maribo which gets coordinates from Wikidata), a wikipedia article won't show up when pressing the leftmost button.
This might be due to https://da.wikipedia.org/wiki/Skabelon:Coord_wd not invoking {{#coordinates:}}
, see the comment on https://da.wikipedia.org/wiki/Modul:Coordinates
Note: This function provides the visual display elements of
{{coord}}
. In
order to load coordinates into the database, the{{#coordinates:}}
parser
function must also be called, this is done automatically in the Lua
version of{{coord}}
.
comment:12 by , 8 years ago
I reported the coord wd problem here and although the guy apparently doesn't yet know how, he appears intent on solving it.
I regularly find I need to also name objects as I attach wikipedia and/or wikidata tags to them and I have often done this by copying the wikipedia title and subsequently remove the "da:" from the name tag. Is there a chance the plugin could automatically populate name=*, if it doesn't allready exist, so I could skip that step (as it is a bit cumbersome as well as errorprone)?
something for wikipedia plugin?