NatLibFi / Skosmos-widget-wiki

1 stars 0 forks source link

How does Wikipedia widget handle Wikidata redirects? #14

Open tpalonen opened 1 year ago

tpalonen commented 1 year ago

This is an issue that may require no action, but I'm writing it for documentation and testing. Some YSO concepts have been linked to Wikidata items which include a redirect in one or several languages. A redirect is a link that leads from a Wikidata item to a detached Wikipedia article, ie. an article that is attached to some other Wikidata item. See: https://www.wikidata.org/wiki/Help:Redirects

At the moment, I am not aware of YSO concepts that already have a link in finto.fi to such Wikidata items (most likely there are a few already). Here is a short list, however, of such YSO concepts that have been linked to Wikidata via OpenRefine and will be imported to finto.fi YSO in the near future. Once imported, this list can be used to check how Wikipedia widget handles these redirects. Desired outcome would be that the widget would ignore these redirects, ie. not show the redirected Wikipedia article, because they don't, precisely speaking, represent the same topic as the YSO concept.

YSO concept kansanlaulut / folk songs (http://www.yso.fi/onto/yso/p2842) is linked to a Wikidata item which has an English language redirect link to the Wikipedia artile Folk music: https://www.wikidata.org/wiki/Q943929

YSO concept kukot / cocks (http://www.yso.fi/onto/yso/p24395) is linked to a Wikidata item which has an English language redirect link to the Wikipedia article Chicken: https://www.wikidata.org/wiki/Q2216236.

YSO concept spektrografit / spectrographs (http://www.yso.fi/onto/yso/p26430) is linked to a Wikidata item which has an English language redirect link to the Wikipedia article Optical spectrometer: https://www.wikidata.org/wiki/Q911551

YSO concept judokat / judokas (http://www.yso.fi/onto/yso/p23115) is linked to a Wikidata item which has redirects in English and Swedish: https://www.wikidata.org/wiki/Q6665249

YSO concept kasvisravinto / vegetarian food (http://www.yso.fi/onto/yso/p9024) is linkited to a Wikidata item with the sole attached Wikipedia article being an English redirect: https://www.wikidata.org/wiki/Q107126067

joelit commented 1 year ago

The widget should not handle anything on its own, but the wikidata APIs can be used in different ways to the effect. (Neither of the examples -- yso:p2842 or yso:p24395 -- has a link to wikidata, which is concerning. There's probably something wrong with the vocabulary at the moment?)

At the moment (#12 ) the widget uses the normal html content and follows redirects. It should be updated to use the mobile html content during Skosmos 3.0 overhaul. Then there are two options, using the link I found from the https://www.wikidata.org/wiki/Q943929: https://en.wikipedia.org/api/rest_v1/page/mobile-html/Traditional_song?redirect=true (-> shows "Folk music") https://en.wikipedia.org/api/rest_v1/page/mobile-html/Traditional_song?redirect=false (-> shows blank page)