Page MenuHomePhabricator

MUL - Update WDQS documentation to include mul labels
Closed, ResolvedPublic

Description

Problem:
We will soon release the new mul language code on Wikidata (see T285156). We hope that the Wikidata Community will then start removing labels in languages with redundant strings and instead use the new mul language code. To allow labels to fall back to mul on WDQS, editors need to know that they have to include mul in their queries.

Solution:
What change is needed:

OLD

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

NEW

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }

Where this change is needed:

Notes:

  • Only do this after mul is enabled on Wikidata.
  • The label service doesn’t do language fallbacks on its own, it just goes through the list in its parameters. So it is enough to add mul to this list.

Acceptance criteria:

  • The Wikidata community knows what changes are needed.
  • We have fixed the auto-completion suggestions in the WDQS GUI code.

Open questions:

  • We should have a list of places where changes will be needed.

Original:
As a query service user, I want the label service to produce useful labels, even when Wikidata editors start to remove labels in other languages that are redundant with the new mul language code (see parent task).

Since the label service doesn’t do language fallbacks on its own – it just goes through the list in its parameters (bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en") – it’s probably sufficient to add ,mul to that list in the autocompletion suggestions and in the query examples?

Event Timeline

Manuel renamed this task from Make WDQS label service fall back to mul labels to Investigate how to make WDQS label service fall back to mul labels.Jul 6 2022, 11:55 AM
Manuel updated the task description. (Show Details)
Manuel added subscribers: dcausse, Manuel.

@dcausse: Hi David, I am a Product Manager for Wikidata and I am unsure of how to best deal with this: Would it be sufficient to add ,mul to that list in the autocompletion suggestions and in the query examples? How would we best make this happen practically?

@Manuel sorry for the late response. I'm not very familiar with the query service UI features but if the autocompletion suggestions you mention are the ones you obtain when hitting Ctlr-space in the SPARQL editor I believe it would make sense indeed. As for the examples they're managed by the wikidata editors directly on the wiki IIRC and it would probably make a lot of sense to at least have few specific examples demonstrating the mul language code, updating all of them might be valuable but I think a full review of all the examples might be worthwhile as I think some are not working properly.

Regarding the other approach mentioned: what if the SPARQL would do this fallback automagically on its own? I don't fully object to this approach but it might be surprising for users not requesting mul labels to see them in their results.

Manuel renamed this task from Investigate how to make WDQS label service fall back to mul labels to Ensure that the Community knows how to make WDQS label service fall back to mul labels.Jul 19 2022, 4:17 PM
Manuel updated the task description. (Show Details)

Thank you for your help @dcausse!

Manuel renamed this task from Ensure that the Community knows how to make WDQS label service fall back to mul labels to MUL - Ensure that the Community knows how to make WDQS label service fall back to mul labels.Sep 13 2022, 10:57 AM
Manuel renamed this task from MUL - Ensure that the Community knows how to make WDQS label service fall back to mul labels to MUL - Update WDQS documentation to include mul labels .Jan 25 2024, 12:20 PM

Change #1055962 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[wikidata/query/gui@master] Add mul to label service params

https://gerrit.wikimedia.org/r/1055962

Change #1055962 merged by jenkins-bot:

[wikidata/query/gui@master] Add mul to label service params

https://gerrit.wikimedia.org/r/1055962

Change #1057914 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: WDQSGuiBuilder):

[wikidata/query/gui-deploy@production] Merging from 14bab99112f00fdece91d13d7d9adf1b416a5c17

https://gerrit.wikimedia.org/r/1057914

Change #1057914 merged by Lucas Werkmeister (WMDE):

[wikidata/query/gui-deploy@production] Merging from 14bab99112f00fdece91d13d7d9adf1b416a5c17

https://gerrit.wikimedia.org/r/1057914

This seems to be missing the updated documentation here: https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples and the WDQS examples

Would this fall with the QTs?

I’m not sure if we should update the examples ourselves, IMHO that feels like the community’s responsibility… should we bring it up on the talk page?

(Or we could just do it and see if anyone reverts it, I guess.)

Arian_Bozorg claimed this task.
Arian_Bozorg added a subscriber: VIGNERON.

I may be missing something here, but this replicates a similar format to the current language fallback.

@VIGNERON's solution addresses this: https://www.wikidata.org/wiki/Help_talk:Default_values_for_labels_and_aliases#c-VIGNERON-20240730122800-Peter_F._Patel-Schneider-20240730121000

The documentation has been updated to include mul now, and although there may be some teething issues, this is an important step to reduce the amount of data on the Query Service.

An important precision :

In the vast majority (maybe 90%) of SPARQL queries, you just need to display the label and in these cases, you can just use the SERVICE wikibase:label (as stated above and as updated on the documentation pages).

In others cases, where you need to actually manipulate the label (like concatenate or filter them), it's still simple and you can write :

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". ?item rdfs:?itemLabel }

In both cases, it's just 4 more characters (that are not even required if you query items that are not concerned by "mul").

Then in very rare cases, you can't use the SERVICE wikibase:label (eg. in you use endpoints other than WDQS), that's why I suggested my solution, but it's rare cases. But there is a lot of other possibilities depending on the case.
And yes, using 3 lines is a bit annoying but it works, I would consider that the issue has been adressed (especially as it concerns only a very few people).

Neither https://www.wikidata.org/wiki/Wikidata:SPARQL_tutorial nor https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/A_gentle_introduction_to_the_Wikidata_Query_Service mention mul, and I can't where its made clear that

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en".
  ?c rdfs:label ?label
}

will be required instead of

{ ?c rdfs:label ?label. FILTER ( lang(?label) = 'en' ) }

and whether this has any performance implications.

Thanks for picking up on that @Vicarage, I have created another ticket for the places I missed here: T373685

And we can continue the conversation there :) thank you both for you input on this