Dear all,
Recently I updated my Wikibase instance to use WBS Deploy 5.0.1. I think I have resolved almost all of the issues post-update, except for one. The pre-loaded SPARQL query prefixes on the WDQS front-end maintain their Wikidata values.
The query service is here:
The WDQS custom config can be seen here:
https://query.qawiki.org/custom-config.json
The query SELECT (STR(wd:Q1) AS ?iri) WHERE {}
returns
http://www.wikidata.org/entity/Q1
Queries using new / non-standard prefixes fail for using an undefined prefix. I've searched around, but cannot find much documentation about this.
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)?
Best/thanks, Aidan
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
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
Hi all, Berkeley Law is also very curious about this... Michael Lindsey
On Thu, Mar 5, 2026 at 2:05 PM Raphael Wimmer via Wikibase Community User Group wikibaseug@lists.wikimedia.org 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 _______________________________________________ Wikibase Community User Group mailing list -- wikibaseug@lists.wikimedia.org To unsubscribe send an email to wikibaseug-leave@lists.wikimedia.org
Here's a list of annotated changes Rhizome did to the query service to customize, among other things, the prefixes:
https://github.com/rhizomedotorg/artbase-query-gui/commit/29ce17b225a3fb9d9b...
On Fri, Mar 6, 2026 at 1:47 AM Michael Lindsey via Wikibase Community User Group wikibaseug@lists.wikimedia.org wrote:
Hi all, Berkeley Law is also very curious about this... Michael Lindsey
On Thu, Mar 5, 2026 at 2:05 PM Raphael Wimmer via Wikibase Community User Group wikibaseug@lists.wikimedia.org 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 _______________________________________________ Wikibase Community User Group mailing list -- wikibaseug@lists.wikimedia.org To unsubscribe send an email to wikibaseug-leave@lists.wikimedia.org
Wikibase Community User Group mailing list -- wikibaseug@lists.wikimedia.org To unsubscribe send an email to wikibaseug-leave@lists.wikimedia.org
Thank you Dragan! I understand this applied more changes than the prefix, but it contains some useful hints on where I might have to look.
As a quick question, do you recall if changes were necessary to the back-end with Blazegraph? I am happy for now that the frond-end is configured with workable prefixes, but the back-end still interprets default Wikidata prefixes.
Best/thanks, Aidan
On 2026-03-06 02:44, Dragan Espenschied wrote:
Here's a list of annotated changes Rhizome did to the query service to customize, among other things, the prefixes:
https://github.com/rhizomedotorg/artbase-query-gui/ commit/29ce17b225a3fb9d9bcd16896778f94495fdf9c9?diff=split#diff- a9cd85f33efd6ec23d9b1a8bfc86fdc19bccde0646bdab4e1afdfff5c6c6060a <https://github.com/rhizomedotorg/artbase-query-gui/ commit/29ce17b225a3fb9d9bcd16896778f94495fdf9c9?diff=split#diff- a9cd85f33efd6ec23d9b1a8bfc86fdc19bccde0646bdab4e1afdfff5c6c6060a>
On Fri, Mar 6, 2026 at 1:47 AM Michael Lindsey via Wikibase Community User Group <wikibaseug@lists.wikimedia.org mailto:wikibaseug@lists.wikimedia.org> wrote:
Hi all, Berkeley Law is also very curious about this... Michael Lindsey On Thu, Mar 5, 2026 at 2:05 PM Raphael Wimmer via Wikibase Community User Group <wikibaseug@lists.wikimedia.org <mailto:wikibaseug@lists.wikimedia.org>> 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/queryService/RdfNamespaces.js <https://github.com/ wikimedia/wikidata-query-gui/blob/master/wikibase/queryService/ RdfNamespaces.js> Here's the diff: https://github.com/wikimedia/wikidata-query-gui/compare/ master...PDA-UR:wikidata-query-gui-graphIT:master#diff- f9f77fb16c8abe9c7aa0abfa9cb44e95e72a2c23e71e98d23b10c73f8aa4aeb5 <https://github.com/wikimedia/wikidata-query-gui/compare/ master...PDA-UR:wikidata-query-gui-graphIT:master#diff- f9f77fb16c8abe9c7aa0abfa9cb44e95e72a2c23e71e98d23b10c73f8aa4aeb5> IIRC, we imitated the way, the Rhizome Artbase did it: https://github.com/rhizomedotorg/artbase-query-gui/blob/master/ wikibase/queryService/RdfNamespaces.js <https://github.com/ rhizomedotorg/artbase-query-gui/blob/master/wikibase/ queryService/RdfNamespaces.js> (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 _______________________________________________ Wikibase Community User Group mailing list -- wikibaseug@lists.wikimedia.org <mailto:wikibaseug@lists.wikimedia.org> To unsubscribe send an email to wikibaseug- leave@lists.wikimedia.org <mailto:wikibaseug- leave@lists.wikimedia.org> _______________________________________________ Wikibase Community User Group mailing list -- wikibaseug@lists.wikimedia.org <mailto:wikibaseug@lists.wikimedia.org> To unsubscribe send an email to wikibaseug-leave@lists.wikimedia.org <mailto:wikibaseug-leave@lists.wikimedia.org>--
Dragan Espenschied https://despens.digital/
Preservation https://rhizome.org/tags/preservation/ Director Rhizome http://rhizome.org at the New Museum ORCID https://orcid.org/0000-0003-1968-6172 0000-0003-1968-6172
Hi all,
I believe I have managed to update the prefixes, and send the steps I followed here for posterity. I am not sure if this is the most direct solution or not, but hopefully this can be done more easily via config files in future.
Both the front-end and back-end need to be updated, but since the front-end does not automatically prepend prefixes to queries sent to the back-end, it's the back-end configuration that is most essential (for front-end, it mostly affects U.I. items).
See below the sketch.
Best, Aidan
==========================================================
## Fixing prefixes from deploy/ folder
mkdir -p config/wdqs
# need to edit these files, or at least wdqs # files will likely have different but similar names
docker cp wbs-deploy-wdqs-frontend-1:/usr/share/nginx/html/js/wdqs.min.afca8458b68f319647ae.js ./config/wdqs/
docker cp wbs-deploy-wdqs-frontend-1:/usr/share/nginx/html/js/embed.wdqs.min.ce30c6c5a55c57e335ab.js ./config/wdqs/
# edit both files locally to replace all # www.wikidata.org or wikidata.org with yoursite.org, # also potentially changing http to https
# edit docker-compose.yml to bind-mound
wdqs-frontend: image: wikibase/wdqs-frontend:2 volumes: - ./config/wdqs/wdqs.min.afca8458b68f319647ae.js:/usr/share/nginx/html/js/wdqs.min.afca8458b68f319647ae.js:ro - ./config/wdqs/embed.wdqs.min.ce30c6c5a55c57e335ab.js:/usr/share/nginx/html/js/embed.wdqs.min.ce30c6c5a55c57e335ab.js:ro # rebuild and restart front-end docker compose up -d --force-recreate wdqs-frontend
# check 1: go to front-end, do a hard refresh, in menu # on left, add prefixes (the pin), see what is printed. # this should show new prefixes
# check 2: run SELECT * WHERE { BIND(wd:Q1 as ?s) } # this will likely print old prefixes because this is # how the back-end wdqs sees the prefixes; to fix ...
# get prefixes conf from back end docker cp wbs-deploy-wdqs-1:/wdqs/prefixes.conf ./config/wdqs/prefixes.conf
# edit this file to add all the new prefixes you need (many will not already appear, but this will overwrite them)
# edit docker-compose.yml to bind-mount the custom file wdqs: volumes: - ./config/wdqs/prefixes.conf:/wdqs/prefixes.conf:ro
# rebuild docker compose up -d --force-recreate wdqs
# hopefully now both front-end and back-end are configured correctly with new prefixes.
# check: run on front-end SELECT * WHERE { BIND(wd:Q1 as ?s) } # should use new prefixes
On 2026-03-06 19:11, Aidan Hogan wrote:
Thank you Dragan! I understand this applied more changes than the prefix, but it contains some useful hints on where I might have to look.
As a quick question, do you recall if changes were necessary to the back-end with Blazegraph? I am happy for now that the frond-end is configured with workable prefixes, but the back-end still interprets default Wikidata prefixes.
Best/thanks, Aidan
On 2026-03-06 02:44, Dragan Espenschied wrote:
Here's a list of annotated changes Rhizome did to the query service to customize, among other things, the prefixes:
https://github.com/rhizomedotorg/artbase-query-gui/ commit/29ce17b225a3fb9d9bcd16896778f94495fdf9c9?diff=split#diff- a9cd85f33efd6ec23d9b1a8bfc86fdc19bccde0646bdab4e1afdfff5c6c6060a <https://github.com/rhizomedotorg/artbase-query-gui/ commit/29ce17b225a3fb9d9bcd16896778f94495fdf9c9?diff=split#diff- a9cd85f33efd6ec23d9b1a8bfc86fdc19bccde0646bdab4e1afdfff5c6c6060a>
On Fri, Mar 6, 2026 at 1:47 AM Michael Lindsey via Wikibase Community User Group <wikibaseug@lists.wikimedia.org mailto:wikibaseug@lists.wikimedia.org> wrote:
Hi all, Berkeley Law is also very curious about this... Michael Lindsey
On Thu, Mar 5, 2026 at 2:05 PM Raphael Wimmer via Wikibase Community User Group <wikibaseug@lists.wikimedia.org mailto:wikibaseug@lists.wikimedia.org> 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/queryService/RdfNamespaces.js <https://github.com/ wikimedia/wikidata-query-gui/blob/master/wikibase/queryService/ RdfNamespaces.js>
Here's the diff: https://github.com/wikimedia/wikidata-query-gui/compare/ master...PDA-UR:wikidata-query-gui-graphIT:master#diff- f9f77fb16c8abe9c7aa0abfa9cb44e95e72a2c23e71e98d23b10c73f8aa4aeb5 <https://github.com/wikimedia/wikidata-query-gui/compare/ master...PDA-UR:wikidata-query-gui-graphIT:master#diff- f9f77fb16c8abe9c7aa0abfa9cb44e95e72a2c23e71e98d23b10c73f8aa4aeb5>
IIRC, we imitated the way, the Rhizome Artbase did it: https://github.com/rhizomedotorg/artbase-query-gui/blob/master/ wikibase/queryService/RdfNamespaces.js <https://github.com/ rhizomedotorg/artbase-query-gui/blob/master/wikibase/ queryService/RdfNamespaces.js>
(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 _______________________________________________ Wikibase Community User Group mailing list -- wikibaseug@lists.wikimedia.org mailto:wikibaseug@lists.wikimedia.org To unsubscribe send an email to wikibaseug- leave@lists.wikimedia.org <mailto:wikibaseug- leave@lists.wikimedia.org>
_______________________________________________ Wikibase Community User Group mailing list -- wikibaseug@lists.wikimedia.org mailto:wikibaseug@lists.wikimedia.org To unsubscribe send an email to wikibaseug-leave@lists.wikimedia.org mailto:wikibaseug-leave@lists.wikimedia.org
--
Dragan Espenschied https://despens.digital/
Preservation https://rhizome.org/tags/preservation/ Director Rhizome http://rhizome.org at the New Museum ORCID https://orcid.org/0000-0003-1968-6172 0000-0003-1968-6172
wikibaseug@lists.wikimedia.org