Hi Raphael, +1! Would be great to document this as it's something that many would need when configuring a custom WDQS install.
For posterity, using WBS Deploy 5.0.1, I can document here what I did (relative to the folder of docker-compose.yml), and where I still have a problem.
1) I edited ./config/wdqs-frontend-config.json to insert prefixes. See below (not sure this is the full list one might need).
2) Restart wdqs-frontend in docker. Double check that the prefixes appear in https://query.qawiki.org/custom-config.json adapted for your case. You might need a hard refresh (Ctrl + Shift + R) in the browser.
3) In the front-end SPARQL interface, do another hard refresh just in case, and run a query like:
SELECT (https://qawiki.org/entity/Q1 AS ?s) WHERE { }
replacing the IRI with one that should have a prefix. The result should appear as wd:Q1 in the UI results rather than the full IRI. If so, then the front-end understands the prefixes.
4) To check that the backend also interprets the new prefixes, run from the machine hosting the deploy:
curl -sS -H 'Host: query.qawiki.org' --data-urlencode 'query=SELECT (wd:Q1 AS ?iri) WHERE {}' http://127.0.0.1/sparql
changing the host.
Step 3 works fine for me. The problem in my case is that step 4 returns http://www.wikidata.org/entity/Q1, not https://qawiki.org/entity/Q1. Running the query (SELECT (wd:Q1 AS ?iri) WHERE {}) via the front-end UI gives the same Wikidata IRI.
I guess this means that either
a) the front-end should add the prefixes explicitly to the queries sent to the back end to override its default configuration, but it's not doing this correctly in my instance, or
b) the front-end is not supposed to send the prefixes to the back-end, but rather the back-end should have the prefixes configured too, and this is not working in my instance.
If anyone can help with this, it would be hugely appreciated.
Best, Aidan
----------------------
Adapt and insert something like (as a sibling of "api" and "brand"):
"prefixes": { "wd": "https://qawiki.org/entity/", "wdt": "https://qawiki.org/prop/direct/", "p": "https://qawiki.org/prop/", "ps": "https://qawiki.org/prop/statement/", "pq": "https://qawiki.org/prop/qualifier/", "pr": "https://qawiki.org/prop/reference/", "psv": "https://qawiki.org/prop/statement/value/", "pqv": "https://qawiki.org/prop/qualifier/value/", "prv": "https://qawiki.org/prop/reference/value/", "wdno":"https://qawiki.org/prop/novalue/", "wds": "https://qawiki.org/entity/statement/", "wdref":"https://qawiki.org/reference/", "wikibase": "https://qawiki.org/ontology#", "prov": "http://www.w3.org/ns/prov#" }
On 2026-03-05 18:35, Raphael Wimmer wrote:
Hi Aidan, all,
On Thu, 2026-03-05 at 15:07 -0300, Aidan Hogan via Wikibase Community User Group wrote: [...]
Would appreciate it a lot if anyone can provide pointers on how to configure the prefixes used in the WDQS front end (and back end if necessary)?
This is a topic where I would appreciate an answer, too. For the old, pre-Wikibase-Deploy Docker images, we forked the WDQS frontend so that we could use "wd" prefixes with our instance (because that seems/seemed to be the most robust way to achieve syntax completion, etc. in the query editor).
We modified this file: https://github.com/wikimedia/wikidata-query-gui/blob/master/wikibase/querySe...
Here's the diff: https://github.com/wikimedia/wikidata-query-gui/compare/master...PDA-UR:wiki...
IIRC, we imitated the way, the Rhizome Artbase did it: https://github.com/rhizomedotorg/artbase-query-gui/blob/master/wikibase/quer...
(To be clear: I'm not sure if this information does apply to the most recent version, and this certainly is an ugly hack.)
If there is an easier way, I'd really appreciate a guide.
Cheers, Raphael