Skip to content

Commit

Permalink
fix: injected standard prefixes reference wikidata (#804)
Browse files Browse the repository at this point in the history
As reported in #798, the "standard prefixes" injected by WDQS do not align with the WIKIBASE_CONCEPT_URI setting introduced in #771, nor do they match the corresponding values for Wikidata. Currently, the WDQS-injected "standard prefixes" (such as wd:) reference http://wikidata/, which is the internal hostname of the wikibase/mediawiki container within the Docker network.

Particularly in the context of federation, it is essential to maintain the "standard prefixes" for referencing Wikidata [1] [2]. To accommodate the local Wikibase instance, prefixes can be set inline, as is currently done on wikibase.cloud [2]. This pull request addresses this and updates the "standard prefixes" to point to Wikidata. Additional context can be found in [3].

[1] https://www.mediawiki.org/wiki/Wikibase/Wikibase.cloud/First_steps#View_your_data_using_the_Query_Service
[2] https://phabricator.wikimedia.org/T335448
[3] https://phabricator.wikimedia.org/T379232
  • Loading branch information
rti authored Nov 28, 2024
1 parent eaf9638 commit e97290e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion build/wdqs/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,24 @@ done

set -eu

export BLAZEGRAPH_OPTS="${BLAZEGRAPH_EXTRA_OPTS} -DwikibaseHost=${WIKIBASE_HOST}"
# Options provided to WDQS (blazegraph) when running as query service instance
#
# Note: We MUST not provide -DwikibaseHost=${WIKIBASE_HOST} here, otherwise
# WDQS would re-use the wd: et al. prefixes for the local wikibase instance.
# This is unintended, especially in the context of federation. wd: prefixes
# should remain in place for referencing wikidata. The local instance should
# choose its own prefixes, as described here:
# https://www.mediawiki.org/wiki/Wikibase/Wikibase.cloud/First_steps#View_your_data_using_the_Query_Service
# Some further thoughts on prefixes: https://phabricator.wikimedia.org/T335448
#
# In other words, WDQS does not know about the hostname of the wiki it gets
# its data from. Is is solely the task of the updater to feed data from the
# wiki into the WDQS instance.
export BLAZEGRAPH_OPTS="${BLAZEGRAPH_EXTRA_OPTS}"

# Options provided when running as wdqs-updater
#
# Here we provide -DwikibaseHost to reference the wiki to poll updates from.
export UPDATER_OPTS="-DwikibaseHost=${WIKIBASE_HOST} -DwikibaseMaxDaysBack=${WIKIBASE_MAX_DAYS_BACK}"

envsubst < /templates/mwservices.json > /wdqs/mwservices.json
Expand Down

0 comments on commit e97290e

Please sign in to comment.