Modify

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#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)

2016-07-10-225237_590x270_scrot.png (3.5 KB ) - added by simon04 8 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by Don-vip, 9 years ago

Component: CorePlugin wikipedia
Owner: changed from team to simon04

something for wikipedia plugin?

comment:2 by hjart, 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.

Last edited 9 years ago by hjart (previous) (diff)

comment:3 by simon04, 9 years ago

So this is like #10148, but starting with the name tag instead of the wikipedia tag?

comment:4 by hjart, 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 hjart, 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.

by simon04, 8 years ago

comment:7 by simon04, 8 years ago

Cc: Polyglot species added
Resolution: fixed
Status: newclosed

Feature added in [o32625:32628] to menu Data → Search Wikidata items.


Have fun!

comment:8 by species, 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?

in reply to:  8 comment:9 by simon04, 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)

Done in [o32634:32635].

comment:10 by hjart, 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.

in reply to:  10 comment:11 by simon04, 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 hjart, 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)?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.