Page MenuHomePhabricator

SPARQL interface in Wikibase Suite (V3) queries against query.wikidata.org in stead of local triple store
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Do a straight vanilla install of the Wikibase Suite (V3) as described here: https://github.com/wmde/wikibase-release-pipeline/blob/main/deploy/README.md
  • Bring up the containers: docker compose up --wait
  • Open the SPARQL interface in the browser, and open the Developer Tools panel. Select the Network tab.
  • Issue some query. It doesn't matter that we have not yet created items and properties via Wikibase yet.

What happens?:
You will see in the Network tab that a request is made to query.wikidata.org

What should have happened instead?:
The query should be execute against the local triple store (inside the wdqs container that comes with the Wikibase Suite)

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

July 2024 3.x.x on MediaWiki 1.42⁠

MediaWiki 1.42.1
PHP 8.3.8 (apache2handler)
ICU 72.1
MariaDB 10.11.9-MariaDB-ubu2204
Elasticsearch 7.10.2
Pygments 2.17.2

Other information (browser name/version, screenshots, etc.):

Event Timeline

aholleman renamed this task from SPARQL interface in Wikibase Suite (V3) queries against query.wikidata.org in stead of to SPARQL interface in Wikibase Suite (V3) queries against query.wikidata.org in stead of local triple store.Aug 15 2024, 9:52 AM

Hi @aholleman,

Thanks a lot for reporting this.

I think there is a misunderstanding. In my tests with WBS Deploy 3, the WDQS frontend does query the local WDQS instance.

The request you see in the browsers dev tools could be fetching SPARQL examples, that are then accessible to the user via the "Examples" button on the WDQS frontend GUI. This examples are hosted here: https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples

At the moment, unfortunately, there is not an official supported way to adjust the location of the examples. If you still want to provide your own examples, you could mount a custom configuration defining the location of your example wiki page into the WDQS frontend container like this:

diff --git a/deploy/config/wdqs-frontend.template.json b/deploy/config/wdqs-frontend.template.json
new file mode 100644
index 0000000..329d34e
--- /dev/null
+++ b/deploy/config/wqds-frontend.template.json
@@ -0,0 +1,24 @@
+{
+       "api": {
+               "sparql": {
+                       "uri": "/proxy/wdqs/bigdata/namespace/wdq/sparql"
+               },
+               "wikibase": {
+                       "uri": "/proxy/wikibase/w/api.php"
+               },
+               "urlShortener": "tinyurl",
+               "examples": {
+                       "server": "https://www.my-wiki-with-sparql-examples.org/",
+                       "apiPath": "w/api.php",
+                       "pageTitle": "Wikidata:SPARQL_query_service/queries/examples",
+                       "pagePathElement": "wiki/"
+               }
+       },
+       "brand": {
+               "title": "$BRAND_TITLE",
+               "logo": "logo.svg",
+               "favicon": "favicon.ico",
+               "copyrightUrl": "$COPYRIGHT_URL",
+               "index": "./index.html"
+       }
+}
diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml
index 336ffb2..4ed304d 100644
--- a/deploy/docker-compose.yml
+++ b/deploy/docker-compose.yml
@@ -130,6 +130,8 @@ services:
     depends_on:
       - wdqs-proxy
     restart: unless-stopped
+    volumes:
+      - ./config/wdqs-frontend.template.json:/templates/custom-config.json
     labels:
       - "traefik.enable=true"
       - "traefik.http.routers.wdqs-frontend.rule=Host(`${WDQS_FRONTEND_PUBLIC_HOST}`)"

Hope that helps,
Best,
Robert

Closing this now. Feel free to re-open or create a new ticket for a followup.

Best,
Robert