Wikidata Query Service/Implementation/Standalone

WDQS can be run as a service for any Wikibase instance, not just Wikidata. You can still follow the instructions in the documentation, with the changes described below.

To generate the dump of your database, use  script in the   directory of Wikibase extension. Depending on your requirements, you may still want to run  script, or you may load the resulting RDF directly into the database.

For development, you may also consider Docker-based setup at https://github.com/wmde/wikibase-docker

Note that Blazegraph and Updater require significant amount of memory to run, so it is recommended if running on a VM (or VM-like setup like Docker) or other memory-restricted environment to allocate enough memory - 4 to 8G should be a good guideline.

Required setup
So far, the following conditions should be fulfilled by Wikibase instance for WDQS to work properly: Given Wikibase install top URL as ,
 * RecentChanges API should be accessible at
 * Entity data dump should be accessible at  for entity.

If your Wikibase instance has different URL scheme, the recommended way is to create web server redirects for these two, as these parts are not customizable yet. See below about the URL customization.

You can also separately set Wikibase entity concept URL. The assumptions are, given base URL as :
 * The entity prefix is
 * The data prefix is

You can verify those looking at  and   prefixes in the entity dump URL above, e.g. https://www.wikidata.org/wiki/Special:EntityData/Q4.ttl

WDQS Configurations
Two main things you may need to change are Wikibase endpoint (the URL at which your Wikibase instance is accessible) and concept URI (the URI which prefixes the RDF URIs describing data in your instance). Note that these by default are related but are controlled independently, and do not have to match. By default both settings are set up to match Wikidata data.

If you're running a copy of Wikidata but on your own domain, you may need to change Wikibase endpoint. If you are running your own dataset, you also need to change concept URI.

Setting Wikibase endpoint
This setting controls the URL at which Wikibase instance is found. See above for the list of URLs that are expected to work relative to this URL.

For Updater: For Munger:
 * Use  option when running Updater to set up Wikibase URL.
 * No changes are needed since Munger does not communicate with Wikibase

For Blazegraph:
 * No changes are needed since Blazegraph does not communicate with Wikibase

Setting concept URI
For Munger:


 * Use  option when running Munger. The rules for the URL are the same as for Update above.

Example: bash munge.sh -f mydump.ttl.gz -d data/split -- --conceptUri https://my-wikibase:8081 For Updater:


 * Use  option when running Updater. The URL should match the one seen in the TTL export in   prefix, e.g. if the prefix is defined as:   then the URL will be   Example:

bash runUpdate.sh -- --wikibaseUrl https://my-wikibase:8081 --conceptUri https://my-wikibase:8081 For Blazegraph:
 * Set  Java property when running Blazegraph. If you only change hostname, you can use   instead. Example:

Setting entity namespaces
For Updater:

The updater looks for changes in namespaces 0 and 120 by default, which are the Item and Property namespaces on Wikidata. In a default Wikibase installation, Item and Property are instead namespaces 120 and 122. If your installation follows this setup, add the option  when running the updater. (If you have other entity namespaces, e. g. for lexicographical data, make sure to add them to the list.)

GUI configurations
In order to configure GUI, you have to use source (not built/minimized) version of GUI: https://github.com/wikimedia/wikidata-query-gui

In the  file there are two settings you may want to change:


 * : The URL of the SPARQL endpoint (can be relative to the GUI main URL)
 * : The URL of the Wikidata API endpoint (including path, e.g..