Page MenuHomePhabricator

QueryViz: support default endpoint switch
Closed, ResolvedPublic2 Estimated Story Points

Description

Estimate : <2 hour work. JS.

Idea : QueryViz plugin which currently hits by default on LinguaLibre Query Service (LLQS) could have a switch to hit on other QS such as Wikidata Query Service (WDQS) and its lexemes or others.

Values :

  • lili (default): https://lingualibre.org/bigdata/namespace/wdq/sparql?query={SPARQL} with xhr js POST
  • wikidata: https://query.wikidata.org/sparql?query={SPARQL} with xhr js GET
  • commons: https://commons-query.wikimedia.org/sparql?query={SPARQL} with xhr js GET
  • dictionaire des francophone: https://www.dictionnairedesfrancophones.org/sparql T286049

On the model of #defaultView:Map, #defaultView:Table used in WDQS. ( on the top of this query)
Add the recognition of #defaultEndpoint:Wikidata which would shift the whole to service Wikidata.
This would allow to view wikidata or other endpoint's data in QueryViz.

See PR5
See also: T313343

Event Timeline

Yug updated the task description. (Show Details)
Yug updated the task description. (Show Details)
Yug updated the task description. (Show Details)
Yug triaged this task as Low priority.Jul 6 2022, 12:51 PM
Yug updated the task description. (Show Details)
Yug added a project: good first task.

PR on github. https://github.com/lingua-libre/QueryViz/pull/5 . Awaits review, approval, deployment.

Yug raised the priority of this task from Low to Unbreak Now!.Jul 6 2022, 3:29 PM
tstarling lowered the priority of this task from Unbreak Now! to High.Jul 15 2022, 6:14 AM
tstarling subscribed.

I don't think this is "unbreak now". See https://www.mediawiki.org/wiki/Phabricator/Project_management#Priority_levels for information about setting task priority.

Yug renamed this task from QueryViz to support default endpoint switch to QueryViz: support default endpoint switch.Jul 19 2022, 5:38 PM
Yug updated the task description. (Show Details)
Yug set the point value for this task to 2.Jul 21 2022, 6:22 PM

Need to deploy with Michael AND Yug.
JS seems without error nor warning: https://jsfiddle.net/ebuvn0d2/1/

Deployed this day by Michael & myself.

  • Lingua Libre Query Service: works
  • WikiData Query Service: works
  • Wikimedia Commons Query Service: fails

See also https://lingualibre.org/wiki/Help:SPARQL/test

Reason

Wikimedia Commons Query Service's end point rejects external queries :

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://commons.wikimedia.org/wiki/Special:OAuth/authenticate?oauth_token=b0685605ac44eb315c2571d1a0fb43db. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 302.

According to commons:Commons:SPARQL_query_service#Release_notes :

OAuth is currently not working. See https://stackoverflow.com/questions/65303450/how-to-authenticate-to-wikimedia-commons-query-service-using-oauth-in-python#comment115828158_65424900. This is so that we can contact abusive bots and/or users and block them selectively as a last resort if needed.

See also phab:T297995.

Note

Note to Poslovitch : https://www.dictionnairedesfrancophones.org/sparql not included in the change, but could be.