Show label even if it is not English

Issue #2 new
Nicolas Raoul created an issue

Most articles in Japan have only a Japanese label in Wikidata. Fortunately, most wikishootme in Japan happen to understand at least a bit of Japanese.

PROBLEM: wikishootme does not show the Japanese label

SOLUTION: If there is no English label, or no label in the visitor's language, just show a label in another language, in any case it is much more user-friendly than a Q code.

Example: https://tools.wmflabs.org/reasonator/?q=Q11547673

Comments (3)

  1. Nicolas Raoul reporter

    Thanks for V3, it is wonderful, like a dream come true!

    In your blog you mentioned that the label service is too slow. Here is a query example that shows a label in English OR in another language if no English is available, WITHOUT using the label service:

    https://query.wikidata.org/#SELECT%0A%20%20%3Fitem%0A%20%20%28SAMPLE%28COALESCE%28%3Fen_label%2C%20%3Fitem_label%29%29%20as%20%3Flabel%29%0A%20%20%28SAMPLE%28%3Flocation%29%20as%20%3Flocation%29%0AWHERE%20%7B%0A%20%20%3Fitem%20wdt%3AP31%20wd%3AQ811979%20.%0A%20%20%3Fitem%20wdt%3AP625%20%3Flocation%20.%0A%20%20MINUS%20%7B%3Fitem%20wdt%3AP18%20%3Fimage%7D%0A%20%20OPTIONAL%20%7B%3Fitem%20rdfs%3Alabel%20%3Fen_label%20.%20FILTER%28LANG%28%3Fen_label%29%20%3D%20%22en%22%29%7D%0A%20%20OPTIONAL%20%7B%3Fitem%20rdfs%3Alabel%20%3Fitem_label%7D%0A%7D%0AGROUP%20BY%20%3Fitem

    SELECT
      ?item
      (SAMPLE(COALESCE(?en_label, ?item_label)) as ?label)
      (SAMPLE(?location) as ?location)
    WHERE {
      ?item wdt:P31 wd:Q811979 .
      ?item wdt:P625 ?location .
      MINUS {?item wdt:P18 ?image}
      OPTIONAL {?item rdfs:label ?en_label . FILTER(LANG(?en_label) = "en")}
      OPTIONAL {?item rdfs:label ?item_label}
    }
    GROUP BY ?item
    

    I hope you can use the same trick for WSM.

  2. Nicolas Raoul reporter

    If the label service is too slow, how about having the popup first display what it has, then dynamically load non-QID label when the need arises?

    Self-memo:

  3. Log in to comment