Page MenuHomePhabricator

UI for SPARQL Endpoint for Commons
Closed, ResolvedPublic

Description

Some UI changes are needed for the SEfC:

  • Page title (configurable)
  • Auto-completion (mostly hardcoded - depends on prefixes, that are currently Wikidata based, and queries to Cirrus)
  • Prefixes in the result (they are hardcoded around Wikidata dump prefixes)
  • examples

Event Timeline

Per discussion with @Addshore :
Search is done by executing this call:
https://www.wikidata.org/w/api.php?origin=*&action=wbsearchentities&format=json&limit=50&continue=0&language=en&uselang=en&search=cat&type=item

As for the code and prefixes:

in the wdqs gui the search ultimately happens here https://github.com/wikimedia/wikidata-query-gui/blob/b49263487713775140201c8adb7bc3fcf1c67fd8/wikibase/queryService/api/Wikibase.js#L81-L97 right now always hardcoded to wikidata.org which would need to change for commons https://github.com/wikimedia/wikidata-query-gui/blob/b49263487713775140201c8adb7bc3fcf1c67fd8/wikibase/queryService/api/Wikibase.js#L8
12:34 looking for the prefix to type mapping now
12:36 https://github.com/wikimedia/wikidata-query-gui/blob/e443e77b5e5c2b894e3b6d8bc75b3b31f0a44622/wikibase/queryService/ui/editor/hint/Rdf.js#L91-L97 the namespaces get added into this thing https://github.com/wikimedia/wikidata-query-gui/blob/e443e77b5e5c2b894e3b6d8bc75b3b31f0a44622/wikibase/queryService/ui/editor/hint/Rdf.js#L22
12:36 i think that plays into it
12:37 https://github.com/wikimedia/wikidata-query-gui/blob/4adea222ed6c783f6a0d7450d5dd3a3fc6114bdc/wikibase/queryService/RdfNamespaces.js#L51-L67 <<<< namespace to entity type mapping
12:37 so the hardcoded api for wikidata.org and that namespace mapping for namespace to entity type should be all you need to work with
12:37 then the autocompletion and search should just work TM
12:40 Interestingly this looks like it ties in slightly with the idea of WikibaseManifest that we prototypes a while back, which wouldd specify what rdf namespaces are availbile on a wikibase by default , example output https://github.com/wmde/WikibaseManifest/blob/master/docs/examples/wikidata.json#L7
12:40 though that doesnt allow you to know what the default prefixes are that are defined in a query service currently

To potentially block auto complete:

You might need to do something with https://github.com/wikimedia/wikidata-query-gui/blob/master/wikibase/init.js#L70-L72 in order to not make it load the auto completion stuff

in the wdqs gui the search ultimately happens here https://github.com/wikimedia/wikidata-query-gui/blob/b49263487713775140201c8adb7bc3fcf1c67fd8/wikibase/queryService/api/Wikibase.js#L81-L97 right now always hardcoded to wikidata.org

The hard-coded value is just the default and can be overridden in the constructor; wikibase/init.js does that, for example, to use the correct endpoint from the config. (That said, some other services seem to create their own, independent Wikibase instances, without the correct config. Probably a bug.)

After talking with Ramsey and Keegan, we should use the Commons logo and the page title should be "Wikimedia Commons Query Service".

Change 605708 had a related patch set uploaded (by Mstyles; owner: Mstyles):
[wikidata/query/gui@master] add config file for commons query service

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

Change 605708 abandoned by Mstyles:
add config file for commons query service

Reason:
moving to puppet

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

Change 606297 had a related patch set uploaded (by Mstyles; owner: Mstyles):
[operations/puppet@production] sdoc gui idea

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

Change 606516 had a related patch set uploaded (by Mstyles; owner: Mstyles):
[wikidata/query/gui@master] add commons logo file

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

Change 606545 had a related patch set uploaded (by Mstyles; owner: Mstyles):
[wikidata/query/gui-deploy@production] remove custom config

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

Since the gui directory is overwritten by scap via symlinks, Guillaume proposed that the config files live in /etc/config and that they be symlinked to the gui directory. See more discussion here:https://gerrit.wikimedia.org/r/c/operations/puppet/+/606297. I want to remove the custom config file that lives in the gui-deploy repo to avoid any confusion of config files: https://gerrit.wikimedia.org/r/c/wikidata/query/gui-deploy/+/606545

Gehel moved this task from Epics to SDAW on the Wikidata-Query-Service board.

Change 610355 had a related patch set uploaded (by DCausse; owner: DCausse):
[wikidata/query/deploy@master] Add a symlink to /etc/wdqs/gui-config.json

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

Change 610355 abandoned by DCausse:
[wikidata/query/deploy@master] Add a symlink to /etc/wdqs/gui-config.json

Reason:
trying a nginx location instead

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

Change 606297 merged by Ryan Kemper:
[operations/puppet@production] [wcqs] gui custom config

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

Change 611189 had a related patch set uploaded (by DCausse; owner: DCausse):
[wikidata/query/gui@master] Keep ratio of the logo

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

Change 611196 had a related patch set uploaded (by DCausse; owner: DCausse):
[operations/puppet@production] [wcqs] update logo URL

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

Change 611189 merged by jenkins-bot:
[wikidata/query/gui@master] Keep ratio of the logo

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

Change 611196 merged by Gehel:
[operations/puppet@production] [wcqs] update logo URL

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

Change 606516 abandoned by Mstyles:
[wikidata/query/gui@master] add commons logo file

Reason:
another change made

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

Gehel claimed this task.

Change 606545 merged by Gehel:
[wikidata/query/gui-deploy@production] remove custom config

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