Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing Wikidata field should update Wikipedia tag #5543

Closed
1ec5 opened this issue Dec 2, 2018 · 0 comments
Closed

Changing Wikidata field should update Wikipedia tag #5543

1ec5 opened this issue Dec 2, 2018 · 0 comments
Assignees
Labels
field An issue with a field in the user interface validation An issue with the validation or Q/A code
Milestone

Comments

@1ec5
Copy link
Collaborator

1ec5 commented Dec 2, 2018

Following up on #5500, I think changing the Wikidata field should update the wikipedia tag to the Wikipedia article title that corresponds to the newly inserted QID. That would avoid any discrepancy between the wikipedia and wikidata tags (which would be unfortunate because some data consumers could potentially interpret the feature differently depending on which tag they use).

The concern in #5500 (comment) was that, since the Wikidata field kicks off an API request in the user’s language, the wikipedia tag would end up with an article title for an inappropriate Wikipedia language edition. But I think the need to keep the tags in sync would outweigh the awkwardness of a wikipedia tag for a foreign language.

At the moment, setting the Wikidata field kicks off a MediaWiki API request that excludes sitelinks:

props: /*sitelinks|*/'labels|descriptions',
//sitefilter: lang + 'wiki',

We could kick off a request that includes sitelinks (but only in this case, not when viewing the feature normally). Then we could set the wikipedia tag’s value while preserving the wikipedia tag’s current language. If that language doesn’t have a sitelink, then we could fall back to the user’s language, and finally to the first sitelink.

Actually, we could even take advantage of MediaWiki’s language fallbacks: in this request for “New York City Hall” in Cajun French, entities.Q1065206.labels.frc.language and entities.Q1065206.descriptions.frc.language are set to fr, meaning MediaWiki fell back to French. We could choose a fallback language for the wikipedia tag based on that property.

I think the user would find this behavior intuitive and unsurprising. After all, the language and article title would appear right above the Wikidata field that the user has just edited. If the user disagrees, they can select a different language. As long as the Wikipedia article is linked to the same Wikidata item, the Wikidata field will remain unchanged.

If there aren’t any matching sitelinks (or if there are no sitelinks at all), then we should delete the wikipedia tag, because whatever the user just selected is unlikely to be related to any Wikipedia article. If the user disagrees, they can hit Undo.

(If we don’t keep the tags in sync, then it may become necessary to write a QA tool that periodically checks OSM for mismatched wikipedia/wikidata combinations. I think resolving millions of QIDs to their sitelinks would require a dump of Wikidata; there probably isn’t an online service along those lines.)

@quincylvania quincylvania self-assigned this Mar 31, 2019
@quincylvania quincylvania added validation An issue with the validation or Q/A code field An issue with a field in the user interface labels Mar 31, 2019
@quincylvania quincylvania added this to the 2.15.0 milestone Mar 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
field An issue with a field in the user interface validation An issue with the validation or Q/A code
Projects
None yet
Development

No branches or pull requests

2 participants