openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
https://www.openstreetmap.org/edit?editor=id
ISC License
3.34k stars 1.2k forks source link

Check for disambiguation page in wiki info #4414

Open boothym opened 6 years ago

boothym commented 6 years ago

Especially for place names, sometimes the first result in the wikipedia drop-down is actually a disambiguation page. Is there any way to detect this and warn the user so that the wrong info doesn't get added?

bhousel commented 6 years ago

@1ec5 can I assign this to you?

1ec5 commented 6 years ago

Yeah, although I’m not entirely clear on how to fix this issue at the moment. The Wikipedia field appears to perform a very different API action based on the input length. action=query does have a way to check whether a specific page is a disambiguation page, but I can’t get it to work with list=search. There’s no such option for action=opensearch, although this would be a good opportunity to switch to action=query&generator=prefixsearch, which can pull in Wikidata-powered article summaries in the dropdown suggestions along the lines of what the www.wikipedia.org portal does.

bhousel commented 5 years ago

5647 solves this

matkoniecz commented 4 years ago

It appears to be not fixed or regressed. After selecting Polish Wikipedia ("polski") in WIkipedia article adding menu and typing "Kalenic" I get "Kalenica" disambiguation page as a suggestion.

And #5647 seems to be about integration with OSM Wiki Wikidata, not with Wikidata ("Takes data directly from the Wikibase data items (OSM Wiki)")

quincylvania commented 4 years ago

It appears to be not fixed or regressed.

Verified.

1ec5 commented 4 years ago

action=query does have a way to check whether a specific page is a disambiguation page, but I can’t get it to work with list=search.

That’s because prop=pageprops (and thus ppprop=disambiguation) only works when setting titles= to specific page titles, not when searching with srsearch=. Adding an srprop might be tracked in T18449.

So I think filtering out disambiguation pages would require an extra call to the MediaWiki API for each search result, which would probably not be worth the trouble. On the other hand, if there’s a way to validate a field value as soon as it’s entered (or selected from the dropdown), there are multiple ways to check an individual page’s disambiguation status, such as using ppprop=disambiguation.

And #5647 seems to be about integration with OSM Wiki Wikidata, not with Wikidata ("Takes data directly from the Wikibase data items (OSM Wiki)")

Perhaps the thought was that, by automatically populating the Wikidata field with the linked Wikidata item’s description, the user would get a chance to see “Wikipedia disambiguation page” in that field and realize they’ve chosen the wrong Wikipedia article. But I agree that it isn’t quite a fix either.